5
* Copyright (c) 2006 - 2009 PHPExcel
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.
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.
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
22
* @package PHPExcel_Shared_Escher
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.7, 2009-04-22
29
* PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
32
* @package PHPExcel_Shared_Escher
33
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
35
class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
38
* Parent Shape Group Container
40
* @var PHPExcel_Shared_Escher_DgContainer_SpgrContainer
45
* Is this a group shape?
49
private $_spgr = false;
59
* Shape index (usually group shape has index 0, and the rest: 1,2,3...)
73
* Cell coordinates of upper-left corner of shape, e.g. 'A1'
77
private $_startCoordinates;
80
* Horizontal offset of upper-left corner of shape measured in 1/1024 of column width
84
private $_startOffsetX;
87
* Vertical offset of upper-left corner of shape measured in 1/256 of row height
91
private $_startOffsetY;
94
* Cell coordinates of bottom-right corner of shape, e.g. 'B2'
98
private $_endCoordinates;
101
* Horizontal offset of bottom-right corner of shape measured in 1/1024 of column width
105
private $_endOffsetX;
108
* Vertical offset of bottom-right corner of shape measured in 1/256 of row height
112
private $_endOffsetY;
115
* Set parent Shape Group Container
117
* @param PHPExcel_Shared_Escher_DgContainer_SpgrContainer $parent
119
public function setParent($parent)
121
$this->_parent = $parent;
125
* Get the parent Shape Group Container
127
* @return PHPExcel_Shared_Escher_DgContainer_SpgrContainer
129
public function getParent()
131
return $this->_parent;
135
* Set whether this is a group shape
137
* @param boolean $value
139
public function setSpgr($value = false)
141
$this->_spgr = $value;
145
* Get whether this is a group shape
149
public function getSpgr()
159
public function setSpType($value)
161
$this->_spType = $value;
169
public function getSpType()
171
return $this->_spType;
175
* Set the shape index
179
public function setSpId($value)
181
$this->_spId = $value;
185
* Get the shape index
189
public function getSpId()
195
* Set an option for the Shape Group Container
197
* @param int $property The number specifies the option
198
* @param mixed $value
200
public function setOPT($property, $value)
202
$this->_OPT[$property] = $value;
206
* Get an option for the Shape Group Container
208
* @param int $property The number specifies the option
211
public function getOPT($property)
213
if (isset($this->_OPT[$property])) {
214
return $this->_OPT[$property];
220
* Get the collection of options
224
public function getOPTCollection()
230
* Set cell coordinates of upper-left corner of shape
232
* @param string $value
234
public function setStartCoordinates($value = 'A1')
236
$this->_startCoordinates = $value;
240
* Get cell coordinates of upper-left corner of shape
244
public function getStartCoordinates()
246
return $this->_startCoordinates;
250
* Set offset in x-direction of upper-left corner of shape measured in 1/1024 of column width
252
* @param int $startOffsetX
254
public function setStartOffsetX($startOffsetX = 0)
256
$this->_startOffsetX = $startOffsetX;
260
* Get offset in x-direction of upper-left corner of shape measured in 1/1024 of column width
264
public function getStartOffsetX()
266
return $this->_startOffsetX;
270
* Set offset in y-direction of upper-left corner of shape measured in 1/256 of row height
272
* @param int $startOffsetY
274
public function setStartOffsetY($startOffsetY = 0)
276
$this->_startOffsetY = $startOffsetY;
280
* Get offset in y-direction of upper-left corner of shape measured in 1/256 of row height
284
public function getStartOffsetY()
286
return $this->_startOffsetY;
290
* Set cell coordinates of bottom-right corner of shape
292
* @param string $value
294
public function setEndCoordinates($value = 'A1')
296
$this->_endCoordinates = $value;
300
* Get cell coordinates of bottom-right corner of shape
304
public function getEndCoordinates()
306
return $this->_endCoordinates;
310
* Set offset in x-direction of bottom-right corner of shape measured in 1/1024 of column width
312
* @param int $startOffsetX
314
public function setEndOffsetX($endOffsetX = 0)
316
$this->_endOffsetX = $endOffsetX;
320
* Get offset in x-direction of bottom-right corner of shape measured in 1/1024 of column width
324
public function getEndOffsetX()
326
return $this->_endOffsetX;
330
* Set offset in y-direction of bottom-right corner of shape measured in 1/256 of row height
332
* @param int $endOffsetY
334
public function setEndOffsetY($endOffsetY = 0)
336
$this->_endOffsetY = $endOffsetY;
340
* Get offset in y-direction of bottom-right corner of shape measured in 1/256 of row height
344
public function getEndOffsetY()
346
return $this->_endOffsetY;
350
* Get the nesting level of this spContainer. This is the number of spgrContainers between this spContainer and
351
* the dgContainer. A value of 1 = immediately within first spgrContainer
352
* Higher nesting level occurs if and only if spContainer is part of a shape group
354
* @return int Nesting level
356
public function getNestingLevel()
360
$parent = $this->getParent();
361
while ($parent instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) {
363
$parent = $parent->getParent();
366
return $nestingLevel;