org-puremvc-php-multicore
[ class tree: org-puremvc-php-multicore ] [ index: org-puremvc-php-multicore ] [ all elements ]

Source for file IView.php

Documentation is available at IView.php

  1. <?php
  2. /**
  3.  * PureMVC Multicore Port to PHP
  4.  *
  5.  * Partly based on PureMVC Port to PHP by:
  6.  * - Omar Gonzalez <omar@almerblank.com>
  7.  * - and Hasan Otuome <hasan@almerblank.com>
  8.  *
  9.  * Created on Jully 24, 2009
  10.  *
  11.  * @version 1.0
  12.  * @author Michel Chouinard <michel.chouinard@gmail.com>
  13.  * @copyright PureMVC - Copyright(c) 2006-2008 Futurescale, Inc., Some rights reserved.
  14.  * @license http://creativecommons.org/licenses/by/3.0/ Creative Commons Attribution 3.0 Unported License
  15.  * @package org.puremvc.php.multicore
  16.  *
  17.  */
  18. /**
  19.  *
  20.  */
  21.  
  22. require_once 'org/puremvc/php/multicore/interfaces/INotifier.php';
  23. require_once 'org/puremvc/php/multicore/interfaces/INotification.php';
  24. require_once 'org/puremvc/php/multicore/interfaces/IMediator.php';
  25. require_once 'org/puremvc/php/multicore/interfaces/IObserver.php';
  26.  
  27. /**
  28.  * The interface definition for a PureMVC View.
  29.  *
  30.  * In PureMVC, <b>IView</b> implementors assume these responsibilities:
  31.  *
  32.  * In PureMVC, the <b>View</b> class assumes these responsibilities:
  33.  *
  34.  * - Maintain a cache of <b>IMediator</b> instances.
  35.  * - Provide methods for registering, retrieving, and removing <b>IMediators</b>.
  36.  * - Managing the observer lists for each <b>INotification</b> in the application.
  37.  * - Providing a method for attaching <b>IObservers</b> to an <b>INotification</b>'s observer list.
  38.  * - Providing a method for broadcasting an <b>INotification</b>.
  39.  * - Notifying the <b>IObservers</b> of a given <b>INotification</b> when it broadcast.
  40.  *
  41.  * @see IMediator
  42.         org\puremvc\php\multicore\interfaces\IMediator.php
  43.  * @see IObserver
  44.         org\puremvc\php\multicore\interfaces\IObserver.php
  45.  * @see INotification
  46.         org\puremvc\php\multicore\interfaces\INotification.php
  47.  * @package org.puremvc.php.multicore
  48.  *
  49.  */
  50. interface IView
  51. {
  52.  
  53.     /**
  54.      * Register Observer
  55.      *
  56.      * Register an <b>IObserver</b> to be notified
  57.      * of <b>INotifications</b> with a given name.
  58.      *
  59.      * @param string $notificationName The name of the <b>INotifications</b> to notify this <b>IObserver</b> of.
  60.      * @param IObserver $observer The <b>IObserver</b> to register.
  61.      * @return void 
  62.      */
  63.     public function registerObserver$notificationNameIObserver $observer );
  64.  
  65.     /**
  66.      * Remove Observer
  67.      *
  68.      * Remove a group of observers from the observer list for a given Notification name.
  69.      *
  70.      * @param string $notificationName Which observer list to remove from.
  71.      * @param mixed $notifyContext Remove the observers with this object as their notifyContext
  72.      * @return void 
  73.      */
  74.     public function removeObserver$notificationName$notifyContext );
  75.  
  76.     /**
  77.      * Notify Observers
  78.      *
  79.      * Notify the <b>IObservers</b> for a particular <b>INotification</b>.
  80.      *
  81.      * All previously attached <b>IObservers</b> for this <b>INotification</b>'s
  82.      * list are notified and are passed a reference to the <b>INotification</b> in
  83.      * the order in which they were registered.
  84.      *
  85.      * @param INotification $note The <b>INotification</b> to notify <b>IObservers</b> of.
  86.      * @return void 
  87.      */
  88.     public function notifyObserversINotification $notification );
  89.  
  90.     /**
  91.      * Register Mediator
  92.      *
  93.      * Register an <b>IMediator</b> instance with the <b>View</b>.
  94.      *
  95.      * Registers the <b>IMediator</b> so that it can be retrieved by name,
  96.      * and further interrogates the <b>IMediator</b> for its
  97.      * <b>INotification</b> interests.
  98.      *
  99.      * If the <b>IMediator</b> returns any <b>INotification</b>
  100.      * names to be notified about, an <b>Observer</b> is created encapsulating
  101.      * the <b>IMediator</b> instance's <b>handleNotification</b> method
  102.      * and registering it as an <b>Observer</b> for all <b>INotifications</b> the
  103.      * <b>IMediator</b> is interested in.
  104.      *
  105.      * @param IMediator $mediator Reference to the <b>IMediator</b> instance.
  106.      * @return void 
  107.      */
  108.     public function registerMediatorIMediator $mediator );
  109.  
  110.     /**
  111.      * Retreive Mediator
  112.      *
  113.      * Retrieve a previously  registered <b>IMediator</b> instance from the <b>View</b>.
  114.      *
  115.      * @param string $mediatorName Name of the <b>IMediator</b> instance to retrieve.
  116.      * @return IMediator The <b>IMediator</b> previously registered with the given <var>mediatorName</var>.
  117.      */
  118.     public function retrieveMediator$mediatorName );
  119.  
  120.     /**
  121.      * Remove Mediator
  122.      *
  123.      * Remove a previously registered <b>IMediator</b> instance from the <b>View</b>.
  124.      *
  125.      * @param string $mediatorName Name of the <b>IMediator</b> instance to be removed.
  126.      * @return IMediator The <b>IMediator</b> instance previously registered with the given <var>mediatorName</var>.
  127.      */
  128.     public function removeMediator$mediatorName );
  129.  
  130.     /**
  131.      * Has Mediator
  132.      *
  133.      * Check if a <b>IMediator</b> is registered or not.
  134.      *
  135.      * @param string $mediatorName The name of the <b>IMediator</b> to check for.
  136.      * @return bool Boolean: Whether a <b>IMediator</b> is registered with the given <var>mediatorName</var>.
  137.      */
  138.     public function hasMediator$mediatorName );
  139.  
  140. }

Documentation generated on Mon, 03 Aug 2009 04:57:57 +0000 by phpDocumentor 1.4.2