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

Source for file SpContainer.php

Documentation is available at SpContainer.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_Shared_Escher
  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.  * PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
  30.  *
  31.  * @category   PHPExcel
  32.  * @package    PHPExcel_Shared_Escher
  33.  * @copyright  Copyright (c) 2006 - 2011 PHPExcel (http://www.codeplex.com/PHPExcel)
  34.  */
  35. {
  36.     /**
  37.      * Parent Shape Group Container
  38.      *
  39.      * @var PHPExcel_Shared_Escher_DgContainer_SpgrContainer 
  40.      */
  41.     private $_parent;
  42.  
  43.     /**
  44.      * Is this a group shape?
  45.      *
  46.      * @var boolean 
  47.      */
  48.     private $_spgr false;
  49.  
  50.     /**
  51.      * Shape type
  52.      *
  53.      * @var int 
  54.      */
  55.     private $_spType;
  56.  
  57.     /**
  58.      * Shape index (usually group shape has index 0, and the rest: 1,2,3...)
  59.      *
  60.      * @var boolean 
  61.      */
  62.     private $_spId;
  63.  
  64.     /**
  65.      * Array of options
  66.      *
  67.      * @var array 
  68.      */
  69.     private $_OPT;
  70.  
  71.     /**
  72.      * Cell coordinates of upper-left corner of shape, e.g. 'A1'
  73.      *
  74.      * @var string 
  75.      */
  76.     private $_startCoordinates;
  77.  
  78.     /**
  79.      * Horizontal offset of upper-left corner of shape measured in 1/1024 of column width
  80.      *
  81.      * @var int 
  82.      */
  83.     private $_startOffsetX;
  84.  
  85.     /**
  86.      * Vertical offset of upper-left corner of shape measured in 1/256 of row height
  87.      *
  88.      * @var int 
  89.      */
  90.     private $_startOffsetY;
  91.  
  92.     /**
  93.      * Cell coordinates of bottom-right corner of shape, e.g. 'B2'
  94.      *
  95.      * @var string 
  96.      */
  97.     private $_endCoordinates;
  98.  
  99.     /**
  100.      * Horizontal offset of bottom-right corner of shape measured in 1/1024 of column width
  101.      *
  102.      * @var int 
  103.      */
  104.     private $_endOffsetX;
  105.  
  106.     /**
  107.      * Vertical offset of bottom-right corner of shape measured in 1/256 of row height
  108.      *
  109.      * @var int 
  110.      */
  111.     private $_endOffsetY;
  112.  
  113.     /**
  114.      * Set parent Shape Group Container
  115.      *
  116.      * @param PHPExcel_Shared_Escher_DgContainer_SpgrContainer $parent 
  117.      */
  118.     public function setParent($parent)
  119.     {
  120.         $this->_parent $parent;
  121.     }
  122.  
  123.     /**
  124.      * Get the parent Shape Group Container
  125.      *
  126.      * @return PHPExcel_Shared_Escher_DgContainer_SpgrContainer 
  127.      */
  128.     public function getParent()
  129.     {
  130.         return $this->_parent;
  131.     }
  132.  
  133.     /**
  134.      * Set whether this is a group shape
  135.      *
  136.      * @param boolean $value 
  137.      */
  138.     public function setSpgr($value false)
  139.     {
  140.         $this->_spgr $value;
  141.     }
  142.  
  143.     /**
  144.      * Get whether this is a group shape
  145.      *
  146.      * @return boolean 
  147.      */
  148.     public function getSpgr()
  149.     {
  150.         return $this->_spgr;
  151.     }
  152.  
  153.     /**
  154.      * Set the shape type
  155.      *
  156.      * @param int $value 
  157.      */
  158.     public function setSpType($value)
  159.     {
  160.         $this->_spType $value;
  161.     }
  162.  
  163.     /**
  164.      * Get the shape type
  165.      *
  166.      * @return int 
  167.      */
  168.     public function getSpType()
  169.     {
  170.         return $this->_spType;
  171.     }
  172.  
  173.     /**
  174.      * Set the shape index
  175.      *
  176.      * @param int $value 
  177.      */
  178.     public function setSpId($value)
  179.     {
  180.         $this->_spId $value;
  181.     }
  182.  
  183.     /**
  184.      * Get the shape index
  185.      *
  186.      * @return int 
  187.      */
  188.     public function getSpId()
  189.     {
  190.         return $this->_spId;
  191.     }
  192.  
  193.     /**
  194.      * Set an option for the Shape Group Container
  195.      *
  196.      * @param int $property The number specifies the option
  197.      * @param mixed $value 
  198.      */
  199.     public function setOPT($property$value)
  200.     {
  201.         $this->_OPT[$property$value;
  202.     }
  203.  
  204.     /**
  205.      * Get an option for the Shape Group Container
  206.      *
  207.      * @param int $property The number specifies the option
  208.      * @return mixed 
  209.      */
  210.     public function getOPT($property)
  211.     {
  212.         if (isset($this->_OPT[$property])) {
  213.             return $this->_OPT[$property];
  214.         }
  215.         return null;
  216.     }
  217.  
  218.     /**
  219.      * Get the collection of options
  220.      *
  221.      * @return array 
  222.      */
  223.     public function getOPTCollection()
  224.     {
  225.         return $this->_OPT;
  226.     }
  227.  
  228.     /**
  229.      * Set cell coordinates of upper-left corner of shape
  230.      *
  231.      * @param string $value 
  232.      */
  233.     public function setStartCoordinates($value 'A1')
  234.     {
  235.         $this->_startCoordinates $value;
  236.     }
  237.  
  238.     /**
  239.      * Get cell coordinates of upper-left corner of shape
  240.      *
  241.      * @return string 
  242.      */
  243.     public function getStartCoordinates()
  244.     {
  245.         return $this->_startCoordinates;
  246.     }
  247.  
  248.     /**
  249.      * Set offset in x-direction of upper-left corner of shape measured in 1/1024 of column width
  250.      *
  251.      * @param int $startOffsetX 
  252.      */
  253.     public function setStartOffsetX($startOffsetX 0)
  254.     {
  255.         $this->_startOffsetX $startOffsetX;
  256.     }
  257.  
  258.     /**
  259.      * Get offset in x-direction of upper-left corner of shape measured in 1/1024 of column width
  260.      *
  261.      * @return int 
  262.      */
  263.     public function getStartOffsetX()
  264.     {
  265.         return $this->_startOffsetX;
  266.     }
  267.  
  268.     /**
  269.      * Set offset in y-direction of upper-left corner of shape measured in 1/256 of row height
  270.      *
  271.      * @param int $startOffsetY 
  272.      */
  273.     public function setStartOffsetY($startOffsetY 0)
  274.     {
  275.         $this->_startOffsetY $startOffsetY;
  276.     }
  277.  
  278.     /**
  279.      * Get offset in y-direction of upper-left corner of shape measured in 1/256 of row height
  280.      *
  281.      * @return int 
  282.      */
  283.     public function getStartOffsetY()
  284.     {
  285.         return $this->_startOffsetY;
  286.     }
  287.  
  288.     /**
  289.      * Set cell coordinates of bottom-right corner of shape
  290.      *
  291.      * @param string $value 
  292.      */
  293.     public function setEndCoordinates($value 'A1')
  294.     {
  295.         $this->_endCoordinates $value;
  296.     }
  297.  
  298.     /**
  299.      * Get cell coordinates of bottom-right corner of shape
  300.      *
  301.      * @return string 
  302.      */
  303.     public function getEndCoordinates()
  304.     {
  305.         return $this->_endCoordinates;
  306.     }
  307.  
  308.     /**
  309.      * Set offset in x-direction of bottom-right corner of shape measured in 1/1024 of column width
  310.      *
  311.      * @param int $startOffsetX 
  312.      */
  313.     public function setEndOffsetX($endOffsetX 0)
  314.     {
  315.         $this->_endOffsetX $endOffsetX;
  316.     }
  317.  
  318.     /**
  319.      * Get offset in x-direction of bottom-right corner of shape measured in 1/1024 of column width
  320.      *
  321.      * @return int 
  322.      */
  323.     public function getEndOffsetX()
  324.     {
  325.         return $this->_endOffsetX;
  326.     }
  327.  
  328.     /**
  329.      * Set offset in y-direction of bottom-right corner of shape measured in 1/256 of row height
  330.      *
  331.      * @param int $endOffsetY 
  332.      */
  333.     public function setEndOffsetY($endOffsetY 0)
  334.     {
  335.         $this->_endOffsetY $endOffsetY;
  336.     }
  337.  
  338.     /**
  339.      * Get offset in y-direction of bottom-right corner of shape measured in 1/256 of row height
  340.      *
  341.      * @return int 
  342.      */
  343.     public function getEndOffsetY()
  344.     {
  345.         return $this->_endOffsetY;
  346.     }
  347.  
  348.     /**
  349.      * Get the nesting level of this spContainer. This is the number of spgrContainers between this spContainer and
  350.      * the dgContainer. A value of 1 = immediately within first spgrContainer
  351.      * Higher nesting level occurs if and only if spContainer is part of a shape group
  352.      *
  353.      * @return int Nesting level
  354.      */
  355.     public function getNestingLevel()
  356.     {
  357.         $nestingLevel 0;
  358.  
  359.         $parent $this->getParent();
  360.         while ($parent instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer{
  361.             ++$nestingLevel;
  362.             $parent $parent->getParent();
  363.         }
  364.  
  365.         return $nestingLevel;
  366.     }
  367. }

Documentation generated on Sun, 27 Feb 2011 16:33:55 -0800 by phpDocumentor 1.4.3