TYPO3 API  SVNRelease
EventDispatcher.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  * This file is part of SwiftMailer.
00005  * (c) 2004-2009 Chris Corbyn
00006  *
00007  * For the full copyright and license information, please view the LICENSE
00008  * file that was distributed with this source code.
00009  */
00010 
00011 //@require 'Swift/Events/EventListener.php';
00012 //@require 'Swift/Event.php';
00013 
00014 /**
00015  * Interface for the EventDispatcher which handles the event dispatching layer.
00016  * @package Swift
00017  * @subpackage Events
00018  * @author Chris Corbyn
00019  */
00020 interface Swift_Events_EventDispatcher
00021 {
00022 
00023   /**
00024    * Create a new SendEvent for $source and $message.
00025    * @param Swift_Transport $source
00026    * @param Swift_Mime_Message
00027    * @return Swift_Events_SendEvent
00028    */
00029   public function createSendEvent(Swift_Transport $source,
00030     Swift_Mime_Message $message);
00031 
00032   /**
00033    * Create a new CommandEvent for $source and $command.
00034    * @param Swift_Transport $source
00035    * @param string $command That will be executed
00036    * @param array $successCodes That are needed
00037    * @return Swift_Events_CommandEvent
00038    */
00039   public function createCommandEvent(Swift_Transport $source,
00040     $command, $successCodes = array());
00041 
00042   /**
00043    * Create a new ResponseEvent for $source and $response.
00044    * @param Swift_Transport $source
00045    * @param string $response
00046    * @param boolean $valid If the response is valid
00047    * @return Swift_Events_ResponseEvent
00048    */
00049   public function createResponseEvent(Swift_Transport $source,
00050     $response, $valid);
00051 
00052   /**
00053    * Create a new TransportChangeEvent for $source.
00054    * @param Swift_Transport $source
00055    * @return Swift_Events_TransportChangeEvent
00056    */
00057   public function createTransportChangeEvent(Swift_Transport $source);
00058 
00059   /**
00060    * Create a new TransportExceptionEvent for $source.
00061    * @param Swift_Transport $source
00062    * @param Swift_TransportException $ex
00063    * @return Swift_Events_TransportExceptionEvent
00064    */
00065   public function createTransportExceptionEvent(Swift_Transport $source,
00066     Swift_TransportException $ex);
00067 
00068   /**
00069    * Bind an event listener to this dispatcher.
00070    * @param Swift_Events_EventListener $listener
00071    */
00072   public function bindEventListener(Swift_Events_EventListener $listener);
00073 
00074   /**
00075    * Dispatch the given Event to all suitable listeners.
00076    * @param Swift_Events_EventObject $evt
00077    * @param string $target method
00078    */
00079   public function dispatchEvent(Swift_Events_EventObject $evt, $target);
00080 
00081 }