Avail feature updated
[ninja.git] / application / vendor / swiftmailer / classes / Swift / Mime / MimeEntity.php
blob2b08009d991fd620547156aa830e2d0a6437bd67
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/InputByteStream.php';
12 //@require 'Swift/Mime/EncodingObserver.php';
13 //@require 'Swift/Mime/CharsetObserver.php';
15 /**
16 * A MIME entity, such as an attachment.
17 * @package Swift
18 * @subpackage Mime
19 * @author Chris Corbyn
21 interface Swift_Mime_MimeEntity
22 extends Swift_Mime_CharsetObserver, Swift_Mime_EncodingObserver
25 /** Main message document; there can only be one of these */
26 const LEVEL_TOP = 16;
28 /** An entity which nests with the same precedence as an attachment */
29 const LEVEL_MIXED = 256;
31 /** An entity which nests with the same precedence as a mime part */
32 const LEVEL_ALTERNATIVE = 4096;
34 /** An entity which nests with the same precedence as embedded content */
35 const LEVEL_RELATED = 65536;
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
43 public function getNestingLevel();
45 /**
46 * Get the qualified content-type of this mime entity.
47 * @return string
49 public function getContentType();
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
60 public function getId();
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[]
67 public function getChildren();
69 /**
70 * Set all children nested inside this entity.
71 * This includes grandchildren.
72 * @param Swift_Mime_MimeEntity[] $children
74 public function setChildren(array $children);
76 /**
77 * Get the collection of Headers in this Mime entity.
78 * @return Swift_Mime_Header[]
80 public function getHeaders();
82 /**
83 * Get the body content of this entity as a string.
84 * Returns NULL if no body has been set.
85 * @return string
87 public function getBody();
89 /**
90 * Set the body content of this entity as a string.
91 * @param string $body
92 * @param string $contentType optional
94 public function setBody($body, $contentType = null);
96 /**
97 * Get this entire entity in its string form.
98 * @return string
100 public function toString();
103 * Get this entire entity as a ByteStream.
104 * @param Swift_InputByteStream $is to write to
106 public function toByteStream(Swift_InputByteStream $is);