The interface definition for a PureMVC View. More...
#include <pmvcpp.h>
Public Member Functions | |
virtual void | registerObserver (int notificationName, IObserverRestricted *observer)=0 |
Register an IObserver to be notified of INotifications with a given name. | |
virtual void | removeObserver (int notificationName, intptr_t contextAddress)=0 |
Remove an observer from the observer list for a given Notification name that has a context object stored at contextAddress . | |
virtual void | notifyObservers (INotification *note)=0 |
Notify the IObservers for a particular INotification . | |
virtual void | registerMediator (IMediator *mediator)=0 |
Register an IMediator instance with the View . | |
virtual IMediator * | retrieveMediator (std::string mediatorName)=0 |
Retrieve an IMediator from the View . | |
virtual IMediator * | removeMediator (std::string mediatorName)=0 |
Remove an IMediator from the View . | |
virtual bool | hasMediator (std::string mediatorName)=0 |
Check if a Mediator is registered or not. | |
virtual void | setMultitonKey (std::string key)=0 |
Set multiton key. | |
virtual std::string | getMultitonKey ()=0 |
Get multiton key. |
The interface definition for a PureMVC View.
In PureMVC, IView
implementors assume these responsibilities:
In PureMVC, the View
class assumes these responsibilities:
IMediator
instances. IMediators
. INotification
in the application. IObservers
to an INotification
's observer list. INotification
. IObservers
of a given INotification
when it broadcast. virtual std::string PureMVC::IMultitonKeyHeir::getMultitonKey | ( | ) | [pure virtual, inherited] |
Get multiton key.
Returns the multiton key.
Implemented in PureMVC::MultitonKeyHeir.
virtual bool PureMVC::IView::hasMediator | ( | std::string | mediatorName | ) | [pure virtual] |
Check if a Mediator is registered or not.
mediatorName |
mediatorName
. Implemented in PureMVC::View.
virtual void PureMVC::IView::notifyObservers | ( | INotification * | note | ) | [pure virtual] |
Notify the IObservers
for a particular INotification
.
All previously attached IObservers
for this INotification
's list are notified and are passed a reference to the INotification
in the order in which they were registered.
notification | the INotification to notify IObservers of. |
Implemented in PureMVC::View.
virtual void PureMVC::IView::registerMediator | ( | IMediator * | mediator | ) | [pure virtual] |
Register an IMediator
instance with the View
.
Registers the IMediator
so that it can be retrieved by name, and further interrogates the IMediator
for its INotification
interests.
If the IMediator
returns any INotification
names to be notified about, an Observer
is created encapsulating the IMediator
instance's handleNotification
method and registering it as an Observer
for all INotifications
the IMediator
is interested in.
mediatorName | the name to associate with this IMediator instance | |
mediator | a reference to the IMediator instance |
Implemented in PureMVC::View.
virtual void PureMVC::IView::registerObserver | ( | int | notificationName, | |
IObserverRestricted * | observer | |||
) | [pure virtual] |
Register an IObserver
to be notified of INotifications
with a given name.
notificationName | the name of the INotifications to notify this IObserver of | |
observer | the IObserver to register |
Implemented in PureMVC::View.
virtual IMediator* PureMVC::IView::removeMediator | ( | std::string | mediatorName | ) | [pure virtual] |
virtual void PureMVC::IView::removeObserver | ( | int | notificationName, | |
intptr_t | contextAddress | |||
) | [pure virtual] |
Remove an observer from the observer list for a given Notification name that has a context object stored at contextAddress
.
notificationName | which observer list to remove from | |
contextAddress | remove the observer with this address as the address of their notifyContext |
Implemented in PureMVC::View.
virtual IMediator* PureMVC::IView::retrieveMediator | ( | std::string | mediatorName | ) | [pure virtual] |
Retrieve an IMediator
from the View
.
mediatorName | the name of the IMediator instance to retrieve. |
IMediator
instance previously registered with the given mediatorName
. Implemented in PureMVC::View.
virtual void PureMVC::IMultitonKeyHeir::setMultitonKey | ( | std::string | key | ) | [pure virtual, inherited] |
Set multiton key.
Sets the multiton key.
key | The name of the key |
Implemented in PureMVC::MultitonKeyHeir.