Updated gui for user facility settings (#1327)
[openemr.git] / vendor / phpoffice / phpexcel / Classes / PHPExcel / Worksheet / Drawing / Shadow.php
blob98b95b1a709045f8fdf2ddec6b58b317d7f68326
1 <?php
2 /**
3 * PHPExcel
5 * Copyright (c) 2006 - 2014 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
21 * @category PHPExcel
22 * @package PHPExcel_Worksheet_Drawing
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 ##VERSION##, ##DATE##
29 /**
30 * PHPExcel_Worksheet_Drawing_Shadow
32 * @category PHPExcel
33 * @package PHPExcel_Worksheet_Drawing
34 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
36 class PHPExcel_Worksheet_Drawing_Shadow implements PHPExcel_IComparable
38 /* Shadow alignment */
39 const SHADOW_BOTTOM = 'b';
40 const SHADOW_BOTTOM_LEFT = 'bl';
41 const SHADOW_BOTTOM_RIGHT = 'br';
42 const SHADOW_CENTER = 'ctr';
43 const SHADOW_LEFT = 'l';
44 const SHADOW_TOP = 't';
45 const SHADOW_TOP_LEFT = 'tl';
46 const SHADOW_TOP_RIGHT = 'tr';
48 /**
49 * Visible
51 * @var boolean
53 private $_visible;
55 /**
56 * Blur radius
58 * Defaults to 6
60 * @var int
62 private $_blurRadius;
64 /**
65 * Shadow distance
67 * Defaults to 2
69 * @var int
71 private $_distance;
73 /**
74 * Shadow direction (in degrees)
76 * @var int
78 private $_direction;
80 /**
81 * Shadow alignment
83 * @var int
85 private $_alignment;
87 /**
88 * Color
90 * @var PHPExcel_Style_Color
92 private $_color;
94 /**
95 * Alpha
97 * @var int
99 private $_alpha;
102 * Create a new PHPExcel_Worksheet_Drawing_Shadow
104 public function __construct()
106 // Initialise values
107 $this->_visible = false;
108 $this->_blurRadius = 6;
109 $this->_distance = 2;
110 $this->_direction = 0;
111 $this->_alignment = PHPExcel_Worksheet_Drawing_Shadow::SHADOW_BOTTOM_RIGHT;
112 $this->_color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK);
113 $this->_alpha = 50;
117 * Get Visible
119 * @return boolean
121 public function getVisible() {
122 return $this->_visible;
126 * Set Visible
128 * @param boolean $pValue
129 * @return PHPExcel_Worksheet_Drawing_Shadow
131 public function setVisible($pValue = false) {
132 $this->_visible = $pValue;
133 return $this;
137 * Get Blur radius
139 * @return int
141 public function getBlurRadius() {
142 return $this->_blurRadius;
146 * Set Blur radius
148 * @param int $pValue
149 * @return PHPExcel_Worksheet_Drawing_Shadow
151 public function setBlurRadius($pValue = 6) {
152 $this->_blurRadius = $pValue;
153 return $this;
157 * Get Shadow distance
159 * @return int
161 public function getDistance() {
162 return $this->_distance;
166 * Set Shadow distance
168 * @param int $pValue
169 * @return PHPExcel_Worksheet_Drawing_Shadow
171 public function setDistance($pValue = 2) {
172 $this->_distance = $pValue;
173 return $this;
177 * Get Shadow direction (in degrees)
179 * @return int
181 public function getDirection() {
182 return $this->_direction;
186 * Set Shadow direction (in degrees)
188 * @param int $pValue
189 * @return PHPExcel_Worksheet_Drawing_Shadow
191 public function setDirection($pValue = 0) {
192 $this->_direction = $pValue;
193 return $this;
197 * Get Shadow alignment
199 * @return int
201 public function getAlignment() {
202 return $this->_alignment;
206 * Set Shadow alignment
208 * @param int $pValue
209 * @return PHPExcel_Worksheet_Drawing_Shadow
211 public function setAlignment($pValue = 0) {
212 $this->_alignment = $pValue;
213 return $this;
217 * Get Color
219 * @return PHPExcel_Style_Color
221 public function getColor() {
222 return $this->_color;
226 * Set Color
228 * @param PHPExcel_Style_Color $pValue
229 * @throws PHPExcel_Exception
230 * @return PHPExcel_Worksheet_Drawing_Shadow
232 public function setColor(PHPExcel_Style_Color $pValue = null) {
233 $this->_color = $pValue;
234 return $this;
238 * Get Alpha
240 * @return int
242 public function getAlpha() {
243 return $this->_alpha;
247 * Set Alpha
249 * @param int $pValue
250 * @return PHPExcel_Worksheet_Drawing_Shadow
252 public function setAlpha($pValue = 0) {
253 $this->_alpha = $pValue;
254 return $this;
258 * Get hash code
260 * @return string Hash code
262 public function getHashCode() {
263 return md5(
264 ($this->_visible ? 't' : 'f')
265 . $this->_blurRadius
266 . $this->_distance
267 . $this->_direction
268 . $this->_alignment
269 . $this->_color->getHashCode()
270 . $this->_alpha
271 . __CLASS__
276 * Implement PHP __clone to create a deep clone, not just a shallow copy.
278 public function __clone() {
279 $vars = get_object_vars($this);
280 foreach ($vars as $key => $value) {
281 if (is_object($value)) {
282 $this->$key = clone $value;
283 } else {
284 $this->$key = $value;