TGUI  0.10-dev
tgui::SignalAnimation Class Reference

Signal to which the user can subscribe to get callbacks from. More...

#include <TGUI/Signal.hpp>

Inheritance diagram for tgui::SignalAnimation:
tgui::Signal

Public Member Functions

 SignalAnimation (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 &..., ShowAnimationType)> >::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 &..., bool)> >::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 &..., ShowAnimationType, bool)> >::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, ShowAnimationType type, bool visible)
 Call all connected signal handlers. More...
 
- Public Member Functions inherited from tgui::Signal
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.
 
Signaloperator= (const Signal &other)
 Copy assignment operator which will not copy the signal handlers.
 
Signaloperator= (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...
 

Additional Inherited Members

- Static Protected Member Functions inherited from tgui::Signal
static std::shared_ptr< WidgetgetWidget ()
 Extracts the widget stored in the first parameter.
 
template<typename Type >
static const std::decay_t< Type > & dereferenceParam (std::size_t paramIndex)
 Turns the void* parameters back into its original type right before calling the callback function.
 

Detailed Description

Signal to which the user can subscribe to get callbacks from.

Optional unbound parameters:

  • ShowAnimationType
  • bool (true for showing and false for hiding)
  • ShowAnimationType, bool

Member Function Documentation

◆ connect() [1/4]

template<typename Func , typename... BoundArgs, typename std::enable_if_t< std::is_convertible< Func, std::function< void(const BoundArgs &...)> >::value > * = nullptr>
unsigned int tgui::SignalAnimation::connect ( const Func &  func,
const BoundArgs &...  args 
)
inline

Connects a signal handler that will be called when this signal is emitted.

Parameters
funcCallback function without unbound parameters
argsAdditional arguments to pass to the function
Returns
Unique id of the connection

◆ connect() [2/4]

template<typename Func , typename... BoundArgs, typename std::enable_if_t< std::is_convertible< Func, std::function< void(const BoundArgs &..., ShowAnimationType)> >::value > * = nullptr>
unsigned int tgui::SignalAnimation::connect ( const Func &  func,
const BoundArgs &...  args 
)
inline

Connects a signal handler that will be called when this signal is emitted.

Parameters
funcCallback function that has an unbound ShowAnimationType as last parameter
argsAdditional arguments to pass to the function
Returns
Unique id of the connection

◆ connect() [3/4]

template<typename Func , typename... BoundArgs, typename std::enable_if_t< std::is_convertible< Func, std::function< void(const BoundArgs &..., bool)> >::value > * = nullptr>
unsigned int tgui::SignalAnimation::connect ( const Func &  func,
const BoundArgs &...  args 
)
inline

Connects a signal handler that will be called when this signal is emitted.

Parameters
funcCallback function that has an unbound bool (showing widget or not) as last parameter
argsAdditional arguments to pass to the function
Returns
Unique id of the connection

◆ connect() [4/4]

template<typename Func , typename... BoundArgs, typename std::enable_if_t< std::is_convertible< Func, std::function< void(const BoundArgs &..., ShowAnimationType, bool)> >::value > * = nullptr>
unsigned int tgui::SignalAnimation::connect ( const Func &  func,
const BoundArgs &...  args 
)
inline

Connects a signal handler that will be called when this signal is emitted.

Parameters
funcCallback function that has an ShowAnimationType and bool (showing widget or not) as two last parameters
argsAdditional arguments to pass to the function
Returns
Unique id of the connection

◆ emit()

bool tgui::SignalAnimation::emit ( const Widget widget,
ShowAnimationType  type,
bool  visible 
)

Call all connected signal handlers.

Parameters
widgetWidget that is triggering the signal
typeType of the animation
visibleTrue when the widget became visible, false if the widget is now hidden
Returns
True when a callback function was executed, false when there weren't any connected callback functions

◆ operator()()

template<typename Func , typename... BoundArgs>
unsigned int tgui::SignalAnimation::operator() ( const Func &  func,
const BoundArgs &...  args 
)
inline

Connects a signal handler that will be called when this signal is emitted.

Parameters
funcCallback function that can be passed to the connect function
argsAdditional arguments to pass to the function
Returns
Unique id of the connection

The documentation for this class was generated from the following file: