Header.php 2.0KB

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