Title.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?php
  2. /**
  3. * PHPWord
  4. *
  5. * Copyright (c) 2011 PHPWord
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. *
  21. * @category PHPWord
  22. * @package PHPWord
  23. * @copyright Copyright (c) 010 PHPWord
  24. * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
  25. * @version Beta 0.6.3, 08.07.2011
  26. */
  27. /**
  28. * PHPWord_Section_Title
  29. *
  30. * @category PHPWord
  31. * @package PHPWord_Section
  32. * @copyright Copyright (c) 2011 PHPWord
  33. */
  34. class PHPWord_Section_Title {
  35. /**
  36. * Title Text content
  37. *
  38. * @var string
  39. */
  40. private $_text;
  41. /**
  42. * Title depth
  43. *
  44. * @var int
  45. */
  46. private $_depth;
  47. /**
  48. * Title anchor
  49. *
  50. * @var int
  51. */
  52. private $_anchor;
  53. /**
  54. * Title Bookmark ID
  55. *
  56. * @var int
  57. */
  58. private $_bookmarkId;
  59. /**
  60. * Title style
  61. *
  62. * @var string
  63. */
  64. private $_style;
  65. /**
  66. * Create a new Title Element
  67. *
  68. * @var string $text
  69. * @var int $depth
  70. */
  71. public function __construct($text, $depth = 1, $style = null) {
  72. if(!is_null($style)) {
  73. $this->_style = $style;
  74. }
  75. $this->_text = $text;
  76. $this->_depth = $depth;
  77. return $this;
  78. }
  79. /**
  80. * Set Anchor
  81. *
  82. * @var int $anchor
  83. */
  84. public function setAnchor($anchor) {
  85. $this->_anchor = $anchor;
  86. }
  87. /**
  88. * Get Anchor
  89. *
  90. * @return int
  91. */
  92. public function getAnchor() {
  93. return $this->_anchor;
  94. }
  95. /**
  96. * Set Bookmark ID
  97. *
  98. * @var int $bookmarkId
  99. */
  100. public function setBookmarkId($bookmarkId) {
  101. $this->_bookmarkId = $bookmarkId;
  102. }
  103. /**
  104. * Get Anchor
  105. *
  106. * @return int
  107. */
  108. public function getBookmarkId() {
  109. return $this->_bookmarkId;
  110. }
  111. /**
  112. * Get Title Text content
  113. *
  114. * @return string
  115. */
  116. public function getText() {
  117. return $this->_text;
  118. }
  119. /**
  120. * Get Title style
  121. *
  122. * @return string
  123. */
  124. public function getStyle() {
  125. return $this->_style;
  126. }
  127. }
  128. ?>