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 - 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_RowDimension
  31.  *
  32.  * @category   PHPExcel
  33.  * @package    PHPExcel_Worksheet
  34.  * @copyright  Copyright (c) 2006 - 2010 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.      * Index to cellXf. Null value means row has no explicit cellXf format.
  76.      *
  77.      * @var int|null
  78.      */
  79.     private $_xfIndex;
  80.  
  81.     /**
  82.      * Create a new PHPExcel_Worksheet_RowDimension
  83.      *
  84.      * @param int $pIndex Numeric row index
  85.      */
  86.     public function __construct($pIndex 0)
  87.     {
  88.         // Initialise values
  89.         $this->_rowIndex        $pIndex;
  90.         $this->_rowHeight        = -1;
  91.         $this->_visible            true;
  92.         $this->_outlineLevel    0;
  93.         $this->_collapsed        false;
  94.  
  95.         // set row dimension as unformatted by default
  96.         $this->_xfIndex null;
  97.     }
  98.     
  99.     /**
  100.      * Get Row Index
  101.      *
  102.      * @return int 
  103.      */
  104.     public function getRowIndex({
  105.         return $this->_rowIndex;
  106.     }
  107.     
  108.     /**
  109.      * Set Row Index
  110.      *
  111.      * @param int $pValue 
  112.      * @return PHPExcel_Worksheet_RowDimension 
  113.      */
  114.     public function setRowIndex($pValue{
  115.         $this->_rowIndex $pValue;
  116.         return $this;
  117.     }
  118.     
  119.     /**
  120.      * Get Row Height
  121.      *
  122.      * @return double 
  123.      */
  124.     public function getRowHeight({
  125.         return $this->_rowHeight;
  126.     }
  127.     
  128.     /**
  129.      * Set Row Height
  130.      *
  131.      * @param double $pValue 
  132.      * @return PHPExcel_Worksheet_RowDimension 
  133.      */
  134.     public function setRowHeight($pValue = -1{
  135.         $this->_rowHeight $pValue;
  136.         return $this;
  137.     }
  138.     
  139.     /**
  140.      * Get Visible
  141.      *
  142.      * @return bool 
  143.      */
  144.     public function getVisible({
  145.         return $this->_visible;
  146.     }
  147.     
  148.     /**
  149.      * Set Visible
  150.      *
  151.      * @param bool $pValue 
  152.      * @return PHPExcel_Worksheet_RowDimension 
  153.      */
  154.     public function setVisible($pValue true{
  155.         $this->_visible $pValue;
  156.         return $this;
  157.     }
  158.     
  159.     /**
  160.      * Get Outline Level
  161.      *
  162.      * @return int 
  163.      */
  164.     public function getOutlineLevel({
  165.         return $this->_outlineLevel;
  166.     }
  167.     
  168.     /**
  169.      * Set Outline Level
  170.      *
  171.      * Value must be between 0 and 7
  172.      *
  173.      * @param int $pValue 
  174.      * @throws Exception
  175.      * @return PHPExcel_Worksheet_RowDimension 
  176.      */
  177.     public function setOutlineLevel($pValue{
  178.         if ($pValue || $pValue 7{
  179.             throw new Exception("Outline level must range between 0 and 7.");
  180.         }
  181.         
  182.         $this->_outlineLevel $pValue;
  183.         return $this;
  184.     }
  185.     
  186.     /**
  187.      * Get Collapsed
  188.      *
  189.      * @return bool 
  190.      */
  191.     public function getCollapsed({
  192.         return $this->_collapsed;
  193.     }
  194.     
  195.     /**
  196.      * Set Collapsed
  197.      *
  198.      * @param bool $pValue 
  199.      * @return PHPExcel_Worksheet_RowDimension 
  200.      */
  201.     public function setCollapsed($pValue true{
  202.         $this->_collapsed $pValue;
  203.         return $this;
  204.     }
  205.  
  206.     /**
  207.      * Get index to cellXf
  208.      *
  209.      * @return int 
  210.      */
  211.     public function getXfIndex()
  212.     {
  213.         return $this->_xfIndex;
  214.     }
  215.  
  216.     /**
  217.      * Set index to cellXf
  218.      *
  219.      * @param int $pValue 
  220.      * @return PHPExcel_Worksheet_RowDimension 
  221.      */
  222.     public function setXfIndex($pValue 0)
  223.     {
  224.         $this->_xfIndex $pValue;
  225.         return $this;
  226.     }
  227.  
  228.     /**
  229.      * Implement PHP __clone to create a deep clone, not just a shallow copy.
  230.      */
  231.     public function __clone({
  232.         $vars get_object_vars($this);
  233.         foreach ($vars as $key => $value{
  234.             if (is_object($value)) {
  235.                 $this->$key clone $value;
  236.             else {
  237.                 $this->$key $value;
  238.             }
  239.         }
  240.     }
  241. }

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