Updated gui for user facility settings (#1327)
[openemr.git] / vendor / phpoffice / phpexcel / Classes / PHPExcel / Worksheet / SheetView.php
blob8ced835ddad212b6d6b159d0e68c5768058a4566
1 <?php
2 /**
3 * PHPExcel
5 * Copyright (c) 2006 - 2014 PHPExcel
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.
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.
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
21 * @category PHPExcel
22 * @package PHPExcel_Worksheet
23 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
24 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25 * @version ##VERSION##, ##DATE##
29 /**
30 * PHPExcel_Worksheet_SheetView
32 * @category PHPExcel
33 * @package PHPExcel_Worksheet
34 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
36 class PHPExcel_Worksheet_SheetView
39 /* Sheet View types */
40 const SHEETVIEW_NORMAL = 'normal';
41 const SHEETVIEW_PAGE_LAYOUT = 'pageLayout';
42 const SHEETVIEW_PAGE_BREAK_PREVIEW = 'pageBreakPreview';
44 private static $_sheetViewTypes = array(
45 self::SHEETVIEW_NORMAL,
46 self::SHEETVIEW_PAGE_LAYOUT,
47 self::SHEETVIEW_PAGE_BREAK_PREVIEW,
50 /**
51 * ZoomScale
53 * Valid values range from 10 to 400.
55 * @var int
57 private $_zoomScale = 100;
59 /**
60 * ZoomScaleNormal
62 * Valid values range from 10 to 400.
64 * @var int
66 private $_zoomScaleNormal = 100;
68 /**
69 * View
71 * Valid values range from 10 to 400.
73 * @var string
75 private $_sheetviewType = self::SHEETVIEW_NORMAL;
77 /**
78 * Create a new PHPExcel_Worksheet_SheetView
80 public function __construct()
84 /**
85 * Get ZoomScale
87 * @return int
89 public function getZoomScale() {
90 return $this->_zoomScale;
93 /**
94 * Set ZoomScale
96 * Valid values range from 10 to 400.
98 * @param int $pValue
99 * @throws PHPExcel_Exception
100 * @return PHPExcel_Worksheet_SheetView
102 public function setZoomScale($pValue = 100) {
103 // Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
104 // but it is apparently still able to handle any scale >= 1
105 if (($pValue >= 1) || is_null($pValue)) {
106 $this->_zoomScale = $pValue;
107 } else {
108 throw new PHPExcel_Exception("Scale must be greater than or equal to 1.");
110 return $this;
114 * Get ZoomScaleNormal
116 * @return int
118 public function getZoomScaleNormal() {
119 return $this->_zoomScaleNormal;
123 * Set ZoomScale
125 * Valid values range from 10 to 400.
127 * @param int $pValue
128 * @throws PHPExcel_Exception
129 * @return PHPExcel_Worksheet_SheetView
131 public function setZoomScaleNormal($pValue = 100) {
132 if (($pValue >= 1) || is_null($pValue)) {
133 $this->_zoomScaleNormal = $pValue;
134 } else {
135 throw new PHPExcel_Exception("Scale must be greater than or equal to 1.");
137 return $this;
141 * Get View
143 * @return string
145 public function getView() {
146 return $this->_sheetviewType;
150 * Set View
152 * Valid values are
153 * 'normal' self::SHEETVIEW_NORMAL
154 * 'pageLayout' self::SHEETVIEW_PAGE_LAYOUT
155 * 'pageBreakPreview' self::SHEETVIEW_PAGE_BREAK_PREVIEW
157 * @param string $pValue
158 * @throws PHPExcel_Exception
159 * @return PHPExcel_Worksheet_SheetView
161 public function setView($pValue = NULL) {
162 // MS Excel 2007 allows setting the view to 'normal', 'pageLayout' or 'pageBreakPreview'
163 // via the user interface
164 if ($pValue === NULL)
165 $pValue = self::SHEETVIEW_NORMAL;
166 if (in_array($pValue, self::$_sheetViewTypes)) {
167 $this->_sheetviewType = $pValue;
168 } else {
169 throw new PHPExcel_Exception("Invalid sheetview layout type.");
172 return $this;
176 * Implement PHP __clone to create a deep clone, not just a shallow copy.
178 public function __clone() {
179 $vars = get_object_vars($this);
180 foreach ($vars as $key => $value) {
181 if (is_object($value)) {
182 $this->$key = clone $value;
183 } else {
184 $this->$key = $value;