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

Source for file ColumnDimension.php

Documentation is available at ColumnDimension.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_ColumnDimension
  31.  *
  32.  * @category   PHPExcel
  33.  * @package    PHPExcel_Worksheet
  34.  * @copyright  Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
  35.  */
  36. {            
  37.     /**
  38.      * Column index
  39.      *
  40.      * @var int 
  41.      */
  42.     private $_columnIndex;
  43.     
  44.     /**
  45.      * Column width
  46.      *
  47.      * When this is set to a negative value, the column width should be ignored by IWriter
  48.      *
  49.      * @var double 
  50.      */
  51.     private $_width;
  52.     
  53.     /**
  54.      * Auto size?
  55.      *
  56.      * @var bool 
  57.      */
  58.     private $_autoSize;
  59.     
  60.     /**
  61.      * Visible?
  62.      *
  63.      * @var bool 
  64.      */
  65.     private $_visible;
  66.     
  67.     /**
  68.      * Outline level
  69.      *
  70.      * @var int 
  71.      */
  72.     private $_outlineLevel = 0;
  73.     
  74.     /**
  75.      * Collapsed
  76.      *
  77.      * @var bool 
  78.      */
  79.     private $_collapsed;
  80.         
  81.     /**
  82.      * Create a new PHPExcel_Worksheet_RowDimension
  83.      *
  84.      * @param string $pIndex Character column index
  85.      */
  86.     public function __construct($pIndex 'A')
  87.     {
  88.         // Initialise values
  89.         $this->_columnIndex        = $pIndex;
  90.         $this->_width            = -1;
  91.         $this->_autoSize        = false;
  92.         $this->_visible            = true;
  93.         $this->_outlineLevel    = 0;
  94.         $this->_collapsed        = false;
  95.     }
  96.     
  97.     /**
  98.      * Get ColumnIndex
  99.      *
  100.      * @return string 
  101.      */
  102.     public function getColumnIndex({
  103.         return $this->_columnIndex;
  104.     }
  105.     
  106.     /**
  107.      * Set ColumnIndex
  108.      *
  109.      * @param string $pValue 
  110.      */
  111.     public function setColumnIndex($pValue{
  112.         $this->_columnIndex = $pValue;
  113.     }
  114.     
  115.     /**
  116.      * Get Width
  117.      *
  118.      * @return double 
  119.      */
  120.     public function getWidth({
  121.         return $this->_width;
  122.     }
  123.     
  124.     /**
  125.      * Set Width
  126.      *
  127.      * @param double $pValue 
  128.      */
  129.     public function setWidth($pValue = -1{
  130.         $this->_width = $pValue;
  131.     }
  132.     
  133.     /**
  134.      * Get Auto Size
  135.      *
  136.      * @return bool 
  137.      */
  138.     public function getAutoSize({
  139.         return $this->_autoSize;
  140.     }
  141.     
  142.     /**
  143.      * Set Auto Size
  144.      *
  145.      * @param bool $pValue 
  146.      */
  147.     public function setAutoSize($pValue false{
  148.         $this->_autoSize = $pValue;
  149.     }
  150.     
  151.     /**
  152.      * Get Visible
  153.      *
  154.      * @return bool 
  155.      */
  156.     public function getVisible({
  157.         return $this->_visible;
  158.     }
  159.     
  160.     /**
  161.      * Set Visible
  162.      *
  163.      * @param bool $pValue 
  164.      */
  165.     public function setVisible($pValue true{
  166.         $this->_visible = $pValue;
  167.     }
  168.     
  169.     /**
  170.      * Get Outline Level
  171.      *
  172.      * @return int 
  173.      */
  174.     public function getOutlineLevel({
  175.         return $this->_outlineLevel;
  176.     }
  177.     
  178.     /**
  179.      * Set Outline Level
  180.      *
  181.      * Value must be between 0 and 7
  182.      *
  183.      * @param int $pValue 
  184.      * @throws Exception
  185.      */
  186.     public function setOutlineLevel($pValue{
  187.         if ($pValue || $pValue 7{
  188.             throw new Exception("Outline level must range between 0 and 7.");
  189.         }
  190.         
  191.         $this->_outlineLevel = $pValue;
  192.     }
  193.     
  194.     /**
  195.      * Get Collapsed
  196.      *
  197.      * @return bool 
  198.      */
  199.     public function getCollapsed({
  200.         return $this->_collapsed;
  201.     }
  202.     
  203.     /**
  204.      * Set Collapsed
  205.      *
  206.      * @param bool $pValue 
  207.      */
  208.     public function setCollapsed($pValue true{
  209.         $this->_collapsed = $pValue;
  210.     }
  211.         
  212.     /**
  213.      * Implement PHP __clone to create a deep clone, not just a shallow copy.
  214.      */
  215.     public function __clone({
  216.         $vars get_object_vars($this);
  217.         foreach ($vars as $key => $value{
  218.             if (is_object($value)) {
  219.                 $this->$key clone $value;
  220.             else {
  221.                 $this->$key $value;
  222.             }
  223.         }
  224.     }
  225. }

Documentation generated on Mon, 05 Jan 2009 20:36:41 +0100 by phpDocumentor 1.4.1