PHPOffice/PHPWord — pull request #308 by kleves (2014-07-08 17:32:37+00:00)
Title: Develop

setStyleValue($key, $value);
}

/**
* Set orientation
*
* @param string $value
* @return self
*/
public function setOrientation($value = null)
{
$enum = array(self::ORIENTATION_PORTRAIT, self::ORIENTATION_LANDSCAPE);
$this->orientation = $this->setEnumVal($value, $enum, $this->orientation);

/** @var int|float $longSide Type hint */
$longSide = $this->pageSizeW >= $this->pageSizeH ? $this->pageSizeW : $this->pageSizeH;

/** @var int|float $shortSide Type hint */
$shortSide = $this->pageSizeW < $this->pageSizeH ? $this->pageSizeW : $this->pageSizeH;

if ($this->orientation == self::ORIENTATION_PORTRAIT) {
$this->pageSizeW = $shortSide;
$this->pageSizeH = $longSide;
} else {
$this->pageSizeW = $longSide;
$this->pageSizeH = $shortSide;
}

return $this;
}

/**
* Get Page Orientation
*
* @return string
*/
public function getOrientation()
{
return $this->orientation;
}

/**
* Set Portrait Orientation
*
* @return self
*/
public function setPortrait()
{
return $this->setOrientation(self::ORIENTATION_PORTRAIT);
}

/**
* Set Landscape Orientation
*
* @return self
*/
public function setLandscape()
{
return $this->setOrientation(self::ORIENTATION_LANDSCAPE);
}

/**
* Get Page Size Width
*
* @return int|float
*/
public function getPageSizeW()
{
return $this->pageSizeW;
}

/**
* Set Page Width
*
* @param int|float $value
* @return self
*/
public function setPageSizeW($value = null)
{
$this->pageSizeH = $this->setNumericVal($value, self::DEFAULT_MARGIN);
return $this;
}

/**
* Get Page Size Height
*
* @return int|float
*/
public function getPageSizeH()
{
return $this->pageSizeH;
}

/**
* Set Page Height
*
* @param int|float $value
* @return self
*/
public function setPageSizeH($value = null)
{
$this->pageSizeH = $this->setNumericVal($value, self::DEFAULT_MARGIN);
return $this;
}

/**
* Get Margin Top
*
* @return int|float
*/
public function getMarginTop()
{
return $this->marginTop;
}

/**
* Set Margin Top
*
* @param int|float $value
* @return self
*/
public function setMarginTop($value = null)
{
$this->marginTop = $this->setNumericVal($value, self::DEFAULT_MARGIN);

return $this;
}

/**
* Get Margin Left
*
* @return int|float
*/
public function getMarginLeft()
{
return $this->marginLeft;
}

/**
* Set Margin Left
*
* @param int|float $value
* @return self
*/
public function setMarginLeft($value = null)
{
$this->marginLeft = $this->setNumericVal($value, self::DEFAULT_MARGIN);

return $this;
}

/**
* Get Margin Right
*
* @return int|float
*/
public function getMarginRight()
{
return $this->marginRight;
}

/**
* Set Margin Right
*
* @param int|float $value
* @return self
*/
public function setMarginRight($value = null)
{
$this->marginRight = $this->setNumericVal($value, self::DEFAULT_MARGIN);

return $this;
}

/**
* Get Margin Bottom
*
* @return int|float
*/
public function getMarginBottom()
{
return $this->marginBottom;
}

/**
* Set Margin Bottom
*
* @param int|float $value
* @return self
*/
public function setMarginBottom($value = null)
{
$this->marginBottom = $this->setNumericVal($value, self::DEFAULT_MARGIN);

return $this;
}

/**
* Get gutter
*
* @return int|float
*/
public function getGutter()
{
return $this->gutter;
}

/**
* Set gutter
*
* @param int|float $value
* @return self
*/
public function setGutter($value = null)
{
$this->gutter = $this->setNumericVal($value, self::DEFAULT_GUTTER);

return $this;
}

/**
* Get Header Height
*
* @return int|float
*/
public function getHeaderHeight()
{
return $this->headerHeight;
}

/**
* Set Header Height
*
* @param int|float $value
* @return self
*/
public function setHeaderHeight($value = null)
{
$this->headerHeight = $this->setNumericVal($value, self::DEFAULT_HEADER_HEIGHT);

return $this;
}

/**
* Get Footer Height
*
* @return int|float
*/
public function getFooterHeight()
{
return $this->footerHeight;
}

/**
* Set Footer Height
*
* @param int|float $value
* @return self
*/
public function setFooterHeight($value = null)
{
$this->footerHeight = $this->setNumericVal($value, self::DEFAULT_FOOTER_HEIGHT);

return $this;
}

/**
* Get page numbering start
*
* @return null|int
*/
public function getPageNumberingStart()
{
return $this->pageNumberingStart;
}

/**
* Set page numbering start
*
* @param null|int $pageNumberingStart
* @return self
*/
public function setPageNumberingStart($pageNumberingStart = null)
{
$this->pageNumberingStart = $pageNumberingStart;
return $this;
}

/**
* Get Section Columns Count
*
* @return int
*/
public function getColsNum()
{
return $this->colsNum;
}

/**
* Set Section Columns Count
*
* @param int $value
* @return self
*/
public function setColsNum($value = null)
{
$this->colsNum = $this->setIntVal($value, self::DEFAULT_COLUMN_COUNT);

return $this;
}

/**
* Get Section Space Between Columns
*
* @return int|float
*/
public function getColsSpace()
{
return $this->colsSpace;
}

/**
* Set Section Space Between Columns
*
* @param int|float $value
* @return self
*/
public function setColsSpace($value = null)
{
$this->colsSpace = $this->setNumericVal($value, self::DEFAULT_COLUMN_SPACING);

return $this;
}

/**
* Get Break Type
*
* @return string
*/
public function getBreakType()
{
return $this->breakType;
}

/**
* Set Break Type
*
* @param string $value
* @return self
*/
public function setBreakType($value = null)
{
$this->breakType = $value;
return $this;
}

/**
* Get line numbering
*
* @return \PhpOffice\PhpWord\Style\LineNumbering
*/
public function getLineNumbering()
{
return $this->lineNumbering;
}

/**
* Set line numbering
*
* @param mixed $value
* @return self
*/
public function setLineNumbering($value = null)
{
$this->setObjectVal($value, 'LineNumbering', $this->lineNumbering);

return $this;
}
}