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

« back to all changes in this revision

Viewing changes to libraries/PHPExcel/PHPExcel/Worksheet/RowDimension.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_Worksheet
 
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.7.0, 2009-08-10
 
26
 */
 
27
 
 
28
 
 
29
/**
 
30
 * PHPExcel_Worksheet_RowDimension
 
31
 *
 
32
 * @category   PHPExcel
 
33
 * @package    PHPExcel_Worksheet
 
34
 * @copyright  Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
 
35
 */
 
36
class PHPExcel_Worksheet_RowDimension
 
37
{                       
 
38
        /**
 
39
         * Row index
 
40
         *
 
41
         * @var int
 
42
         */
 
43
        private $_rowIndex;
 
44
        
 
45
        /**
 
46
         * Row height (in pt)
 
47
         *
 
48
         * When this is set to a negative value, the row height should be ignored by IWriter
 
49
         *
 
50
         * @var double
 
51
         */
 
52
        private $_rowHeight;
 
53
        
 
54
        /**
 
55
         * Visible?
 
56
         *
 
57
         * @var bool
 
58
         */
 
59
        private $_visible;
 
60
        
 
61
        /**
 
62
         * Outline level
 
63
         *
 
64
         * @var int
 
65
         */
 
66
        private $_outlineLevel = 0;
 
67
        
 
68
        /**
 
69
         * Collapsed
 
70
         *
 
71
         * @var bool
 
72
         */
 
73
        private $_collapsed;
 
74
        
 
75
    /**
 
76
     * Create a new PHPExcel_Worksheet_RowDimension
 
77
     *
 
78
     * @param int $pIndex Numeric row index
 
79
     */
 
80
    public function __construct($pIndex = 0)
 
81
    {
 
82
        // Initialise values
 
83
        $this->_rowIndex                = $pIndex;
 
84
        $this->_rowHeight               = -1;
 
85
        $this->_visible                 = true;
 
86
        $this->_outlineLevel    = 0;
 
87
        $this->_collapsed               = false;
 
88
    }
 
89
    
 
90
    /**
 
91
     * Get Row Index
 
92
     *
 
93
     * @return int
 
94
     */
 
95
    public function getRowIndex() {
 
96
        return $this->_rowIndex;
 
97
    }
 
98
    
 
99
    /**
 
100
     * Set Row Index
 
101
     *
 
102
     * @param int $pValue
 
103
     * @return PHPExcel_Worksheet_RowDimension
 
104
     */
 
105
    public function setRowIndex($pValue) {
 
106
        $this->_rowIndex = $pValue;
 
107
        return $this;
 
108
    }
 
109
    
 
110
    /**
 
111
     * Get Row Height
 
112
     *
 
113
     * @return double
 
114
     */
 
115
    public function getRowHeight() {
 
116
        return $this->_rowHeight;
 
117
    }
 
118
    
 
119
    /**
 
120
     * Set Row Height
 
121
     *
 
122
     * @param double $pValue
 
123
     * @return PHPExcel_Worksheet_RowDimension
 
124
     */
 
125
    public function setRowHeight($pValue = -1) {
 
126
        $this->_rowHeight = $pValue;
 
127
        return $this;
 
128
    }
 
129
    
 
130
    /**
 
131
     * Get Visible
 
132
     *
 
133
     * @return bool
 
134
     */
 
135
    public function getVisible() {
 
136
        return $this->_visible;
 
137
    }
 
138
    
 
139
    /**
 
140
     * Set Visible
 
141
     *
 
142
     * @param bool $pValue
 
143
     * @return PHPExcel_Worksheet_RowDimension
 
144
     */
 
145
    public function setVisible($pValue = true) {
 
146
        $this->_visible = $pValue;
 
147
        return $this;
 
148
    }
 
149
    
 
150
    /**
 
151
     * Get Outline Level
 
152
     *
 
153
     * @return int
 
154
     */
 
155
    public function getOutlineLevel() {
 
156
        return $this->_outlineLevel;
 
157
    }
 
158
    
 
159
    /**
 
160
     * Set Outline Level
 
161
     *
 
162
     * Value must be between 0 and 7
 
163
     *
 
164
     * @param int $pValue
 
165
     * @throws Exception
 
166
     * @return PHPExcel_Worksheet_RowDimension
 
167
     */
 
168
    public function setOutlineLevel($pValue) {
 
169
        if ($pValue < 0 || $pValue > 7) {
 
170
                throw new Exception("Outline level must range between 0 and 7.");
 
171
        }
 
172
        
 
173
        $this->_outlineLevel = $pValue;
 
174
        return $this;
 
175
    }
 
176
    
 
177
    /**
 
178
     * Get Collapsed
 
179
     *
 
180
     * @return bool
 
181
     */
 
182
    public function getCollapsed() {
 
183
        return $this->_collapsed;
 
184
    }
 
185
    
 
186
    /**
 
187
     * Set Collapsed
 
188
     *
 
189
     * @param bool $pValue
 
190
     * @return PHPExcel_Worksheet_RowDimension
 
191
     */
 
192
    public function setCollapsed($pValue = true) {
 
193
        $this->_collapsed = $pValue;
 
194
        return $this;
 
195
    }
 
196
        
 
197
        /**
 
198
         * Implement PHP __clone to create a deep clone, not just a shallow copy.
 
199
         */
 
200
        public function __clone() {
 
201
                $vars = get_object_vars($this);
 
202
                foreach ($vars as $key => $value) {
 
203
                        if (is_object($value)) {
 
204
                                $this->$key = clone $value;
 
205
                        } else {
 
206
                                $this->$key = $value;
 
207
                        }
 
208
                }
 
209
        }
 
210
}