ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
PHPExcel_Worksheet_HeaderFooterDrawing Class Reference
+ Inheritance diagram for PHPExcel_Worksheet_HeaderFooterDrawing:
+ Collaboration diagram for PHPExcel_Worksheet_HeaderFooterDrawing:

Public Member Functions

 __construct ()
 Create a new PHPExcel_Worksheet_HeaderFooterDrawing. More...
 
 getName ()
 Get Name. More...
 
 setName ($pValue='')
 Set Name. More...
 
 getOffsetX ()
 Get OffsetX. More...
 
 setOffsetX ($pValue=0)
 Set OffsetX. More...
 
 getOffsetY ()
 Get OffsetY. More...
 
 setOffsetY ($pValue=0)
 Set OffsetY. More...
 
 getWidth ()
 Get Width. More...
 
 setWidth ($pValue=0)
 Set Width. More...
 
 getHeight ()
 Get Height. More...
 
 setHeight ($pValue=0)
 Set Height. More...
 
 setWidthAndHeight ($width=0, $height=0)
 Set width and height with proportional resize Example: $objDrawing->setResizeProportional(true); $objDrawing->setWidthAndHeight(160,120); More...
 
 getResizeProportional ()
 Get ResizeProportional. More...
 
 setResizeProportional ($pValue=true)
 Set ResizeProportional. More...
 
 getFilename ()
 Get Filename. More...
 
 getExtension ()
 Get Extension. More...
 
 getPath ()
 Get Path. More...
 
 setPath ($pValue='', $pVerifyFile=true)
 Set Path. More...
 
 getHashCode ()
 Get hash code. More...
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy. More...
 
- Public Member Functions inherited from PHPExcel_Worksheet_Drawing
 __construct ()
 Create a new PHPExcel_Worksheet_Drawing. More...
 
 getFilename ()
 Get Filename. More...
 
 getIndexedFilename ()
 Get indexed filename (using image index) More...
 
 getExtension ()
 Get Extension. More...
 
 getPath ()
 Get Path. More...
 
 setPath ($pValue='', $pVerifyFile=true)
 Set Path. More...
 
 getHashCode ()
 Get hash code. More...
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy. More...
 
- Public Member Functions inherited from PHPExcel_Worksheet_BaseDrawing
 __construct ()
 Create a new PHPExcel_Worksheet_BaseDrawing. More...
 
 getImageIndex ()
 Get image index. More...
 
 getName ()
 Get Name. More...
 
 setName ($pValue='')
 Set Name. More...
 
 getDescription ()
 Get Description. More...
 
 setDescription ($pValue='')
 Set Description. More...
 
 getWorksheet ()
 Get Worksheet. More...
 
 setWorksheet (PHPExcel_Worksheet $pValue=null, $pOverrideOld=false)
 Set Worksheet. More...
 
 getCoordinates ()
 Get Coordinates. More...
 
 setCoordinates ($pValue='A1')
 Set Coordinates. More...
 
 getOffsetX ()
 Get OffsetX. More...
 
 setOffsetX ($pValue=0)
 Set OffsetX. More...
 
 getOffsetY ()
 Get OffsetY. More...
 
 setOffsetY ($pValue=0)
 Set OffsetY. More...
 
 getWidth ()
 Get Width. More...
 
 setWidth ($pValue=0)
 Set Width. More...
 
 getHeight ()
 Get Height. More...
 
 setHeight ($pValue=0)
 Set Height. More...
 
 setWidthAndHeight ($width=0, $height=0)
 Set width and height with proportional resize Example: $objDrawing->setResizeProportional(true); $objDrawing->setWidthAndHeight(160,120); More...
 
 getResizeProportional ()
 Get ResizeProportional. More...
 
 setResizeProportional ($pValue=true)
 Set ResizeProportional. More...
 
 getRotation ()
 Get Rotation. More...
 
 setRotation ($pValue=0)
 Set Rotation. More...
 
 getShadow ()
 Get Shadow. More...
 
 setShadow (PHPExcel_Worksheet_Drawing_Shadow $pValue=null)
 Set Shadow. More...
 
 getHashCode ()
 Get hash code. More...
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy. More...
 
 getHashCode ()
 Get hash code. More...
 

Protected Attributes

 $_name
 
 $_offsetX
 
 $_offsetY
 
 $_width
 
 $_height
 
 $_resizeProportional
 
- Protected Attributes inherited from PHPExcel_Worksheet_BaseDrawing
 $_name
 
 $_description
 
 $_worksheet
 
 $_coordinates
 
 $_offsetX
 
 $_offsetY
 
 $_width
 
 $_height
 
 $_resizeProportional
 
 $_rotation
 
 $_shadow
 

Private Attributes

 $_path
 

Detailed Description

Definition at line 36 of file HeaderFooterDrawing.php.

Constructor & Destructor Documentation

◆ __construct()

PHPExcel_Worksheet_HeaderFooterDrawing::__construct ( )

Create a new PHPExcel_Worksheet_HeaderFooterDrawing.

