#import "INotification.h" #import "IMediator.h" #import "IProxy.h" /** * The interface definition for a PureMVC Facade. * *
* The Facade Pattern suggests providing a single * class to act as a central point of communication * for a subsystem.
* ** In PureMVC, the Facade acts as an interface between * the core MVC actors (Model, View, Controller) and * the rest of your application.
* * @see IModel, IView, IController, ICommand, INotification */ @protocol IFacade /** * Check if a Command is registered for a given Notification * * @param notificationName * @return whether a Command is currently registered for the givennotificationName
.
*/
-(BOOL)hasCommand:(NSString *)notificationName;
/**
* Check if a Mediator is registered or not
*
* @param mediatorName
* @return whether a Mediator is registered with the given mediatorName
.
*/
-(BOOL)hasMediator:(NSString *)mediatorName;
/**
* Check if a Proxy is registered
*
* @param proxyName
* @return whether a Proxy is currently registered with the given proxyName
.
*/
-(BOOL)hasProxy:(NSString *)proxyName;
/**
* 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.
* NOTE: Use this method only if you are sending custom Notifications. Otherwise * use the sendNotification method which does not require you to create the * Notification instance.
* * @param notification theINotification
to notify IObservers
of.
*/
-(void)notifyObservers:(idICommand
with the Controller
.
*
* @param notificationName the name of the INotification
to associate the ICommand
with.
* @param commandClassRef a reference to the Class
of the ICommand
.
*/
-(void)registerCommand:(NSString *)notificationName commandClassRef:(Class)commandClassRef;
/**
* Register an IMediator
instance with the View
.
*
* @param mediator a reference to the IMediator
instance
*/
-(void)registerMediator:(idIProxy
instance with the Model
.
*
* @param proxy the IProxy
to be registered with the Model
.
*/
-(void)registerProxy:(idICommand
to INotification
mapping from the Controller.
*
* @param notificationName the name of the INotification
to remove the ICommand
mapping for
*/
-(void)removeCommand:(NSString *)notificationName;
/**
* Remove a IMediator
instance from the View
.
*
* @param mediatorName name of the IMediator
instance to be removed.
* @return the IMediator
instance previously registered with the given mediatorName
.
*/
-(idIProxy
instance from the Model
by name.
*
* @param proxyName the IProxy
to remove from the Model
.
* @return the IProxy
that was removed from the Model
*/
-(idIMediator
instance from the View
.
*
* @param mediatorName the name of the IMediator
instance to retrievve
* @return the IMediator
previously registered with the given mediatorName
.
*/
-(idIProxy
from the Model
by name.
*
* @param proxyName the name of the IProxy
instance to be retrieved.
* @return the IProxy
previously regisetered by proxyName
with the Model
.
*/
-(idINotification
.
*
* @param notificationName the name of the notiification to send
* @param body the body of the notification
* @param type the type of the notification
*/
-(void)sendNotification:(NSString *)notificationName body:(id)body type:(NSString *)type;
-(void)sendNotification:(NSString *)notificationName;
-(void)sendNotification:(NSString *)notificationName body:(id)body;
-(void)sendNotification:(NSString *)notificationName type:(NSString *)type;
@end