Added feature #15998: Create a new API to send mails based on SwiftMailer to replace...
[Packages/TYPO3.CMS.git] / typo3 / contrib / swiftmailer / classes / Swift / Mime / MimeEntity.php
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 //@require 'Swift/InputByteStream.php';
12 //@require 'Swift/Mime/EncodingObserver.php';
13 //@require 'Swift/Mime/CharsetObserver.php';
14
15 /**
16 * A MIME entity, such as an attachment.
17 * @package Swift
18 * @subpackage Mime
19 * @author Chris Corbyn
20 */
21 interface Swift_Mime_MimeEntity
22 extends Swift_Mime_CharsetObserver, Swift_Mime_EncodingObserver
23 {
24
25 /** Main message document; there can only be one of these */
26 const LEVEL_TOP = 16;
27
28 /** An entity which nests with the same precedence as an attachment */
29 const LEVEL_MIXED = 256;
30
31 /** An entity which nests with the same precedence as a mime part */
32 const LEVEL_ALTERNATIVE = 4096;
33
34 /** An entity which nests with the same precedence as embedded content */
35 const LEVEL_RELATED = 65536;
36
37 /**
38 * Get the level at which this entity shall be nested in final document.
39 * The lower the value, the more outermost the entity will be nested.
40 * @return int
41 * @see LEVEL_TOP, LEVEL_MIXED, LEVEL_RELATED, LEVEL_ALTERNATIVE
42 */
43 public function getNestingLevel();
44
45 /**
46 * Get the qualified content-type of this mime entity.
47 * @return string
48 */
49 public function getContentType();
50
51 /**
52 * Returns a unique ID for this entity.
53 * For most entities this will likely be the Content-ID, though it has
54 * no explicit semantic meaning and can be considered an identifier for
55 * programming logic purposes.
56 * If a Content-ID header is present, this value SHOULD match the value of
57 * the header.
58 * @return string
59 */
60 public function getId();
61
62 /**
63 * Get all children nested inside this entity.
64 * These are not just the immediate children, but all children.
65 * @return Swift_Mime_MimeEntity[]
66 */
67 public function getChildren();
68
69 /**
70 * Set all children nested inside this entity.
71 * This includes grandchildren.
72 * @param Swift_Mime_MimeEntity[] $children
73 */
74 public function setChildren(array $children);
75
76 /**
77 * Get the collection of Headers in this Mime entity.
78 * @return Swift_Mime_Header[]
79 */
80 public function getHeaders();
81
82 /**
83 * Get the body content of this entity as a string.
84 * Returns NULL if no body has been set.
85 * @return string
86 */
87 public function getBody();
88
89 /**
90 * Set the body content of this entity as a string.
91 * @param string $body
92 * @param string $contentType optional
93 */
94 public function setBody($body, $contentType = null);
95
96 /**
97 * Get this entire entity in its string form.
98 * @return string
99 */
100 public function toString();
101
102 /**
103 * Get this entire entity as a ByteStream.
104 * @param Swift_InputByteStream $is to write to
105 */
106 public function toByteStream(Swift_InputByteStream $is);
107
108 }