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

« back to all changes in this revision

Viewing changes to libraries/PHPExcel/PHPExcel/Worksheet/SheetView.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_SheetView
 
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_SheetView
 
37
{
 
38
        /**
 
39
         * ZoomScale
 
40
         * 
 
41
         * Valid values range from 10 to 400.
 
42
         *
 
43
         * @var int
 
44
         */
 
45
        private $_zoomScale;
 
46
 
 
47
        /**
 
48
         * ZoomScaleNormal
 
49
         * 
 
50
         * Valid values range from 10 to 400.
 
51
         *
 
52
         * @var int
 
53
         */
 
54
        private $_zoomScaleNormal;
 
55
 
 
56
    /**
 
57
     * Create a new PHPExcel_Worksheet_SheetView
 
58
     */
 
59
    public function __construct()
 
60
    {
 
61
        // Initialise values
 
62
        $this->_zoomScale                               = 100;
 
63
        $this->_zoomScaleNormal                 = 100;
 
64
    }
 
65
 
 
66
        /**
 
67
         * Get ZoomScale
 
68
         *
 
69
         * @return int
 
70
         */
 
71
        public function getZoomScale() {
 
72
                return $this->_zoomScale;
 
73
        }
 
74
 
 
75
        /**
 
76
         * Set ZoomScale
 
77
         *
 
78
         * Valid values range from 10 to 400.
 
79
         *
 
80
         * @param       int     $pValue
 
81
         * @throws      Exception
 
82
         * @return PHPExcel_Worksheet_SheetView
 
83
         */
 
84
        public function setZoomScale($pValue = 100) {
 
85
                if (($pValue >= 10 && $pValue <= 400) || is_null($pValue)) {
 
86
                        $this->_zoomScale = $pValue;
 
87
                } else {
 
88
                        throw new Exception("Valid scale is between 10 and 400.");
 
89
                }
 
90
                return $this;
 
91
        }
 
92
        
 
93
        /**
 
94
         * Get ZoomScaleNormal
 
95
         *
 
96
         * @return int
 
97
         */
 
98
        public function getZoomScaleNormal() {
 
99
                return $this->_zoomScaleNormal;
 
100
        }
 
101
 
 
102
        /**
 
103
         * Set ZoomScale
 
104
         *
 
105
         * Valid values range from 10 to 400.
 
106
         *
 
107
         * @param       int     $pValue
 
108
         * @throws      Exception
 
109
         * @return PHPExcel_Worksheet_SheetView
 
110
         */
 
111
        public function setZoomScaleNormal($pValue = 100) {
 
112
                if (($pValue >= 10 && $pValue <= 400) || is_null($pValue)) {
 
113
                        $this->_zoomScaleNormal = $pValue;
 
114
                } else {
 
115
                        throw new Exception("Valid scale is between 10 and 400.");
 
116
                }
 
117
                return $this;
 
118
        }
 
119
 
 
120
        /**
 
121
         * Implement PHP __clone to create a deep clone, not just a shallow copy.
 
122
         */
 
123
        public function __clone() {
 
124
                $vars = get_object_vars($this);
 
125
                foreach ($vars as $key => $value) {
 
126
                        if (is_object($value)) {
 
127
                                $this->$key = clone $value;
 
128
                        } else {
 
129
                                $this->$key = $value;
 
130
                        }
 
131
                }
 
132
        }
 
133
}