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
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##
30 * PHPExcel_Worksheet_Drawing_Shadow
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';
74 * Shadow direction (in degrees)
90 * @var PHPExcel_Style_Color
102 * Create a new PHPExcel_Worksheet_Drawing_Shadow
104 public function __construct()
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
);
121 public function getVisible() {
122 return $this->_visible
;
128 * @param boolean $pValue
129 * @return PHPExcel_Worksheet_Drawing_Shadow
131 public function setVisible($pValue = false) {
132 $this->_visible
= $pValue;
141 public function getBlurRadius() {
142 return $this->_blurRadius
;
149 * @return PHPExcel_Worksheet_Drawing_Shadow
151 public function setBlurRadius($pValue = 6) {
152 $this->_blurRadius
= $pValue;
157 * Get Shadow distance
161 public function getDistance() {
162 return $this->_distance
;
166 * Set Shadow distance
169 * @return PHPExcel_Worksheet_Drawing_Shadow
171 public function setDistance($pValue = 2) {
172 $this->_distance
= $pValue;
177 * Get Shadow direction (in degrees)
181 public function getDirection() {
182 return $this->_direction
;
186 * Set Shadow direction (in degrees)
189 * @return PHPExcel_Worksheet_Drawing_Shadow
191 public function setDirection($pValue = 0) {
192 $this->_direction
= $pValue;
197 * Get Shadow alignment
201 public function getAlignment() {
202 return $this->_alignment
;
206 * Set Shadow alignment
209 * @return PHPExcel_Worksheet_Drawing_Shadow
211 public function setAlignment($pValue = 0) {
212 $this->_alignment
= $pValue;
219 * @return PHPExcel_Style_Color
221 public function getColor() {
222 return $this->_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;
242 public function getAlpha() {
243 return $this->_alpha
;
250 * @return PHPExcel_Worksheet_Drawing_Shadow
252 public function setAlpha($pValue = 0) {
253 $this->_alpha
= $pValue;
260 * @return string Hash code
262 public function getHashCode() {
264 ($this->_visible ?
't' : 'f')
269 . $this->_color
->getHashCode()
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;
284 $this->$key = $value;