source: sourcecode/application/libraries/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php @ 1

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