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: /**
12: * A MIME Header.
13: * @package Swift
14: * @subpackage Mime
15: * @author Chris Corbyn
16: */
17: interface Swift_Mime_Header
18: {
19: /** Text headers */
20: const TYPE_TEXT = 2;
21:
22: /** Parameterized headers (text + params) */
23: const TYPE_PARAMETERIZED = 6;
24:
25: /** Mailbox and address headers */
26: const TYPE_MAILBOX = 8;
27:
28: /** Date and time headers */
29: const TYPE_DATE = 16;
30:
31: /** Identification headers */
32: const TYPE_ID = 32;
33:
34: /** Address path headers */
35: const TYPE_PATH = 64;
36:
37: /**
38: * Get the type of Header that this instance represents.
39: * @return int
40: * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX
41: * @see TYPE_DATE, TYPE_ID, TYPE_PATH
42: */
43: public function getFieldType();
44:
45: /**
46: * Set the model for the field body.
47: * The actual types needed will vary depending upon the type of Header.
48: * @param mixed $model
49: */
50: public function setFieldBodyModel($model);
51:
52: /**
53: * Set the charset used when rendering the Header.
54: * @param string $charset
55: */
56: public function setCharset($charset);
57:
58: /**
59: * Get the model for the field body.
60: * The return type depends on the specifics of the Header.
61: * @return mixed
62: */
63: public function getFieldBodyModel();
64:
65: /**
66: * Get the name of this header (e.g. Subject).
67: * The name is an identifier and as such will be immutable.
68: * @return string
69: */
70: public function getFieldName();
71:
72: /**
73: * Get the field body, prepared for folding into a final header value.
74: * @return string
75: */
76: public function getFieldBody();
77:
78: /**
79: * Get this Header rendered as a compliant string.
80: * @return string
81: */
82: public function toString();
83: }
84: