Header.php 1.9 KB

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