Pyro higlevel API
|
Public Member Functions | |
Invoker () | |
Default constructor. More... | |
Invoker (Message *pcMessage) | |
Constructor. More... | |
Invoker (Message *pcMessage, const Handler *pcHandler, const Looper *pcLooper=NULL) | |
Constructor. More... | |
Invoker (Message *pcMessage, const Messenger &cTarget) | |
Constructor. More... | |
virtual | ~Invoker () |
Destructor. More... | |
virtual status_t | SetMessage (Message *pcMessage) |
Assign a new message to the invoker. More... | |
Message * | GetMessage () const |
Get the message currently assigned to the invoker. More... | |
uint32 | GetCode () const |
Get the code field from the currently assigned message. More... | |
virtual bool | Invoked (Message *pcMessage) |
Intercept outgoing messages. More... | |
virtual void | TargetChanged (const Messenger &cOldTarget) |
Virtual hook called by the system after the target has been changed. More... | |
virtual void | MessageChanged (const Message &cOldMsg) |
Virtual hook called by the system after the message has been changed. More... | |
virtual status_t | SetTarget (const Handler *pcHandler, const Looper *pcLooper=NULL) |
Set a new message target. More... | |
virtual status_t | SetTarget (const Messenger &cMessenger) |
Set a new message target. More... | |
bool | IsTargetLocal () const |
Check if the target lives in our process. More... | |
Handler * | GetTarget (Looper **ppcLooper=NULL) const |
Get the current target. More... | |
Messenger | GetMessenger () const |
Get the messenger used to target messages sendt by the invoker. More... | |
virtual status_t | SetHandlerForReply (Handler *pcHandler) |
Set a reply target for messages sendt by this messenger. More... | |
Handler * | GetHandlerForReply () const |
Get the current reply target for replies on messages sendt by the invoker. More... | |
virtual status_t | Invoke (Message *pcMessage=NULL) |
Send the current message to the current target. More... | |
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 |
|
virtual |
uint32 Invoker::GetCode | ( | void | ) | const |
References os::Message::GetCode().
Handler * Invoker::GetHandlerForReply | ( | ) | const |
Message * Invoker::GetMessage | ( | ) | const |
Referenced by os::TabView::DeleteTab(), os::Menu::FindItem(), os::IconView::GetInvokeMsg(), os::Alert::HandleMessage(), and os::TabView::SetSelection().
Messenger Invoker::GetMessenger | ( | void | ) | const |
Referenced by os::Control::AttachedToWindow().
ppcLooper | If non-NULL a pointer to the looper owning the target will be written here. |
References os::Messenger::GetTarget().
|
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. 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. |
References os::Message::AddPointer(), Invoked(), and os::Messenger::SendMessage().
Referenced by os::TreeView::Collapse(), os::TextEdit::CommitEvents(), os::TabView::DeleteTab(), os::IconDirectoryView::DirChanged(), os::TreeView::Expand(), os::DropdownMenu::HandleMessage(), os::Alert::HandleMessage(), os::IconView::Invoked(), os::ListView::Invoked(), os::Menu::KeyDown(), os::ScrollBar::MouseUp(), os::Slider::MouseUp(), os::Menu::MouseUp(), os::IconView::SelectionChanged(), os::ListView::SelectionChanged(), os::DropdownMenu::SetSelection(), os::TabView::SetSelection(), os::Control::SetValue(), and os::TextView::SetValue().
|
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::ListView, os::Slider, os::TextView, os::Button, os::Spinner, os::MenuItem, os::Control, os::ScrollBar, os::RadioButton, os::CheckBox, and os::CheckMenu.
Referenced by Invoke().
bool Invoker::IsTargetLocal | ( | ) | const |
References os::Messenger::IsTargetLocal().
|
virtual |
cOldMsg
argument. cOldMsg | The previous message assigned to this invoker. |
Referenced by SetMessage().
|
virtual |
pcHandler | The handler that should receive replies on messages sendt by the invoker or NULL to disable replies. |
|
virtual |
If the message is set to NULL the invoker will be disabled until a new message is assigned.
pcMsg | Pointer to the new message to be sendt when invoked. The invoker takes ownership over the message. |
References MessageChanged().
Referenced by os::DropdownMenu::DropdownMenu(), os::IconView::SetInvokeMsg(), and os::Spinner::Spinner().
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. |
References os::Messenger::IsValid(), and TargetChanged().
Referenced by os::Spinner::AllAttached(), os::DropdownMenu::AllAttached(), os::TabView::AllAttached(), os::ListView::AllAttached(), os::Control::AttachedToWindow(), os::FileRequester::FileRequester(), and os::Menu::SetTargetForItems().
|
virtual |
cMessenger | The messenger that should be used to target messages from this invoker. |
References os::Messenger::IsValid(), and TargetChanged().
|
virtual |
cOldTarget
argument. cOldTarget | The previous target for this invoker. |
Referenced by SetTarget().