/framework/vendor/swift/lib/classes/Swift/Mime/HeaderSet.php

http://zoop.googlecode.com/ · PHP · 170 lines · 21 code · 20 blank · 129 comment · 0 complexity · 19c25bd3e7ed9b5943c2fabf1d088dd7 MD5 · raw file

  1. <?php
  2. /*
  3. * This file is part of SwiftMailer.
  4. * (c) 2004-2009 Chris Corbyn
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. //@require 'Swift/Mime/CharsetObserver.php';
  10. /**
  11. * A collection of MIME headers.
  12. *
  13. * @package Swift
  14. * @subpackage Mime
  15. *
  16. * @author Chris Corbyn
  17. */
  18. interface Swift_Mime_HeaderSet extends Swift_Mime_CharsetObserver
  19. {
  20. /**
  21. * Add a new Mailbox Header with a list of $addresses.
  22. *
  23. * @param string $name
  24. * @param array|string $addresses
  25. */
  26. public function addMailboxHeader($name, $addresses = null);
  27. /**
  28. * Add a new Date header using $timestamp (UNIX time).
  29. *
  30. * @param string $name
  31. * @param int $timestamp
  32. */
  33. public function addDateHeader($name, $timestamp = null);
  34. /**
  35. * Add a new basic text header with $name and $value.
  36. *
  37. * @param string $name
  38. * @param string $value
  39. */
  40. public function addTextHeader($name, $value = null);
  41. /**
  42. * Add a new ParameterizedHeader with $name, $value and $params.
  43. *
  44. * @param string $name
  45. * @param string $value
  46. * @param array $params
  47. */
  48. public function addParameterizedHeader($name, $value = null,
  49. $params = array());
  50. /**
  51. * Add a new ID header for Message-ID or Content-ID.
  52. *
  53. * @param string $name
  54. * @param string|array $ids
  55. */
  56. public function addIdHeader($name, $ids = null);
  57. /**
  58. * Add a new Path header with an address (path) in it.
  59. *
  60. * @param string $name
  61. * @param string $path
  62. */
  63. public function addPathHeader($name, $path = null);
  64. /**
  65. * Returns true if at least one header with the given $name exists.
  66. *
  67. * If multiple headers match, the actual one may be specified by $index.
  68. *
  69. * @param string $name
  70. * @param int $index
  71. *
  72. * @return boolean
  73. */
  74. public function has($name, $index = 0);
  75. /**
  76. * Set a header in the HeaderSet.
  77. *
  78. * The header may be a previously fetched header via {@link get()} or it may
  79. * be one that has been created separately.
  80. *
  81. * If $index is specified, the header will be inserted into the set at this
  82. * offset.
  83. *
  84. * @param Swift_Mime_Header $header
  85. * @param int $index
  86. */
  87. public function set(Swift_Mime_Header $header, $index = 0);
  88. /**
  89. * Get the header with the given $name.
  90. * If multiple headers match, the actual one may be specified by $index.
  91. * Returns NULL if none present.
  92. *
  93. * @param string $name
  94. * @param int $index
  95. *
  96. * @return Swift_Mime_Header
  97. */
  98. public function get($name, $index = 0);
  99. /**
  100. * Get all headers with the given $name.
  101. *
  102. * @param string $name
  103. *
  104. * @return array
  105. */
  106. public function getAll($name = null);
  107. /**
  108. * Remove the header with the given $name if it's set.
  109. *
  110. * If multiple headers match, the actual one may be specified by $index.
  111. *
  112. * @param string $name
  113. * @param int $index
  114. */
  115. public function remove($name, $index = 0);
  116. /**
  117. * Remove all headers with the given $name.
  118. *
  119. * @param string $name
  120. */
  121. public function removeAll($name);
  122. /**
  123. * Create a new instance of this HeaderSet.
  124. *
  125. * @return Swift_Mime_HeaderSet
  126. */
  127. public function newInstance();
  128. /**
  129. * Define a list of Header names as an array in the correct order.
  130. *
  131. * These Headers will be output in the given order where present.
  132. *
  133. * @param array $sequence
  134. */
  135. public function defineOrdering(array $sequence);
  136. /**
  137. * Set a list of header names which must always be displayed when set.
  138. *
  139. * Usually headers without a field value won't be output unless set here.
  140. *
  141. * @param array $names
  142. */
  143. public function setAlwaysDisplayed(array $names);
  144. /**
  145. * Returns a string with a representation of all headers.
  146. *
  147. * @return string
  148. */
  149. public function toString();
  150. }