File Source for RowDimension.php

PHPExcel_Worksheet

# Source for file RowDimension.php

Documentation is available at RowDimension.php

1. <?php
2. /**
3. * PHPExcel
4. *
5. * Copyright (c) 2006 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
24. * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25. * @version 1.7.6, 2011-02-27
26. */
29. /**
30. * PHPExcel_Worksheet_RowDimension
31. *
32. * @category PHPExcel
33. * @package PHPExcel_Worksheet
34. * @copyright Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
35. */
36. class PHPExcel_Worksheet_RowDimension
37. {
38. /**
39. * Row index
40. *
41. * @var int
42. */
43. private $_rowIndex;
45. /**
46. * Row height (in pt)
47. *
48. * When this is set to a negative value, the row height should be ignored by IWriter
49. *
50. * @var double
51. */
52. private $_rowHeight = -1;
54. /**
55. * Visible?
56. *
57. * @var bool
58. */
59. private $_visible = true;
61. /**
62. * Outline level
63. *
64. * @var int
65. */
66. private $_outlineLevel = 0;
68. /**
69. * Collapsed
70. *
71. * @var bool
72. */
73. private $_collapsed = false;
75. /**
76. * Index to cellXf. Null value means row has no explicit cellXf format.
77. *
78. * @var int|null
79. */
80. private $_xfIndex;
82. /**
83. * Create a new PHPExcel_Worksheet_RowDimension
84. *
85. * @param int $pIndex Numeric row index
86. */
87. public function __construct($pIndex = 0)
88. {
89. // Initialise values
90. $this->_rowIndex = $pIndex;
92. // set row dimension as unformatted by default
93. $this->_xfIndex = null;
94. }
96. /**
97. * Get Row Index
98. *
99. * @return int
100. */
101. public function getRowIndex() {
102. return $this->_rowIndex;
103. }
105. /**
106. * Set Row Index
107. *
108. * @param int $pValue
109. * @return PHPExcel_Worksheet_RowDimension
110. */
111. public function setRowIndex($pValue) {
112. $this->_rowIndex = $pValue;
113. return $this;
114. }
116. /**
117. * Get Row Height
118. *
119. * @return double
120. */
121. public function getRowHeight() {
122. return $this->_rowHeight;
123. }
125. /**
126. * Set Row Height
127. *
128. * @param double $pValue
129. * @return PHPExcel_Worksheet_RowDimension
130. */
131. public function setRowHeight($pValue = -1) {
132. $this->_rowHeight = $pValue;
133. return $this;
134. }
136. /**
137. * Get Visible
138. *
139. * @return bool
140. */
141. public function getVisible() {
142. return $this->_visible;
143. }
145. /**
146. * Set Visible
147. *
148. * @param bool $pValue
149. * @return PHPExcel_Worksheet_RowDimension
150. */
151. public function setVisible($pValue = true) {
152. $this->_visible = $pValue;
153. return $this;
154. }
156. /**
157. * Get Outline Level
158. *
159. * @return int
160. */
161. public function getOutlineLevel() {
162. return $this->_outlineLevel;
163. }
165. /**
166. * Set Outline Level
167. *
168. * Value must be between 0 and 7
169. *
170. * @param int $pValue
171. * @throws Exception
172. * @return PHPExcel_Worksheet_RowDimension
173. */
174. public function setOutlineLevel($pValue) {
175. if ($pValue < 0 || $pValue > 7) {
176. throw new Exception("Outline level must range between 0 and 7.");
177. }
179. $this->_outlineLevel = $pValue;
180. return $this;
181. }
183. /**
184. * Get Collapsed
185. *
186. * @return bool
187. */
188. public function getCollapsed() {
189. return $this->_collapsed;
190. }
192. /**
193. * Set Collapsed
194. *
195. * @param bool $pValue
196. * @return PHPExcel_Worksheet_RowDimension
197. */
198. public function setCollapsed($pValue = true) {
199. $this->_collapsed = $pValue;
200. return $this;
201. }
203. /**
204. * Get index to cellXf
205. *
206. * @return int
207. */
208. public function getXfIndex()
209. {
210. return $this->_xfIndex;
211. }
213. /**
214. * Set index to cellXf
215. *
216. * @param int $pValue
217. * @return PHPExcel_Worksheet_RowDimension
218. */
219. public function setXfIndex($pValue = 0)
220. {
221. $this->_xfIndex = $pValue;
222. return $this;
223. }
225. /**
226. * Implement PHP __clone to create a deep clone, not just a shallow copy.
227. */
228. public function __clone() {
229. $vars = get_object_vars($this);
230. foreach ($vars as $key => $value) {
231. if ( is_object($value)) {
232. $this->$key = clone $value;
233. } else {
234. $this->$key = $value;
235. }
236. }
237. }
238. }

Documentation generated on Sun, 27 Feb 2011 16:33:48 -0800 by phpDocumentor 1.4.3