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/Mime/CharsetObserver.php';
14 * A collection of MIME headers.
19 * @author Chris Corbyn
21 interface Swift_Mime_HeaderSet
extends Swift_Mime_CharsetObserver
25 * Add a new Mailbox Header with a list of $addresses.
28 * @param array|string $addresses
30 public function addMailboxHeader($name, $addresses = null);
33 * Add a new Date header using $timestamp (UNIX time).
36 * @param int $timestamp
38 public function addDateHeader($name, $timestamp = null);
41 * Add a new basic text header with $name and $value.
44 * @param string $value
46 public function addTextHeader($name, $value = null);
49 * Add a new ParameterizedHeader with $name, $value and $params.
52 * @param string $value
53 * @param array $params
55 public function addParameterizedHeader($name, $value = null,
59 * Add a new ID header for Message-ID or Content-ID.
62 * @param string|array $ids
64 public function addIdHeader($name, $ids = null);
67 * Add a new Path header with an address (path) in it.
72 public function addPathHeader($name, $path = null);
75 * Returns true if at least one header with the given $name exists.
77 * If multiple headers match, the actual one may be specified by $index.
84 public function has($name, $index = 0);
87 * Set a header in the HeaderSet.
89 * The header may be a previously fetched header via {@link get()} or it may
90 * be one that has been created separately.
92 * If $index is specified, the header will be inserted into the set at this
95 * @param Swift_Mime_Header $header
98 public function set(Swift_Mime_Header
$header, $index = 0);
101 * Get the header with the given $name.
102 * If multiple headers match, the actual one may be specified by $index.
103 * Returns NULL if none present.
105 * @param string $name
108 * @return Swift_Mime_Header
110 public function get($name, $index = 0);
113 * Get all headers with the given $name.
115 * @param string $name
119 public function getAll($name = null);
122 * Remove the header with the given $name if it's set.
124 * If multiple headers match, the actual one may be specified by $index.
126 * @param string $name
129 public function remove($name, $index = 0);
132 * Remove all headers with the given $name.
134 * @param string $name
136 public function removeAll($name);
139 * Create a new instance of this HeaderSet.
141 * @return Swift_Mime_HeaderSet
143 public function newInstance();
146 * Define a list of Header names as an array in the correct order.
148 * These Headers will be output in the given order where present.
150 * @param array $sequence
152 public function defineOrdering(array $sequence);
155 * Set a list of header names which must always be displayed when set.
157 * Usually headers without a field value won't be output unless set here.
159 * @param array $names
161 public function setAlwaysDisplayed(array $names);
164 * Returns a string with a representation of all headers.
168 public function toString();