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

Source for file RowDimension.php

Documentation is available at RowDimension.php

  1. <?php
  2. /**
  3.  * PHPExcel
  4.  *
  5.  * Copyright (c) 2006 - 2009 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 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
  24.  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
  25.  * @version    1.6.5, 2009-01-05
  26.  */
  27.  
  28.  
  29. /**
  30.  * PHPExcel_Worksheet_RowDimension
  31.  *
  32.  * @category   PHPExcel
  33.  * @package    PHPExcel_Worksheet
  34.  * @copyright  Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
  35.  */
  36. {            
  37.     /**
  38.      * Row index
  39.      *
  40.      * @var int 
  41.      */
  42.     private $_rowIndex;
  43.     
  44.     /**
  45.      * Row height (in pt)
  46.      *
  47.      * When this is set to a negative value, the row height should be ignored by IWriter
  48.      *
  49.      * @var double 
  50.      */
  51.     private $_rowHeight;
  52.     
  53.     /**
  54.      * Visible?
  55.      *
  56.      * @var bool 
  57.      */
  58.     private $_visible;
  59.     
  60.     /**
  61.      * Outline level
  62.      *
  63.      * @var int 
  64.      */
  65.     private $_outlineLevel = 0;
  66.     
  67.     /**
  68.      * Collapsed
  69.      *
  70.      * @var bool 
  71.      */
  72.     private $_collapsed;
  73.     
  74.     /**
  75.      * Create a new PHPExcel_Worksheet_RowDimension
  76.      *
  77.      * @param int $pIndex Numeric row index
  78.      */
  79.     public function __construct($pIndex 0)
  80.     {
  81.         // Initialise values
  82.         $this->_rowIndex        = $pIndex;
  83.         $this->_rowHeight        = -1;
  84.         $this->_visible            = true;
  85.         $this->_outlineLevel    = 0;
  86.         $this->_collapsed        = false;
  87.     }
  88.     
  89.     /**
  90.      * Get Row Index
  91.      *
  92.      * @return int 
  93.      */
  94.     public function getRowIndex({
  95.         return $this->_rowIndex;
  96.     }
  97.     
  98.     /**
  99.      * Set Row Index
  100.      *
  101.      * @param int $pValue 
  102.      */
  103.     public function setRowIndex($pValue{
  104.         $this->_rowIndex = $pValue;
  105.     }
  106.     
  107.     /**
  108.      * Get Row Height
  109.      *
  110.      * @return double 
  111.      */
  112.     public function getRowHeight({
  113.         return $this->_rowHeight;
  114.     }
  115.     
  116.     /**
  117.      * Set Row Height
  118.      *
  119.      * @param double $pValue 
  120.      */
  121.     public function setRowHeight($pValue = -1{
  122.         $this->_rowHeight = $pValue;
  123.     }
  124.     
  125.     /**
  126.      * Get Visible
  127.      *
  128.      * @return bool 
  129.      */
  130.     public function getVisible({
  131.         return $this->_visible;
  132.     }
  133.     
  134.     /**
  135.      * Set Visible
  136.      *
  137.      * @param bool $pValue 
  138.      */
  139.     public function setVisible($pValue true{
  140.         $this->_visible = $pValue;
  141.     }
  142.     
  143.     /**
  144.      * Get Outline Level
  145.      *
  146.      * @return int 
  147.      */
  148.     public function getOutlineLevel({
  149.         return $this->_outlineLevel;
  150.     }
  151.     
  152.     /**
  153.      * Set Outline Level
  154.      *
  155.      * Value must be between 0 and 7
  156.      *
  157.      * @param int $pValue 
  158.      * @throws Exception
  159.      */
  160.     public function setOutlineLevel($pValue{
  161.         if ($pValue || $pValue 7{
  162.             throw new Exception("Outline level must range between 0 and 7.");
  163.         }
  164.         
  165.         $this->_outlineLevel = $pValue;
  166.     }
  167.     
  168.     /**
  169.      * Get Collapsed
  170.      *
  171.      * @return bool 
  172.      */
  173.     public function getCollapsed({
  174.         return $this->_collapsed;
  175.     }
  176.     
  177.     /**
  178.      * Set Collapsed
  179.      *
  180.      * @param bool $pValue 
  181.      */
  182.     public function setCollapsed($pValue true{
  183.         $this->_collapsed = $pValue;
  184.     }
  185.         
  186.     /**
  187.      * Implement PHP __clone to create a deep clone, not just a shallow copy.
  188.      */
  189.     public function __clone({
  190.         $vars get_object_vars($this);
  191.         foreach ($vars as $key => $value{
  192.             if (is_object($value)) {
  193.                 $this->$key clone $value;
  194.             else {
  195.                 $this->$key $value;
  196.             }
  197.         }
  198.     }
  199. }

Documentation generated on Mon, 05 Jan 2009 20:38:27 +0100 by phpDocumentor 1.4.1