|
typedef std::shared_ptr< SignalManager > | Ptr |
| Shared widget pointer.
|
|
typedef std::shared_ptr< const SignalManager > | ConstPtr |
| Shared constant widget pointer.
|
|
|
| SignalManager () |
| Default constructor.
|
|
virtual | ~SignalManager () |
| Destructor.
|
|
template<typename Func , typename... Args, typename std::enable_if< std::is_convertible< Func, std::function< void(const Args &...)> >::value >::type * = nullptr> |
unsigned int | connect (std::string widgetName, std::string signalName, Func &&handler, const Args &... args) |
| Connects a signal handler that will be called when this signal is emitted. More...
|
|
template<typename Func , typename... BoundArgs, typename std::enable_if<!std::is_convertible< Func, std::function< void(const BoundArgs &...)> >::value &&std::is_convertible< Func, std::function< void(const BoundArgs &..., std::shared_ptr< Widget >, const std::string &)> >::value , ::type * = nullptr> |
unsigned int | connect (std::string widgetName, std::string signalName, Func &&handler, BoundArgs &&... args) |
| Connects a signal handler that will be called when this signal is emitted. More...
|
|
template<typename Func , typename... BoundArgs> |
unsigned int | connect (std::string widgetName, std::initializer_list< std::string > signalNames, Func &&handler, BoundArgs &&... args) |
| Connect a signal handler to multiple signals. More...
|
|
virtual bool | disconnect (unsigned int id) |
| Disconnect a signal handler. More...
|
|
virtual void | disconnectAll () |
| Disconnect all signal handler.
|
|
|
virtual void | connect (SignalID id) |
| Function that is called each time new signal is created with it id. More...
|
|
◆ connect() [1/4]
virtual void tgui::SignalManager::connect |
( |
SignalID |
id | ) |
|
|
protectedvirtual |
Function that is called each time new signal is created with it id.
- Parameters
-
◆ connect() [2/4]
template<typename Func , typename... BoundArgs>
unsigned int tgui::SignalManager::connect |
( |
std::string |
widgetName, |
|
|
std::initializer_list< std::string > |
signalNames, |
|
|
Func && |
handler, |
|
|
BoundArgs &&... |
args |
|
) |
| |
Connect a signal handler to multiple signals.
- Parameters
-
widgetName | Name of the widget to connect to |
signalNames | List of signal names that will trigger the signal handler |
handler | Callback function |
args | Optional extra arguments to pass to the signal handler when the signal is emitted |
- Returns
- Unique id of the last connection. When passing e.g. 2 signal names, the first signal will correspond to id-1.
◆ connect() [3/4]
template<typename Func , typename... BoundArgs, typename std::enable_if<!std::is_convertible< Func, std::function< void(const BoundArgs &...)> >::value &&std::is_convertible< Func, std::function< void(const BoundArgs &..., std::shared_ptr<
Widget >, const std::string &)> >::value , ::type * >
unsigned int tgui::SignalManager::connect |
( |
std::string |
widgetName, |
|
|
std::string |
signalName, |
|
|
Func && |
handler, |
|
|
BoundArgs &&... |
args |
|
) |
| |
Connects a signal handler that will be called when this signal is emitted.
- Parameters
-
widgetName | Name of the widget to connect to |
signalName | Name of the signal |
handler | Callback function that is given a pointer to the widget, the name of the signal and the extra arguments provided to this function as arguments |
args | Optional extra arguments to pass to the signal handler when the signal is emitted |
- Returns
- Unique id of the connection
◆ connect() [4/4]
template<typename Func , typename... Args, typename std::enable_if< std::is_convertible< Func, std::function< void(const Args &...)> >::value >::type * >
unsigned int tgui::SignalManager::connect |
( |
std::string |
widgetName, |
|
|
std::string |
signalName, |
|
|
Func && |
handler, |
|
|
const Args &... |
args |
|
) |
| |
Connects a signal handler that will be called when this signal is emitted.
- Parameters
-
widgetName | Name of the widget to connect to |
signalName | Name of the signal |
handler | Callback function that is given the extra arguments provided to this function as arguments |
args | Optional extra arguments to pass to the signal handler when the signal is emitted |
- Returns
- Unique id of the connection
◆ disconnect()
virtual bool tgui::SignalManager::disconnect |
( |
unsigned int |
id | ) |
|
|
virtual |
Disconnect a signal handler.
- Parameters
-
id | Unique id of the connection returned by the connect function |
- Returns
- True when a connection with this id existed and was removed
◆ getSignalManager()
Retrieves Signal Manager that will be used to operate a signal.
- Returns
- Signal Manager used to operate the signals
◆ setDefaultSignalManager()
static void tgui::SignalManager::setDefaultSignalManager |
( |
const SignalManager::Ptr & |
manager | ) |
|
|
static |
Sets Signal Manager that will be used to operate a signal.
- Parameters
-
manager | Manager that will be used to operate ours signals connected by loadWidgetsFromFile |
The documentation for this class was generated from the following files: