3 * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
4 * @license http://ez.no/licenses/new_bsd New BSD License
11 * A container to store a Content-Disposition header as described in http://www.faqs.org/rfcs/rfc2183.
13 * This container is used on the contentDisposition property on mail parts.
14 * Use it for reading and setting the Content-Disposition header.
19 class ezcMailContentDispositionHeader
extends ezcBaseStruct
22 * The disposition type, either "inline" or "attachment".
29 * The filename of the attachment.
31 * The filename should never include path information.
38 * The filename of the attachment, formatted for display. Used only for
39 * parsing, not used when generating a mail.
41 * The filename should never include path information.
43 * Added for issue #13038. If you use __set_state() be sure to set this
48 public $displayFileName;
51 * The language of the filename.
55 public $fileNameLanguage;
58 * The characterset of the file name.
62 public $fileNameCharSet;
65 * The creation date of the file attachment.
67 * The time should be formatted as specified by http://www.faqs.org/rfcs/rfc822.html
70 * A typical example is: Sun, 21 May 2006 16:00:50 +0400
77 * The last modification date of the file attachment.
79 * The time should be formatted as specified by http://www.faqs.org/rfcs/rfc822.html
82 * A typical example is: Sun, 21 May 2006 16:00:50 +0400
86 public $modificationDate;
89 * The last date the file attachment was read.
91 * The time should be formatted as specified by http://www.faqs.org/rfcs/rfc822.html
94 * A typical example is: Sun, 21 May 2006 16:00:50 +0400
101 * The size of the content in bytes.
108 * Any additional parameters provided in the Content-Disposition header.
110 * The format of the field is array(parameterName=>parameterValue)
112 * @var array(string=>string)
114 public $additionalParameters = array();
117 * Holds language and characterset data for the additional parameters.
119 * Format: array(parameterName=>array('charSet'=>string,'language'=>string))
121 * @apichange Merge this with $additionalParamters OR come up with an entirely new idea for the ContentDispositionHeader
122 * @var array(string=>array())
124 public $additionalParametersMetaData = array();
127 * Constructs a new ezcMailContentDispositionHeader holding the various values of this
130 * @param string $disposition
131 * @param string $fileName
132 * @param string $creationDate
133 * @param string $modificationDate
134 * @param string $readDate
135 * @param string $size
136 * @param array(string=>string) $additionalParameters
137 * @param string $fileNameLanguage
138 * @param string $fileNameCharSet
140 public function __construct( $disposition = 'inline',
142 $creationDate = null,
143 $modificationDate = null,
146 $additionalParameters = array(),
147 $fileNameLanguage = null,
148 $fileNameCharSet = null,
149 $displayFileName = null )
151 $this->disposition
= $disposition;
152 $this->fileName
= $fileName;
153 $this->fileNameLanguage
= $fileNameLanguage;
154 $this->fileNameCharSet
= $fileNameCharSet;
155 $this->displayFileName
= $displayFileName;
156 $this->creationDate
= $creationDate;
157 $this->modificationDate
= $modificationDate;
158 $this->readDate
= $readDate;
160 $this->additionalParameters
= $additionalParameters;
164 * Returns a new instance of this class with the data specified by $array.
166 * $array contains all the data members of this class in the form:
167 * array('member_name'=>value).
169 * __set_state makes this class exportable with var_export.
170 * var_export() generates code, that calls this method when it
171 * is parsed with PHP.
173 * @param array(string=>mixed) $array
174 * @return ezcMailAddress
176 static public function __set_state( array $array )
178 return new ezcMailContentDispositionHeader( $array['disposition'],
180 $array['creationDate'],
181 $array['modificationDate'],
184 $array['additionalParameters'],
185 $array['fileNameLanguage'],
186 $array['fileNameCharSet'],
187 $array['displayFileName']