ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SheetView.php
Go to the documentation of this file.
1 <?php
37 {
38 
39  /* Sheet View types */
40  const SHEETVIEW_NORMAL = 'normal';
41  const SHEETVIEW_PAGE_LAYOUT = 'pageLayout';
42  const SHEETVIEW_PAGE_BREAK_PREVIEW = 'pageBreakPreview';
43 
44  private static $_sheetViewTypes = array(
45  self::SHEETVIEW_NORMAL,
46  self::SHEETVIEW_PAGE_LAYOUT,
47  self::SHEETVIEW_PAGE_BREAK_PREVIEW,
48  );
49 
57  private $_zoomScale = 100;
58 
66  private $_zoomScaleNormal = 100;
67 
75  private $_sheetviewType = self::SHEETVIEW_NORMAL;
76 
80  public function __construct()
81  {
82  }
83 
89  public function getZoomScale() {
90  return $this->_zoomScale;
91  }
92 
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.");
109  }
110  return $this;
111  }
112 
118  public function getZoomScaleNormal() {
120  }
121 
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.");
136  }
137  return $this;
138  }
139 
145  public function getView() {
146  return $this->_sheetviewType;
147  }
148 
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.");
170  }
171 
172  return $this;
173  }
174 
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;
185  }
186  }
187  }
188 }
getZoomScaleNormal()
Get ZoomScaleNormal.
Definition: SheetView.php:118
__construct()
Create a new PHPExcel_Worksheet_SheetView.
Definition: SheetView.php:80
getZoomScale()
Get ZoomScale.
Definition: SheetView.php:89
setZoomScaleNormal($pValue=100)
Set ZoomScale.
Definition: SheetView.php:131
setZoomScale($pValue=100)
Set ZoomScale.
Definition: SheetView.php:102
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
Definition: SheetView.php:178
setView($pValue=NULL)
Set View.
Definition: SheetView.php:161
Create styles array
The data for the language used.
$key
Definition: croninfo.php:18