File Source for SheetView.php

PHPExcel_Worksheet

# Source for file SheetView.php

Documentation is available at SheetView.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_SheetView
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_SheetView
37. {
38. /**
39. * ZoomScale
40. *
41. * Valid values range from 10 to 400.
42. *
43. * @var int
44. */
45. private $_zoomScale = 100;
47. /**
48. * ZoomScaleNormal
49. *
50. * Valid values range from 10 to 400.
51. *
52. * @var int
53. */
54. private $_zoomScaleNormal = 100;
56. /**
57. * Create a new PHPExcel_Worksheet_SheetView
58. */
59. public function __construct()
60. {
61. }
63. /**
64. * Get ZoomScale
65. *
66. * @return int
67. */
68. public function getZoomScale() {
69. return $this->_zoomScale;
70. }
72. /**
73. * Set ZoomScale
74. *
75. * Valid values range from 10 to 400.
76. *
77. * @param int $pValue
78. * @throws Exception
79. * @return PHPExcel_Worksheet_SheetView
80. */
81. public function setZoomScale($pValue = 100) {
82. // Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
83. // but it is apparently still able to handle any scale >= 1
84. if (($pValue >= 1) || is_null($pValue)) {
85. $this->_zoomScale = $pValue;
86. } else {
87. throw new Exception("Scale must be greater than or equal to 1.");
88. }
89. return $this;
90. }
92. /**
93. * Get ZoomScaleNormal
94. *
95. * @return int
96. */
97. public function getZoomScaleNormal() {
98. return $this->_zoomScaleNormal;
99. }
101. /**
102. * Set ZoomScale
103. *
104. * Valid values range from 10 to 400.
105. *
106. * @param int $pValue
107. * @throws Exception
108. * @return PHPExcel_Worksheet_SheetView
109. */
110. public function setZoomScaleNormal($pValue = 100) {
111. if (($pValue >= 1) || is_null($pValue)) {
112. $this->_zoomScaleNormal = $pValue;
113. } else {
114. throw new Exception("Scale must be greater than or equal to 1.");
115. }
116. return $this;
117. }
119. /**
120. * Implement PHP __clone to create a deep clone, not just a shallow copy.
121. */
122. public function __clone() {
123. $vars = get_object_vars($this);
124. foreach ($vars as $key => $value) {
125. if ( is_object($value)) {
126. $this->$key = clone $value;
127. } else {
128. $this->$key = $value;
129. }
130. }
131. }
132. }

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