|
| SignalTyped2 (String &&name) |
| Constructor.
|
|
template<typename Func , typename... BoundArgs> |
unsigned int | operator() (const Func &func, const BoundArgs &... args) |
| Connects a signal handler that will be called when this signal is emitted. More...
|
|
template<typename Func , typename... BoundArgs, typename std::enable_if_t< std::is_convertible< Func, std::function< void(const BoundArgs &...)>>::value > * = nullptr> |
unsigned int | connect (const Func &func, const BoundArgs &... args) |
| Connects a signal handler that will be called when this signal is emitted. More...
|
|
template<typename Func , typename... BoundArgs, typename std::enable_if_t< std::is_convertible< Func, std::function< void(const BoundArgs &..., T1, T2)>>::value > * = nullptr> |
unsigned int | connect (const Func &func, const BoundArgs &... args) |
| Connects a signal handler that will be called when this signal is emitted. More...
|
|
bool | emit (const Widget *widget, T1 param1, T2 param2) |
| Call all connected signal handlers. More...
|
|
virtual | ~Signal ()=default |
| Default destructor.
|
|
| Signal (String &&name, std::size_t extraParameters=0) |
| Constructor. More...
|
|
| Signal (const Signal &other) |
| Copy constructor which will not copy the signal handlers.
|
|
| Signal (Signal &&other) noexcept=default |
| Default move constructor.
|
|
Signal & | operator= (const Signal &other) |
| Copy assignment operator which will not copy the signal handlers.
|
|
Signal & | operator= (Signal &&other) noexcept=default |
| Default move assignment operator.
|
|
template<typename Func , typename... BoundArgs> |
unsigned int | operator() (const Func &func, const BoundArgs &... args) |
| Connects a signal handler that will be called when this signal is emitted. More...
|
|
template<typename Func , typename... BoundArgs, typename std::enable_if_t< std::is_convertible< Func, std::function< void(const BoundArgs &...)>>::value > * = nullptr> |
unsigned int | connect (const Func &func, const BoundArgs &... args) |
| Connects a signal handler that will be called when this signal is emitted. More...
|
|
template<typename Func , typename... BoundArgs, typename std::enable_if_t< std::is_convertible< Func, std::function< void(const BoundArgs &..., std::shared_ptr< Widget >, const String &)>>::value , * = nullptr> |
unsigned int | connectEx (const Func &func, const BoundArgs &... args) |
| Connects a signal handler that will be called when this signal is emitted. More...
|
|
bool | disconnect (unsigned int id) |
| Disconnect a signal handler from this signal. More...
|
|
void | disconnectAll () |
| Disconnect all signal handler from this signal.
|
|
bool | emit (const Widget *widget) |
| Call all connected signal handlers. More...
|
|
String | getName () const |
| Returns the name given to the signal. More...
|
|
void | setEnabled (bool enabled) |
| Changes whether this signal calls the connected functions when triggered. More...
|
|
bool | isEnabled () const |
| Returns whether this signal calls the connected functions when triggered. More...
|
|
template<typename T1, typename T2>
class tgui::SignalTyped2< T1, T2 >
Signal to which the user can subscribe to get callbacks from.
Optional unbound parameters:
- T1, T2 (always occur together, having only one unbound parameter is unsupported)
template<typename T1 , typename T2 >
template<typename Func , typename... BoundArgs, typename std::enable_if_t< std::is_convertible< Func, std::function< void(const BoundArgs &..., T1, T2)>>::value > * = nullptr>
unsigned int tgui::SignalTyped2< T1, T2 >::connect |
( |
const Func & |
func, |
|
|
const BoundArgs &... |
args |
|
) |
| |
|
inline |
Connects a signal handler that will be called when this signal is emitted.
- Parameters
-
func | Callback function that have their last two parameters unbound of types T1 and T2 |
args | Additional arguments to pass to the function |
- Returns
- Unique id of the connection