Source for file Alignment.php
Documentation is available at Alignment.php
* Copyright (c) 2009 - 2010 PHPPowerPoint
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* @category PHPPowerPoint
* @package PHPPowerPoint_Style
* @copyright Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version 0.1.0, 2009-04-27
/** PHPPowerPoint_IComparable */
require_once 'PHPPowerPoint/IComparable.php';
* PHPPowerPoint_Style_Alignment
* @category PHPPowerPoint
* @package PHPPowerPoint_Style
* @copyright Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
/* Horizontal alignment styles */
const HORIZONTAL_LEFT = 'l';
const HORIZONTAL_RIGHT = 'r';
const HORIZONTAL_CENTER = 'ctr';
const HORIZONTAL_JUSTIFY = 'just';
const HORIZONTAL_DISTRIBUTED = 'dist';
/* Vertical alignment styles */
const VERTICAL_BASE = 'base';
const VERTICAL_AUTO = 'auto';
const VERTICAL_BOTTOM = 'b';
const VERTICAL_TOP = 't';
const VERTICAL_CENTER = 'ctr';
* Indent - only possible with horizontal alignment left and right
* Create a new PHPPowerPoint_Style_Alignment
public function setHorizontal($pValue = PHPPowerPoint_Style_Alignment::HORIZONTAL_LEF) {
public function setVertical($pValue = PHPPowerPoint_Style_Alignment::VERTICAL_BASE) {
* @param int $pValue Ranging 0 - 8
if ($pValue < 0 || $pValue > 8) {
throw new Exception("Invalid value: shoul be range 0 - 8.");
$pValue = 0; // indent not supported
* @return string Hash code
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
* @return string Hash index
* Note that this index may vary during script execution! Only reliable moment is
* while doing a write of a workbook and when changes are not allowed.
* @param string $value Hash index
* Implement PHP __clone to create a deep clone, not just a shallow copy.
foreach ($vars as $key => $value) {
$this->$key = clone $value;
|