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 - 2011 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 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
  24.  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
  25.  * @version    1.7.6, 2011-02-27
  26.  */
  27.  
  28.  
  29. /**
  30.  * PHPExcel_Worksheet_ColumnDimension
  31.  *
  32.  * @category   PHPExcel
  33.  * @package    PHPExcel_Worksheet
  34.  * @copyright  Copyright (c) 2006 - 2011 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            = -1;
  52.  
  53.     /**
  54.      * Auto size?
  55.      *
  56.      * @var bool 
  57.      */
  58.     private $_autoSize        false;
  59.  
  60.     /**
  61.      * Visible?
  62.      *
  63.      * @var bool 
  64.      */
  65.     private $_visible        true;
  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        false;
  80.  
  81.     /**
  82.      * Index to cellXf
  83.      *
  84.      * @var int 
  85.      */
  86.     private $_xfIndex;
  87.  
  88.     /**
  89.      * Create a new PHPExcel_Worksheet_ColumnDimension
  90.      *
  91.      * @param string $pIndex Character column index
  92.      */
  93.     public function __construct($pIndex 'A')
  94.     {
  95.         // Initialise values
  96.         $this->_columnIndex        $pIndex;
  97.  
  98.         // set default index to cellXf
  99.         $this->_xfIndex 0;
  100.     }
  101.  
  102.     /**
  103.      * Get ColumnIndex
  104.      *
  105.      * @return string 
  106.      */
  107.     public function getColumnIndex({
  108.         return $this->_columnIndex;
  109.     }
  110.  
  111.     /**
  112.      * Set ColumnIndex
  113.      *
  114.      * @param string $pValue 
  115.      * @return PHPExcel_Worksheet_ColumnDimension 
  116.      */
  117.     public function setColumnIndex($pValue{
  118.         $this->_columnIndex $pValue;
  119.         return $this;
  120.     }
  121.  
  122.     /**
  123.      * Get Width
  124.      *
  125.      * @return double 
  126.      */
  127.     public function getWidth({
  128.         return $this->_width;
  129.     }
  130.  
  131.     /**
  132.      * Set Width
  133.      *
  134.      * @param double $pValue 
  135.      * @return PHPExcel_Worksheet_ColumnDimension 
  136.      */
  137.     public function setWidth($pValue = -1{
  138.         $this->_width $pValue;
  139.         return $this;
  140.     }
  141.  
  142.     /**
  143.      * Get Auto Size
  144.      *
  145.      * @return bool 
  146.      */
  147.     public function getAutoSize({
  148.         return $this->_autoSize;
  149.     }
  150.  
  151.     /**
  152.      * Set Auto Size
  153.      *
  154.      * @param bool $pValue 
  155.      * @return PHPExcel_Worksheet_ColumnDimension 
  156.      */
  157.     public function setAutoSize($pValue false{
  158.         $this->_autoSize $pValue;
  159.         return $this;
  160.     }
  161.  
  162.     /**
  163.      * Get Visible
  164.      *
  165.      * @return bool 
  166.      */
  167.     public function getVisible({
  168.         return $this->_visible;
  169.     }
  170.  
  171.     /**
  172.      * Set Visible
  173.      *
  174.      * @param bool $pValue 
  175.      * @return PHPExcel_Worksheet_ColumnDimension 
  176.      */
  177.     public function setVisible($pValue true{
  178.         $this->_visible $pValue;
  179.         return $this;
  180.     }
  181.  
  182.     /**
  183.      * Get Outline Level
  184.      *
  185.      * @return int 
  186.      */
  187.     public function getOutlineLevel({
  188.         return $this->_outlineLevel;
  189.     }
  190.  
  191.     /**
  192.      * Set Outline Level
  193.      *
  194.      * Value must be between 0 and 7
  195.      *
  196.      * @param int $pValue 
  197.      * @throws Exception
  198.      * @return PHPExcel_Worksheet_ColumnDimension 
  199.      */
  200.     public function setOutlineLevel($pValue{
  201.         if ($pValue || $pValue 7{
  202.             throw new Exception("Outline level must range between 0 and 7.");
  203.         }
  204.  
  205.         $this->_outlineLevel $pValue;
  206.         return $this;
  207.     }
  208.  
  209.     /**
  210.      * Get Collapsed
  211.      *
  212.      * @return bool 
  213.      */
  214.     public function getCollapsed({
  215.         return $this->_collapsed;
  216.     }
  217.  
  218.     /**
  219.      * Set Collapsed
  220.      *
  221.      * @param bool $pValue 
  222.      * @return PHPExcel_Worksheet_ColumnDimension 
  223.      */
  224.     public function setCollapsed($pValue true{
  225.         $this->_collapsed $pValue;
  226.         return $this;
  227.     }
  228.  
  229.     /**
  230.      * Get index to cellXf
  231.      *
  232.      * @return int 
  233.      */
  234.     public function getXfIndex()
  235.     {
  236.         return $this->_xfIndex;
  237.     }
  238.  
  239.     /**
  240.      * Set index to cellXf
  241.      *
  242.      * @param int $pValue 
  243.      * @return PHPExcel_Worksheet_ColumnDimension 
  244.      */
  245.     public function setXfIndex($pValue 0)
  246.     {
  247.         $this->_xfIndex $pValue;
  248.         return $this;
  249.     }
  250.  
  251.     /**
  252.      * Implement PHP __clone to create a deep clone, not just a shallow copy.
  253.      */
  254.     public function __clone({
  255.         $vars get_object_vars($this);
  256.         foreach ($vars as $key => $value{
  257.             if (is_object($value)) {
  258.                 $this->$key clone $value;
  259.             else {
  260.                 $this->$key $value;
  261.             }
  262.         }
  263.     }
  264.  
  265. }

Documentation generated on Sun, 27 Feb 2011 16:29:07 -0800 by phpDocumentor 1.4.3