PageRenderTime 32ms CodeModel.GetById 19ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

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