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