Inheritance diagram for os::Invoker:
Public Member Functions | |
Invoker () | |
Default constructor. | |
Invoker (Message *pcMessage) | |
Constructor. | |
Invoker (Message *pcMessage, const Handler *pcHandler, const Looper *pcLooper=NULL) | |
Constructor. | |
Invoker (Message *pcMessage, const Messenger &cTarget) | |
Constructor. | |
virtual | ~Invoker () |
Destructor. | |
virtual status_t | SetMessage (Message *pcMessage) |
Assign a new message to the invoker. | |
Message * | GetMessage () const |
Get the message currently assigned to the invoker. | |
uint32 | GetCode () const |
Get the code field from the currently assigned message. | |
virtual bool | Invoked (Message *pcMessage) |
Intercept outgoing messages. | |
virtual void | TargetChanged (const Messenger &cOldTarget) |
Virtual hook called by the system after the target has been changed. | |
virtual void | MessageChanged (const Message &cOldMsg) |
Virtual hook called by the system after the message has been changed. | |
virtual status_t | SetTarget (const Handler *pcHandler, const Looper *pcLooper=NULL) |
Set a new message target. | |
virtual status_t | SetTarget (const Messenger &cMessenger) |
Set a new message target. | |
bool | IsTargetLocal () const |
Check if the target lives in our process. | |
Handler * | GetTarget (Looper **ppcLooper=NULL) const |
Get the current target. | |
Messenger | GetMessenger () const |
Get the messenger used to target messages sendt by the invoker. | |
virtual status_t | SetHandlerForReply (Handler *pcHandler) |
Set a reply target for messages sendt by this messenger. | |
Handler * | GetHandlerForReply () const |
Get the current reply target for replies on messages sendt by the invoker. | |
virtual status_t | Invoke (Message *pcMessage=NULL) |
Send the current message to the current target. |
Invoker::Invoker | ( | ) |
Invoker::Invoker | ( | Message * | pcMsg | ) |
pcMsg | The message to be sendt when invoked. The invoker takes ownership over the message. |
pcMsg
will be sendt to the target specified by pcHandler
and/or pcLooper
. pcMsg | The message to be sendt when invoked. The invoker takes ownership over the message. | |
pcHandler | The handler that should receive messages sendt by this invoker or NULL if a looper is to be destined. | |
pcLooper | If pcHandler is NULL messages will be sendt to this looper without a specific target. |
pcMsg
will be sendt to the target specified by cTarget
pcMsg | The message to be sendt when invoked. The invoker takes ownership over the message. | |
cTarget | A messenger specifying this invokers target |
Invoker::~Invoker | ( | ) | [virtual] |
status_t Invoker::SetMessage | ( | Message * | pcMsg | ) | [virtual] |
pcMsg | Pointer to the new message to be sendt when invoked. The invoker takes ownership over the message. |
Message * Invoker::GetMessage | ( | ) | const |
uint32 Invoker::GetCode | ( | void | ) | const |
bool Invoker::Invoked | ( | Message * | pcMessage | ) | [virtual] |
pcMessage | Pointer to the message that is about to be sendt. You can do any modification you like to this message (but never delete it). |
Reimplemented in os::Button, os::CheckBox, os::CheckMenu, os::Control, os::ListView, os::MenuItem, os::RadioButton, os::ScrollBar, os::Slider, os::Spinner, and os::TextView.
void Invoker::TargetChanged | ( | const Messenger & | cOldTarget | ) | [virtual] |
cOldTarget
argument. cOldTarget | The previous target for this invoker. |
void Invoker::MessageChanged | ( | const Message & | cOldMsg | ) | [virtual] |
cOldMsg
argument. cOldMsg | The previous message assigned to this invoker. |
pcHandler
and pcLooper
parameters is passed directly to the internal os::Messenger used to send messages from this invoker. Look at the os::Messenger documentation for a more detailed description on how to target messages. pcHandler | The handler that should receive messages sendt by this invoker or NULL if a looper is to be destined. | |
pcLooper | If pcHandler is NULL messages will be sendt to this looper without a specific target. |
status_t Invoker::SetTarget | ( | const Messenger & | cMessenger | ) | [virtual] |
cMessenger | The messenger that should be used to target messages from this invoker. |
bool Invoker::IsTargetLocal | ( | ) | const |
ppcLooper | If non-NULL a pointer to the looper owning the target will be written here. |
Messenger Invoker::GetMessenger | ( | void | ) | const |
status_t Invoker::SetHandlerForReply | ( | Handler * | pcHandler | ) | [virtual] |
pcHandler | The handler that should receive replies on messages sendt by the invoker or NULL to disable replies. |
Handler * Invoker::GetHandlerForReply | ( | ) | const |
status_t Invoker::Invoke | ( | Message * | pcMsg = NULL |
) | [virtual] |
pcMsg
parameter or the internal message) will be copyed and a pointer to the invoker is added under the name "source". Then the virtual member Invoked() is called to allow classes that overload os::Invoker to add date to the message or even cancel the operation before it is sendt to the current target. void* pSource = NULL; pcMsg->FindPointer( "source", &pSource ); os::Button* pcButton = dynamic_cast<os::Button*>(static_cast<os::Invoker*>(pSource));
pcMsg
is NULL, or if no valid target has been specifed no message will be sendt. pcMsg | An optional message to be sendt instead of the internal message. The message will be copyed and you retain ownership over it. If this parameter is NULL the internal message will be used. It is often better to overload Invoked() and do per-message modifications there than to supply "custom" messages. |