~ubuntu-branches/ubuntu/lucid/phpmyadmin/lucid

« back to all changes in this revision

Viewing changes to libraries/PHPExcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php

  • Committer: Bazaar Package Importer
  • Author(s): Michal Čihař
  • Date: 2010-03-08 15:25:00 UTC
  • mfrom: (1.2.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100308152500-6e8hmuqc5co39de5
Tags: 4:3.3.0-1
* New upstream version.
* Rediff debian/patches.
* Fix permissions on mediawiki export extension.

Show diffs side-by-side

added added

removed removed

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