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