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