/* PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved. Your reuse is governed by the Creative Commons Attribution 3.0 United States License */ package org.puremvc.as3.interfaces { /** * 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.IObserver
to be notified
* of INotifications
with a given name.
*
* @param notificationName the name of the INotifications
to notify this IObserver
of
* @param observer the IObserver
to register
*/
function registerObserver( notificationName:String, observer:IObserver ) : void;
/**
* Remove a group of observers from the observer list for a given Notification name.
*
* @param notificationName which observer list to remove from
* @param notifyContext removed the observers with this object as their notifyContext
*/
function removeObserver( notificationName:String, notifyContext:Object ):void;
/**
* 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.
INotification
to notify IObservers
of.
*/
function notifyObservers( note:INotification ) : void;
/**
* 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.
IMediator
instance
* @param mediator a reference to the IMediator
instance
*/
function registerMediator( mediator:IMediator ) : void;
/**
* Retrieve an IMediator
from the View
.
*
* @param mediatorName the name of the IMediator
instance to retrieve.
* @return the IMediator
instance previously registered with the given mediatorName
.
*/
function retrieveMediator( mediatorName:String ) : IMediator;
/**
* Remove an IMediator
from the View
.
*
* @param mediatorName name of the IMediator
instance to be removed.
* @return the IMediator
that was removed from the View
*/
function removeMediator( mediatorName:String ) : IMediator;
/**
* Check if a Mediator is registered or not
*
* @param mediatorName
* @return whether a Mediator is registered with the given mediatorName
.
*/
function hasMediator( mediatorName:String ) : Boolean;
}
}