PHPExcel_Worksheet
[ class tree: PHPExcel_Worksheet ] [ index: PHPExcel_Worksheet ] [ all elements ]

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

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