Merge branch 'maint/7.0'
[ninja.git] / application / vendor / swiftmailer / classes / Swift / Events / EventDispatcher.php
blobaaf12117e51cd4133dcd3a6180eeedbb6f77440b
1 <?php
3 /*
4 * This file is part of SwiftMailer.
5 * (c) 2004-2009 Chris Corbyn
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
11 //@require 'Swift/Events/EventListener.php';
12 //@require 'Swift/Event.php';
14 /**
15 * Interface for the EventDispatcher which handles the event dispatching layer.
16 * @package Swift
17 * @subpackage Events
18 * @author Chris Corbyn
20 interface Swift_Events_EventDispatcher
23 /**
24 * Create a new SendEvent for $source and $message.
25 * @param Swift_Transport $source
26 * @param Swift_Mime_Message
27 * @return Swift_Events_SendEvent
29 public function createSendEvent(Swift_Transport $source,
30 Swift_Mime_Message $message);
32 /**
33 * Create a new CommandEvent for $source and $command.
34 * @param Swift_Transport $source
35 * @param string $command That will be executed
36 * @param array $successCodes That are needed
37 * @return Swift_Events_CommandEvent
39 public function createCommandEvent(Swift_Transport $source,
40 $command, $successCodes = array());
42 /**
43 * Create a new ResponseEvent for $source and $response.
44 * @param Swift_Transport $source
45 * @param string $response
46 * @param boolean $valid If the response is valid
47 * @return Swift_Events_ResponseEvent
49 public function createResponseEvent(Swift_Transport $source,
50 $response, $valid);
52 /**
53 * Create a new TransportChangeEvent for $source.
54 * @param Swift_Transport $source
55 * @return Swift_Events_TransportChangeEvent
57 public function createTransportChangeEvent(Swift_Transport $source);
59 /**
60 * Create a new TransportExceptionEvent for $source.
61 * @param Swift_Transport $source
62 * @param Swift_TransportException $ex
63 * @return Swift_Events_TransportExceptionEvent
65 public function createTransportExceptionEvent(Swift_Transport $source,
66 Swift_TransportException $ex);
68 /**
69 * Bind an event listener to this dispatcher.
70 * @param Swift_Events_EventListener $listener
72 public function bindEventListener(Swift_Events_EventListener $listener);
74 /**
75 * Dispatch the given Event to all suitable listeners.
76 * @param Swift_Events_EventObject $evt
77 * @param string $target method
79 public function dispatchEvent(Swift_Events_EventObject $evt, $target);