123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515 |
- <?php
- /**
- * PHPWord
- *
- * Copyright (c) 2011 PHPWord
- *
- * 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 PHPWord
- * @package PHPWord
- * @copyright Copyright (c) 010 PHPWord
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version Beta 0.6.3, 08.07.2011
- */
- /**
- * PHPWord_Section_Settings
- *
- * @category PHPWord
- * @package PHPWord_Section
- * @copyright Copyright (c) 2011 PHPWord
- */
- class PHPWord_Section_Settings {
-
- /**
- * Default Page Size Width
- *
- * @var int
- */
- private $_defaultPageSizeW = 11906;
-
- /**
- * Default Page Size Height
- *
- * @var int
- */
- private $_defaultPageSizeH = 16838;
-
- /**
- * Page Orientation
- *
- * @var string
- */
- private $_orientation;
-
- /**
- * Page Margin Top
- *
- * @var int
- */
- private $_marginTop;
-
- /**
- * Page Margin Left
- *
- * @var int
- */
- private $_marginLeft;
-
- /**
- * Page Margin Right
- *
- * @var int
- */
- private $_marginRight;
-
- /**
- * Page Margin Bottom
- *
- * @var int
- */
- private $_marginBottom;
-
- /**
- * Page Size Width
- *
- * @var int
- */
- private $_pageSizeW;
-
- /**
- * Page Size Height
- *
- * @var int
- */
- private $_pageSizeH;
- /**
- * Page Border Top Size
- *
- * @var int
- */
- private $_borderTopSize;
- /**
- * Page Border Top Color
- *
- * @var int
- */
- private $_borderTopColor;
- /**
- * Page Border Left Size
- *
- * @var int
- */
- private $_borderLeftSize;
- /**
- * Page Border Left Color
- *
- * @var int
- */
- private $_borderLeftColor;
- /**
- * Page Border Right Size
- *
- * @var int
- */
- private $_borderRightSize;
- /**
- * Page Border Right Color
- *
- * @var int
- */
- private $_borderRightColor;
- /**
- * Page Border Bottom Size
- *
- * @var int
- */
- private $_borderBottomSize;
- /**
- * Page Border Bottom Color
- *
- * @var int
- */
- private $_borderBottomColor;
-
- /**
- * Create new Section Settings
- */
- public function __construct() {
- $this->_orientation = null;
- $this->_marginTop = 1418;
- $this->_marginLeft = 1418;
- $this->_marginRight = 1418;
- $this->_marginBottom = 1134;
- $this->_pageSizeW = $this->_defaultPageSizeW;
- $this->_pageSizeH = $this->_defaultPageSizeH;
- $this->_borderTopSize = null;
- $this->_borderTopColor = null;
- $this->_borderLeftSize = null;
- $this->_borderLeftColor = null;
- $this->_borderRightSize = null;
- $this->_borderRightColor = null;
- $this->_borderBottomSize = null;
- $this->_borderBottomColor = null;
- }
-
- /**
- * Set Setting Value
- *
- * @param string $key
- * @param string $value
- */
- public function setSettingValue($key, $value) {
- if($key == '_orientation' && $value == 'landscape') {
- $this->setLandscape();
- } elseif($key == '_orientation' && is_null($value)) {
- $this->setPortrait();
- } elseif($key == '_borderSize') {
- $this->setBorderSize($value);
- } elseif($key == '_borderColor') {
- $this->setBorderColor($value);
- } else {
- $this->$key = $value;
- }
- }
-
- /**
- * Get Margin Top
- *
- * @return int
- */
- public function getMarginTop() {
- return $this->_marginTop;
- }
- /**
- * Set Margin Top
- *
- * @param int $pValue
- */
- public function setMarginTop($pValue = '') {
- $this->_marginTop = $pValue;
- return $this;
- }
- /**
- * Get Margin Left
- *
- * @return int
- */
- public function getMarginLeft() {
- return $this->_marginLeft;
- }
- /**
- * Set Margin Left
- *
- * @param int $pValue
- */
- public function setMarginLeft($pValue = '') {
- $this->_marginLeft = $pValue;
- return $this;
- }
- /**
- * Get Margin Right
- *
- * @return int
- */
- public function getMarginRight() {
- return $this->_marginRight;
- }
- /**
- * Set Margin Right
- *
- * @param int $pValue
- */
- public function setMarginRight($pValue = '') {
- $this->_marginRight = $pValue;
- return $this;
- }
- /**
- * Get Margin Bottom
- *
- * @return int
- */
- public function getMarginBottom() {
- return $this->_marginBottom;
- }
- /**
- * Set Margin Bottom
- *
- * @param int $pValue
- */
- public function setMarginBottom($pValue = '') {
- $this->_marginBottom = $pValue;
- return $this;
- }
-
- /**
- * Set Landscape Orientation
- */
- public function setLandscape() {
- $this->_orientation = 'landscape';
- $this->_pageSizeW = $this->_defaultPageSizeH;
- $this->_pageSizeH = $this->_defaultPageSizeW;
- }
-
- /**
- * Set Portrait Orientation
- */
- public function setPortrait() {
- $this->_orientation = null;
- $this->_pageSizeW = $this->_defaultPageSizeW;
- $this->_pageSizeH = $this->_defaultPageSizeH;
- }
-
- /**
- * Get Page Size Width
- *
- * @return int
- */
- public function getPageSizeW() {
- return $this->_pageSizeW;
- }
-
- /**
- * Get Page Size Height
- *
- * @return int
- */
- public function getPageSizeH() {
- return $this->_pageSizeH;
- }
-
- /**
- * Get Page Orientation
- *
- * @return string
- */
- public function getOrientation() {
- return $this->_orientation;
- }
-
- /**
- * Set Border Size
- *
- * @param int $pValue
- */
- public function setBorderSize($pValue = null) {
- $this->_borderTopSize = $pValue;
- $this->_borderLeftSize = $pValue;
- $this->_borderRightSize = $pValue;
- $this->_borderBottomSize = $pValue;
- }
-
- /**
- * Get Border Size
- *
- * @return array
- */
- public function getBorderSize() {
- $t = $this->getBorderTopSize();
- $l = $this->getBorderLeftSize();
- $r = $this->getBorderRightSize();
- $b = $this->getBorderBottomSize();
-
- return array($t, $l, $r, $b);
- }
-
- /**
- * Set Border Color
- *
- * @param string $pValue
- */
- public function setBorderColor($pValue = null) {
- $this->_borderTopColor = $pValue;
- $this->_borderLeftColor = $pValue;
- $this->_borderRightColor = $pValue;
- $this->_borderBottomColor = $pValue;
- }
-
- /**
- * Get Border Color
- *
- * @return array
- */
- public function getBorderColor() {
- $t = $this->getBorderTopColor();
- $l = $this->getBorderLeftColor();
- $r = $this->getBorderRightColor();
- $b = $this->getBorderBottomColor();
-
- return array($t, $l, $r, $b);
- }
-
- /**
- * Set Border Top Size
- *
- * @param int $pValue
- */
- public function setBorderTopSize($pValue = null) {
- $this->_borderTopSize = $pValue;
- }
-
- /**
- * Get Border Top Size
- *
- * @return int
- */
- public function getBorderTopSize() {
- return $this->_borderTopSize;
- }
-
- /**
- * Set Border Top Color
- *
- * @param string $pValue
- */
- public function setBorderTopColor($pValue = null) {
- $this->_borderTopColor = $pValue;
- }
-
- /**
- * Get Border Top Color
- *
- * @return string
- */
- public function getBorderTopColor() {
- return $this->_borderTopColor;
- }
-
- /**
- * Set Border Left Size
- *
- * @param int $pValue
- */
- public function setBorderLeftSize($pValue = null) {
- $this->_borderLeftSize = $pValue;
- }
-
- /**
- * Get Border Left Size
- *
- * @return int
- */
- public function getBorderLeftSize() {
- return $this->_borderLeftSize;
- }
-
- /**
- * Set Border Left Color
- *
- * @param string $pValue
- */
- public function setBorderLeftColor($pValue = null) {
- $this->_borderLeftColor = $pValue;
- }
-
- /**
- * Get Border Left Color
- *
- * @return string
- */
- public function getBorderLeftColor() {
- return $this->_borderLeftColor;
- }
-
- /**
- * Set Border Right Size
- *
- * @param int $pValue
- */
- public function setBorderRightSize($pValue = null) {
- $this->_borderRightSize = $pValue;
- }
-
- /**
- * Get Border Right Size
- *
- * @return int
- */
- public function getBorderRightSize() {
- return $this->_borderRightSize;
- }
-
- /**
- * Set Border Right Color
- *
- * @param string $pValue
- */
- public function setBorderRightColor($pValue = null) {
- $this->_borderRightColor = $pValue;
- }
-
- /**
- * Get Border Right Color
- *
- * @return string
- */
- public function getBorderRightColor() {
- return $this->_borderRightColor;
- }
-
- /**
- * Set Border Bottom Size
- *
- * @param int $pValue
- */
- public function setBorderBottomSize($pValue = null) {
- $this->_borderBottomSize = $pValue;
- }
-
- /**
- * Get Border Bottom Size
- *
- * @return int
- */
- public function getBorderBottomSize() {
- return $this->_borderBottomSize;
- }
-
- /**
- * Set Border Bottom Color
- *
- * @param string $pValue
- */
- public function setBorderBottomColor($pValue = null) {
- $this->_borderBottomColor = $pValue;
- }
-
- /**
- * Get Border Bottom Color
- *
- * @return string
- */
- public function getBorderBottomColor() {
- return $this->_borderBottomColor;
- }
- }
- ?>
|