TOC.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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_Style_TOC
  29. *
  30. * @category PHPWord
  31. * @package PHPWord_Style
  32. * @copyright Copyright (c) 2011 PHPWord
  33. */
  34. class PHPWord_Style_TOC {
  35. const TABLEADER_DOT = 'dot';
  36. const TABLEADER_UNDERSCORE = 'underscore';
  37. const TABLEADER_LINE = 'hyphen';
  38. const TABLEADER_NONE = '';
  39. /**
  40. * Tab Leader
  41. *
  42. * @var string
  43. */
  44. private $_tabLeader;
  45. /**
  46. * Tab Position
  47. *
  48. * @var int
  49. */
  50. private $_tabPos;
  51. /**
  52. * Indent
  53. *
  54. * @var int
  55. */
  56. private $_indent;
  57. /**
  58. * Create a new TOC Style
  59. */
  60. public function __construct() {
  61. $this->_tabPos = 9062;
  62. $this->_tabLeader = PHPWord_Style_TOC::TABLEADER_DOT;
  63. $this->_indent = 200;
  64. }
  65. /**
  66. * Get Tab Position
  67. *
  68. * @return int
  69. */
  70. public function getTabPos() {
  71. return $this->_tabPos;
  72. }
  73. /**
  74. * Set Tab Position
  75. *
  76. * @param int $pValue
  77. */
  78. public function setTabPos($pValue) {
  79. $this->_tabLeader = $pValue;
  80. }
  81. /**
  82. * Get Tab Leader
  83. *
  84. * @return string
  85. */
  86. public function getTabLeader() {
  87. return $this->_tabLeader;
  88. }
  89. /**
  90. * Set Tab Leader
  91. *
  92. * @param string $pValue
  93. */
  94. public function setTabLeader($pValue = PHPWord_Style_TOC::TABLEADER_DOT) {
  95. $this->_tabLeader = $pValue;
  96. }
  97. /**
  98. * Get Indent
  99. *
  100. * @return int
  101. */
  102. public function getIndent() {
  103. return $this->_indent;
  104. }
  105. /**
  106. * Set Indent
  107. *
  108. * @param string $pValue
  109. */
  110. public function setIndent($pValue) {
  111. $this->_indent = $pValue;
  112. }
  113. /**
  114. * Set style value
  115. *
  116. * @param string $key
  117. * @param string $value
  118. */
  119. public function setStyleValue($key, $value) {
  120. $this->$key = $value;
  121. }
  122. }
  123. ?>