Header.php 1.9KB

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