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

Documentation generated on Tue, 01 Jun 2010 17:05:59 +0200 by phpDocumentor 1.4.3