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.
11
//@require 'Swift/Events/EventListener.php';
12
//@require 'Swift/Event.php';
15
* Interface for the EventDispatcher which handles the event dispatching layer.
18
* @author Chris Corbyn
20
interface Swift_Events_EventDispatcher
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);
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());
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,
53
* Create a new TransportChangeEvent for $source.
54
* @param Swift_Transport $source
55
* @return Swift_Events_TransportChangeEvent
57
public function createTransportChangeEvent(Swift_Transport $source);
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);
69
* Bind an event listener to this dispatcher.
70
* @param Swift_Events_EventListener $listener
72
public function bindEventListener(Swift_Events_EventListener $listener);
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);