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.7.0, 2009-08-10
  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.      * @return PHPExcel_Worksheet_RowDimension 
  103.      */
  104.     public function setRowIndex($pValue{
  105.         $this->_rowIndex = $pValue;
  106.         return $this;
  107.     }
  108.     
  109.     /**
  110.      * Get Row Height
  111.      *
  112.      * @return double 
  113.      */
  114.     public function getRowHeight({
  115.         return $this->_rowHeight;
  116.     }
  117.     
  118.     /**
  119.      * Set Row Height
  120.      *
  121.      * @param double $pValue 
  122.      * @return PHPExcel_Worksheet_RowDimension 
  123.      */
  124.     public function setRowHeight($pValue = -1{
  125.         $this->_rowHeight = $pValue;
  126.         return $this;
  127.     }
  128.     
  129.     /**
  130.      * Get Visible
  131.      *
  132.      * @return bool 
  133.      */
  134.     public function getVisible({
  135.         return $this->_visible;
  136.     }
  137.     
  138.     /**
  139.      * Set Visible
  140.      *
  141.      * @param bool $pValue 
  142.      * @return PHPExcel_Worksheet_RowDimension 
  143.      */
  144.     public function setVisible($pValue true{
  145.         $this->_visible = $pValue;
  146.         return $this;
  147.     }
  148.     
  149.     /**
  150.      * Get Outline Level
  151.      *
  152.      * @return int 
  153.      */
  154.     public function getOutlineLevel({
  155.         return $this->_outlineLevel;
  156.     }
  157.     
  158.     /**
  159.      * Set Outline Level
  160.      *
  161.      * Value must be between 0 and 7
  162.      *
  163.      * @param int $pValue 
  164.      * @throws Exception
  165.      * @return PHPExcel_Worksheet_RowDimension 
  166.      */
  167.     public function setOutlineLevel($pValue{
  168.         if ($pValue || $pValue 7{
  169.             throw new Exception("Outline level must range between 0 and 7.");
  170.         }
  171.         
  172.         $this->_outlineLevel = $pValue;
  173.         return $this;
  174.     }
  175.     
  176.     /**
  177.      * Get Collapsed
  178.      *
  179.      * @return bool 
  180.      */
  181.     public function getCollapsed({
  182.         return $this->_collapsed;
  183.     }
  184.     
  185.     /**
  186.      * Set Collapsed
  187.      *
  188.      * @param bool $pValue 
  189.      * @return PHPExcel_Worksheet_RowDimension 
  190.      */
  191.     public function setCollapsed($pValue true{
  192.         $this->_collapsed = $pValue;
  193.         return $this;
  194.     }
  195.         
  196.     /**
  197.      * Implement PHP __clone to create a deep clone, not just a shallow copy.
  198.      */
  199.     public function __clone({
  200.         $vars get_object_vars($this);
  201.         foreach ($vars as $key => $value{
  202.             if (is_object($value)) {
  203.                 $this->$key clone $value;
  204.             else {
  205.                 $this->$key $value;
  206.             }
  207.         }
  208.     }
  209. }

Documentation generated on Mon, 10 Aug 2009 08:07:40 +0200 by phpDocumentor 1.4.1