Reimplemented from PHPExcel_Worksheet_Drawing.

Definition at line 90 of file HeaderFooterDrawing.php.

91 {
92 // Initialise values
93 $this->_path = '';
94 $this->_name = '';
95 $this->_offsetX = 0;
96 $this->_offsetY = 0;
97 $this->_width = 0;
98 $this->_height = 0;
99 $this->_resizeProportional = true;
100 }

Member Function Documentation

◆ __clone()

PHPExcel_Worksheet_HeaderFooterDrawing::__clone ( )

Implement PHP __clone to create a deep clone, not just a shallow copy.

Reimplemented from PHPExcel_Worksheet_Drawing.

Definition at line 340 of file HeaderFooterDrawing.php.

340 {
341 $vars = get_object_vars($this);
342 foreach ($vars as $key => $value) {
343 if (is_object($value)) {
344 $this->$key = clone $value;
345 } else {
346 $this->$key = $value;
347 }
348 }
349 }
$key
Definition: croninfo.php:18

References $key.

◆ getExtension()

PHPExcel_Worksheet_HeaderFooterDrawing::getExtension ( )

Get Extension.

Returns
string

Reimplemented from PHPExcel_Worksheet_Drawing.

Definition at line 280 of file HeaderFooterDrawing.php.

280 {
281 $parts = explode(".", basename($this->_path));
282 return end($parts);
283 }

◆ getFilename()

PHPExcel_Worksheet_HeaderFooterDrawing::getFilename ( )

Get Filename.

Returns
string

Reimplemented from PHPExcel_Worksheet_Drawing.

Definition at line 271 of file HeaderFooterDrawing.php.

271 {
272 return basename($this->_path);
273 }

◆ getHashCode()

PHPExcel_Worksheet_HeaderFooterDrawing::getHashCode ( )

Get hash code.

Returns
string Hash code

Implements PHPExcel_IComparable.

Definition at line 325 of file HeaderFooterDrawing.php.

325 {
326 return md5(
327 $this->_path
328 . $this->_name
329 . $this->_offsetX
330 . $this->_offsetY
331 . $this->_width
332 . $this->_height
333 . __CLASS__
334 );
335 }

◆ getHeight()

PHPExcel_Worksheet_HeaderFooterDrawing::getHeight ( )

Get Height.

Returns
int

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 195 of file HeaderFooterDrawing.php.

References $_height.

◆ getName()

PHPExcel_Worksheet_HeaderFooterDrawing::getName ( )

Get Name.

Returns
string

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 107 of file HeaderFooterDrawing.php.

References $_name.

◆ getOffsetX()

PHPExcel_Worksheet_HeaderFooterDrawing::getOffsetX ( )

Get OffsetX.

Returns
int

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 127 of file HeaderFooterDrawing.php.

References $_offsetX.

◆ getOffsetY()

PHPExcel_Worksheet_HeaderFooterDrawing::getOffsetY ( )

Get OffsetY.

Returns
int

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 147 of file HeaderFooterDrawing.php.

References $_offsetY.

◆ getPath()

PHPExcel_Worksheet_HeaderFooterDrawing::getPath ( )

Get Path.

Returns
string

Reimplemented from PHPExcel_Worksheet_Drawing.

Definition at line 290 of file HeaderFooterDrawing.php.

References $_path.

◆ getResizeProportional()

PHPExcel_Worksheet_HeaderFooterDrawing::getResizeProportional ( )

Get ResizeProportional.

Returns
boolean

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 251 of file HeaderFooterDrawing.php.

References $_resizeProportional.

◆ getWidth()

PHPExcel_Worksheet_HeaderFooterDrawing::getWidth ( )

Get Width.

Returns
int

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 167 of file HeaderFooterDrawing.php.

References $_width.

◆ setHeight()

PHPExcel_Worksheet_HeaderFooterDrawing::setHeight (   $pValue = 0)

Set Height.

Parameters
int$pValue
Returns
PHPExcel_Worksheet_HeaderFooterDrawing

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 205 of file HeaderFooterDrawing.php.

205 {
206 // Resize proportional?
207 if ($this->_resizeProportional && $pValue != 0) {
208 $ratio = $this->_width / $this->_height;
209 $this->_width = round($ratio * $pValue);
210 }
211
212 // Set height
213 $this->_height = $pValue;
214
215 return $this;
216 }

References $_height.

◆ setName()

PHPExcel_Worksheet_HeaderFooterDrawing::setName (   $pValue = '')

Set Name.

Parameters
string$pValue
Returns
PHPExcel_Worksheet_HeaderFooterDrawing

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 117 of file HeaderFooterDrawing.php.

117 {
118 $this->_name = $pValue;
119 return $this;
120 }

◆ setOffsetX()

PHPExcel_Worksheet_HeaderFooterDrawing::setOffsetX (   $pValue = 0)

Set OffsetX.

Parameters
int$pValue
Returns
PHPExcel_Worksheet_HeaderFooterDrawing

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 137 of file HeaderFooterDrawing.php.

137 {
138 $this->_offsetX = $pValue;
139 return $this;
140 }

