#import "INotification.h" /** * The interface definition for a PureMVC Mediator. * *

* In PureMVC, IMediator implementors assume these responsibilities:

* *

* Additionally, IMediators typically: *

*

* When an IMediator is registered with the IView, * the IView will call the IMediator's * listNotificationInterests method. The IMediator will * return an Array of INotification names which * it wishes to be notified about.

* *

* The IView will then create an Observer object * encapsulating that IMediator's (handleNotification) method * and register it as an Observer for each INotification name returned by * listNotificationInterests.

* * @see INotification */ @protocol IMediator /** * Get the IMediator instance name * * @return the IMediator instance name */ -(NSString *)mediatorName; /** * Get the IMediator's view component. * * @return id the view component */ -(id)viewComponent; /** * Handle an INotification. * * @param notification the INotification to be handled */ -(void)handleNotification:(id)notification; /** * List INotification interests. * * @return an Array of the INotification names this IMediator has an interest in. */ -(NSArray *)listNotificationInterests; /** * Called by the View when the Mediator is registered */ -(void)onRegister; /** * Called by the View when the Mediator is removed */ -(void)onRemove; /** * Set the IMediator's view component. * * @param viewComponent the view component */ -(void)setViewComponent:(id)viewComponent; @end