#include <WSignal>
Public Member Functions | |
virtual bool | isConnected () const |
Is this signal connected to at least one slot ? | |
template<class T, class V> | |
boost::signals::connection | connect (T *target, void(V::*method)()) |
Connect a slot that takes no arguments. | |
template<class T, class V> | |
boost::signals::connection | connect (T *target, void(V::*method)(E)) |
Connect a slot that takes one argument. | |
void | connect (JSlot &slot) |
Connect a slot that is specified as JavaScript only. | |
void | emit (E e) |
Emit the signal. | |
void | operator() (E e) |
Emit the signal. |
An EventSignal is a special kind of Signal that is triggered by user interface events such as a mouse click, key press, or focus change. They are tightly integrated with the library (e.g. within WInteractWidget), and should not be instantiated directly.
In addition to the behaviour of Signal, they are capable of both executing client-side and server-side slot code. They may learn JavaScript from C++ code, through stateless slot learning, when connected to a slot that has a stateless implementation, using WObject::implementStateless(). Or they may be connected to a JSlot which provides manual JavaScript code.
In addition, they relay UI event details, such as WKeyEvent or WMouseEvent details.
boost::signals::connection Wt::EventSignal< E >::connect | ( | T * | target, | |
void(V::*)() | method | |||
) | [inline] |
Connect a slot that takes no arguments.
If a stateless implementation is specified for the slot, then the visual behaviour will be learned in terms of JavaScript, and will be cached on the client side for instant feed-back, in addition running the slot on the server.
The slot is specified as a method of class V, which is equal to class V, or a base class of class V. In addition, to check for stateless implementations, class T must be also be a descendant of WObject. Thus, the following statement must return a non-null pointer:
WObject *o = dynamic_cast<WObject *>(dynamic_cast<V *>(target));
boost::signals::connection Wt::EventSignal< E >::connect | ( | T * | target, | |
void(V::*)(E) | method | |||
) | [inline] |
Connect a slot that takes one argument.
This is only possible for signals that take at least one argument.
void Wt::EventSignal< E >::connect | ( | JSlot & | slot | ) | [inline] |
Connect a slot that is specified as JavaScript only.
This will provide a client-side connection between the event and some JavaScript code as implemented by the slot. Unlike other connects, this does not cause the event to propagated to the application, and thus the state may not be tracked.
void Wt::EventSignal< E >::emit | ( | E | e | ) | [inline] |
Emit the signal.
This will cause all connected slots to be triggered, with the given argument.
void Wt::EventSignal< E >::operator() | ( | E | e | ) | [inline] |