aboutsummaryrefslogtreecommitdiff
path: root/External/swiftmailer/lib/classes/Swift/Mime/HeaderSet.php
blob: 81e7a979b67d8406564cae76b7cba484ae208a56 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?php

/*
 * This file is part of SwiftMailer.
 * (c) 2004-2009 Chris Corbyn
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

//@require 'Swift/Mime/CharsetObserver.php';

/**
 * A collection of MIME headers.
 * 
 * @package Swift
 * @subpackage Mime
 * 
 * @author Chris Corbyn
 */
interface Swift_Mime_HeaderSet extends Swift_Mime_CharsetObserver
{
  
  /**
   * Add a new Mailbox Header with a list of $addresses.
   * 
   * @param string $name
   * @param array|string $addresses
   */
  public function addMailboxHeader($name, $addresses = null);
  
  /**
   * Add a new Date header using $timestamp (UNIX time).
   * 
   * @param string $name
   * @param int $timestamp
   */
  public function addDateHeader($name, $timestamp = null);
  
  /**
   * Add a new basic text header with $name and $value.
   * 
   * @param string $name
   * @param string $value
   */
  public function addTextHeader($name, $value = null);
  
  /**
   * Add a new ParameterizedHeader with $name, $value and $params.
   * 
   * @param string $name
   * @param string $value
   * @param array $params
   */
  public function addParameterizedHeader($name, $value = null,
    $params = array());
  
  /**
   * Add a new ID header for Message-ID or Content-ID.
   * 
   * @param string $name
   * @param string|array $ids
   */
  public function addIdHeader($name, $ids = null);
  
  /**
   * Add a new Path header with an address (path) in it.
   * 
   * @param string $name
   * @param string $path
   */
  public function addPathHeader($name, $path = null);
  
  /**
   * Returns true if at least one header with the given $name exists.
   * 
   * If multiple headers match, the actual one may be specified by $index.
   * 
   * @param string $name
   * @param int $index
   * 
   * @return boolean
   */
  public function has($name, $index = 0);
  
  /**
   * Set a header in the HeaderSet.
   * 
   * The header may be a previously fetched header via {@link get()} or it may
   * be one that has been created separately.
   * 
   * If $index is specified, the header will be inserted into the set at this
   * offset.
   * 
   * @param Swift_Mime_Header $header
   * @param int $index
   */
  public function set(Swift_Mime_Header $header, $index = 0);
  
  /**
   * Get the header with the given $name.
   * If multiple headers match, the actual one may be specified by $index.
   * Returns NULL if none present.
   * 
   * @param string $name
   * @param int $index
   * 
   * @return Swift_Mime_Header
   */
  public function get($name, $index = 0);
  
  /**
   * Get all headers with the given $name.
   * 
   * @param string $name
   * 
   * @return array
   */
  public function getAll($name = null);
  
  /**
   * Remove the header with the given $name if it's set.
   * 
   * If multiple headers match, the actual one may be specified by $index.
   * 
   * @param string $name
   * @param int $index
   */
  public function remove($name, $index = 0);
  
  /**
   * Remove all headers with the given $name.
   * 
   * @param string $name
   */
  public function removeAll($name);
  
  /**
   * Create a new instance of this HeaderSet.
   * 
   * @return Swift_Mime_HeaderSet
   */
  public function newInstance();
  
  /**
   * Define a list of Header names as an array in the correct order.
   * 
   * These Headers will be output in the given order where present.
   * 
   * @param array $sequence
   */
  public function defineOrdering(array $sequence);
  
  /**
   * Set a list of header names which must always be displayed when set.
   * 
   * Usually headers without a field value won't be output unless set here.
   * 
   * @param array $names
   */
  public function setAlwaysDisplayed(array $names);
  
  /**
   * Returns a string with a representation of all headers.
   * 
   * @return string
   */
  public function toString();
  
}