◆ setOffsetY()

PHPExcel_Worksheet_HeaderFooterDrawing::setOffsetY (   $pValue = 0)

Set OffsetY.

Parameters
int$pValue
Returns
PHPExcel_Worksheet_HeaderFooterDrawing

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 157 of file HeaderFooterDrawing.php.

157 {
158 $this->_offsetY = $pValue;
159 return $this;
160 }

◆ setPath()

PHPExcel_Worksheet_HeaderFooterDrawing::setPath (   $pValue = '',
  $pVerifyFile = true 
)

Set Path.

Parameters
string$pValueFile path
boolean$pVerifyFileVerify file
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Worksheet_HeaderFooterDrawing

Reimplemented from PHPExcel_Worksheet_Drawing.

Definition at line 302 of file HeaderFooterDrawing.php.

302 {
303 if ($pVerifyFile) {
304 if (file_exists($pValue)) {
305 $this->_path = $pValue;
306
307 if ($this->_width == 0 && $this->_height == 0) {
308 // Get width/height
309 list($this->_width, $this->_height) = getimagesize($pValue);
310 }
311 } else {
312 throw new PHPExcel_Exception("File $pValue not found!");
313 }
314 } else {
315 $this->_path = $pValue;
316 }
317 return $this;
318 }

◆ setResizeProportional()

PHPExcel_Worksheet_HeaderFooterDrawing::setResizeProportional (   $pValue = true)

Set ResizeProportional.

Parameters
boolean$pValue
Returns
PHPExcel_Worksheet_HeaderFooterDrawing

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 261 of file HeaderFooterDrawing.php.

261 {
262 $this->_resizeProportional = $pValue;
263 return $this;
264 }

◆ setWidth()

PHPExcel_Worksheet_HeaderFooterDrawing::setWidth (   $pValue = 0)

Set Width.

Parameters
int$pValue
Returns
PHPExcel_Worksheet_HeaderFooterDrawing

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 177 of file HeaderFooterDrawing.php.

177 {
178 // Resize proportional?
179 if ($this->_resizeProportional && $pValue != 0) {
180 $ratio = $this->_width / $this->_height;
181 $this->_height = round($ratio * $pValue);
182 }
183
184 // Set width
185 $this->_width = $pValue;
186
187 return $this;
188 }

References $_height.

◆ setWidthAndHeight()

PHPExcel_Worksheet_HeaderFooterDrawing::setWidthAndHeight (   $width = 0,
  $height = 0 
)

Set width and height with proportional resize Example: $objDrawing->setResizeProportional(true); $objDrawing->setWidthAndHeight(160,120);

Author
Vincent@luo MSN:kele_.nosp@m.100@.nosp@m.hotma.nosp@m.il.c.nosp@m.om
Parameters
int$width
int$height
Returns
PHPExcel_Worksheet_HeaderFooterDrawing

Reimplemented from PHPExcel_Worksheet_BaseDrawing.

Definition at line 231 of file HeaderFooterDrawing.php.

231 {
232 $xratio = $width / $this->_width;
233 $yratio = $height / $this->_height;
234 if ($this->_resizeProportional && !($width == 0 || $height == 0)) {
235 if (($xratio * $this->_height) < $height) {
236 $this->_height = ceil($xratio * $this->_height);
237 $this->_width = $width;
238 } else {
239 $this->_width = ceil($yratio * $this->_width);
240 $this->_height = $height;
241 }
242 }
243 return $this;
244 }

References $_height, and $_width.

Field Documentation

◆ $_height

PHPExcel_Worksheet_HeaderFooterDrawing::$_height
protected

Definition at line 78 of file HeaderFooterDrawing.php.

Referenced by getHeight(), setHeight(), setWidth(), and setWidthAndHeight().

◆ $_name

PHPExcel_Worksheet_HeaderFooterDrawing::$_name
protected

Definition at line 50 of file HeaderFooterDrawing.php.

Referenced by getName().

◆ $_offsetX

PHPExcel_Worksheet_HeaderFooterDrawing::$_offsetX
protected

Definition at line 57 of file HeaderFooterDrawing.php.

Referenced by getOffsetX().

◆ $_offsetY

PHPExcel_Worksheet_HeaderFooterDrawing::$_offsetY
protected

Definition at line 64 of file HeaderFooterDrawing.php.

Referenced by getOffsetY().

◆ $_path

PHPExcel_Worksheet_HeaderFooterDrawing::$_path
private

Definition at line 43 of file HeaderFooterDrawing.php.

Referenced by getPath().

◆ $_resizeProportional

PHPExcel_Worksheet_HeaderFooterDrawing::$_resizeProportional
protected

Definition at line 85 of file HeaderFooterDrawing.php.

Referenced by getResizeProportional().

◆ $_width

PHPExcel_Worksheet_HeaderFooterDrawing::$_width
protected

Definition at line 71 of file HeaderFooterDrawing.php.

Referenced by getWidth(), and setWidthAndHeight().


The documentation for this class was generated from the following file: