For God so loved the world, that He gave His only begotten Son, that all who believe in Him should not perish but have everlasting life
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

178 lines
3.9 KiB

  1. <?php
  2. /**
  3. * PHPExcel_Worksheet_Dimension
  4. *
  5. * Copyright (c) 2006 - 2015 PHPExcel
  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 PHPExcel
  22. * @package PHPExcel_Worksheet
  23. * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
  24. * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
  25. * @version ##VERSION##, ##DATE##
  26. */
  27. abstract class PHPExcel_Worksheet_Dimension
  28. {
  29. /**
  30. * Visible?
  31. *
  32. * @var bool
  33. */
  34. private $visible = true;
  35. /**
  36. * Outline level
  37. *
  38. * @var int
  39. */
  40. private $outlineLevel = 0;
  41. /**
  42. * Collapsed
  43. *
  44. * @var bool
  45. */
  46. private $collapsed = false;
  47. /**
  48. * Index to cellXf. Null value means row has no explicit cellXf format.
  49. *
  50. * @var int|null
  51. */
  52. private $xfIndex;
  53. /**
  54. * Create a new PHPExcel_Worksheet_Dimension
  55. *
  56. * @param int $pIndex Numeric row index
  57. */
  58. public function __construct($initialValue = null)
  59. {
  60. // set dimension as unformatted by default
  61. $this->xfIndex = $initialValue;
  62. }
  63. /**
  64. * Get Visible
  65. *
  66. * @return bool
  67. */
  68. public function getVisible()
  69. {
  70. return $this->visible;
  71. }
  72. /**
  73. * Set Visible
  74. *
  75. * @param bool $pValue
  76. * @return PHPExcel_Worksheet_Dimension
  77. */
  78. public function setVisible($pValue = true)
  79. {
  80. $this->visible = $pValue;
  81. return $this;
  82. }
  83. /**
  84. * Get Outline Level
  85. *
  86. * @return int
  87. */
  88. public function getOutlineLevel()
  89. {
  90. return $this->outlineLevel;
  91. }
  92. /**
  93. * Set Outline Level
  94. *
  95. * Value must be between 0 and 7
  96. *
  97. * @param int $pValue
  98. * @throws PHPExcel_Exception
  99. * @return PHPExcel_Worksheet_Dimension
  100. */
  101. public function setOutlineLevel($pValue)
  102. {
  103. if ($pValue < 0 || $pValue > 7) {
  104. throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
  105. }
  106. $this->outlineLevel = $pValue;
  107. return $this;
  108. }
  109. /**
  110. * Get Collapsed
  111. *
  112. * @return bool
  113. */
  114. public function getCollapsed()
  115. {
  116. return $this->collapsed;
  117. }
  118. /**
  119. * Set Collapsed
  120. *
  121. * @param bool $pValue
  122. * @return PHPExcel_Worksheet_Dimension
  123. */
  124. public function setCollapsed($pValue = true)
  125. {
  126. $this->collapsed = $pValue;
  127. return $this;
  128. }
  129. /**
  130. * Get index to cellXf
  131. *
  132. * @return int
  133. */
  134. public function getXfIndex()
  135. {
  136. return $this->xfIndex;
  137. }
  138. /**
  139. * Set index to cellXf
  140. *
  141. * @param int $pValue
  142. * @return PHPExcel_Worksheet_Dimension
  143. */
  144. public function setXfIndex($pValue = 0)
  145. {
  146. $this->xfIndex = $pValue;
  147. return $this;
  148. }
  149. /**
  150. * Implement PHP __clone to create a deep clone, not just a shallow copy.
  151. */
  152. public function __clone()
  153. {
  154. $vars = get_object_vars($this);
  155. foreach ($vars as $key => $value) {
  156. if (is_object($value)) {
  157. $this->$key = clone $value;
  158. } else {
  159. $this->$key = $value;
  160. }
  161. }
  162. }
  163. }