glibmm 2.88.0

Public Types | Public Member Functions | List of all members
Glib::SignalProxyDetailed< R(T...)> Class Template Reference

Proxy for signals with any number of arguments and possibly a detailed name. More...

`#include <glibmm/signalproxy.h>`

Inheritance diagram for Glib::SignalProxyDetailed< R(T...)>:
[legend]

## Public Types
using | SlotType = sigc::slot< R(T...)>
using | VoidSlotType = sigc::slot< void(T...)>

## Public Member Functions
| SignalProxyDetailed (ObjectBase *obj, const SignalProxyInfo *info, const Glib::ustring &detail_name)
sigc::connection | connect (const SlotType & slot, bool after)
| Connects a signal handler to a signal.
sigc::connection | connect (SlotType && slot, bool after)
| Connects a signal handler to a signal.
sigc::connection | connect_notify (const VoidSlotType & slot, bool after=false)
| Connects a signal handler without a return value to a signal.
sigc::connection | connect_notify (VoidSlotType && slot, bool after=false)
| Connects a signal handler without a return value to a signal.
Public Member Functions inherited from Glib::SignalProxyDetailedBase
| ~SignalProxyDetailedBase () noexcept
void | emission_stop ()
| Stops the current signal emission (not in libsigc++)
Public Member Functions inherited from Glib::SignalProxyBase
| SignalProxyBase (Glib::ObjectBase *obj)

## Additional Inherited Members
Protected Member Functions inherited from Glib::SignalProxyDetailedBase
| SignalProxyDetailedBase (Glib::ObjectBase *obj, const SignalProxyInfo *info, const Glib::ustring &detail_name)
| Creates a proxy for a signal that can be emitted by obj.
sigc::slot_base & | connect_impl_ (bool notify, const sigc::slot_base & slot, bool after)
| Connects a signal handler to a signal.
sigc::slot_base & | connect_impl_ (bool notify, sigc::slot_base && slot, bool after)
| Connects a signal handler to a signal.
Protected Attributes inherited from Glib::SignalProxyBase
ObjectBase * | obj_

## Detailed Description

template<class R, class... T>
class Glib::SignalProxyDetailed< R(T...)>

Proxy for signals with any number of arguments and possibly a detailed name.

Use the connect() or connect_notify() method, with sigc::mem_fun() or sigc::ptr_fun() to connect signal handlers to signals.

This is the primary template. There is a specialization for signal handlers that return `void`. The specialization has no connect_notify() method, and the after parameter in its connect() method has a default value.

## Member Typedef Documentation

## ◆ SlotType

template <class R , class... T>

using Glib::SignalProxyDetailed< R(T...)>::SlotType = sigc::slot<R(T...)>

## ◆ VoidSlotType

template <class R , class... T>

using Glib::SignalProxyDetailed< R(T...)>::VoidSlotType = sigc::slot<void(T...)>

## Constructor & Destructor Documentation

## ◆ SignalProxyDetailed()

template <class R , class... T>

Glib::SignalProxyDetailed< R(T...)>::SignalProxyDetailed | ( | ObjectBase * | obj,
|  | const SignalProxyInfo * | info,
|  | const Glib::ustring & | detail_name
| ) |  |
| inline

## Member Function Documentation

## ◆ connect() [1/2]

template <class R , class... T>

sigc::connection Glib::SignalProxyDetailed< R(T...)>::connect | ( | const SlotType & | slot,
|  | bool | after
| ) |  |
| inline

Connects a signal handler to a signal.

For instance, connect(sigc::mem_fun(*this, &TheClass::on_something), false);

For some signal handlers that return a value, it can make a big difference whether you connect before or after the default signal handler. Examples:

- Gio::Application::signal_command_line() calls only one signal handler. A handler connected after the default handler will never be called.
- X event signals, such as Gtk::Widget::signal_button_press_event(), stop calling signal handlers as soon as a called handler returns `true`. If the default handler returns `true`, a handler connected after it will not be called.

Parameters

  slot | The signal handler, usually created with sigc::mem_fun() or sigc::ptr_fun().
  after | Whether this signal handler should be called before or after the default signal handler.

Returns
  A sigc::connection.

## ◆ connect() [2/2]

template <class R , class... T>

sigc::connection Glib::SignalProxyDetailed< R(T...)>::connect | ( | SlotType && | slot,
|  | bool | after
| ) |  |
| inline

Connects a signal handler to a signal.

See also
  connect(const SlotType& slot, bool after).

Since glibmm 2.48:

## ◆ connect_notify() [1/2]

template <class R , class... T>

sigc::connection Glib::SignalProxyDetailed< R(T...)>::connect_notify | ( | const VoidSlotType & | slot,
|  | bool | after = `false`
| ) |  |
| inline

Connects a signal handler without a return value to a signal.

By default, the signal handler will be called before the default signal handler.

For instance, connect_notify( sigc::mem_fun(*this, &TheClass::on_something) );

If the signal requires signal handlers with a return value of type T, connect_notify() binds `return T()` to the connected signal handler. For instance, if the return type is `bool`, the following two calls are equivalent.

connect_notify(sigc::mem_fun(*this, &TheClass::on_something));
connect(sigc::bind_return<bool>(sigc::mem_fun(*this, &TheClass::on_something), false), false);
Glib::SignalProxyDetailed< R(T...)>::connect_notify
sigc::connection connect_notify(const VoidSlotType &slot, bool after=false)
Connects a signal handler without a return value to a signal.
Definition signalproxy.h:399
Glib::SignalProxyDetailed< R(T...)>::connect
sigc::connection connect(const SlotType &slot, bool after)
Connects a signal handler to a signal.
Definition signalproxy.h:365
sigc::mem_fun
decltype(auto) mem_fun(T_obj &obj, T_return(T_obj2::*func)(T_arg...))

Parameters

  slot | The signal handler, which should have a `void` return type, usually created with sigc::mem_fun() or sigc::ptr_fun().
  after | Whether this signal handler should be called before or after the default signal handler.

Returns
  A sigc::connection.

## ◆ connect_notify() [2/2]

template <class R , class... T>

sigc::connection Glib::SignalProxyDetailed< R(T...)>::connect_notify | ( | VoidSlotType && | slot,
|  | bool | after = `false`
| ) |  |
| inline

Connects a signal handler without a return value to a signal.

See also
  connect_notify(const VoidSlotType& slot, bool after).

Since glibmm 2.48: