2014-02-22 11:01:15 +07:00
|
|
|
<?php
|
|
|
|
|
/**
|
2014-03-26 16:33:20 +07:00
|
|
|
* PHPWord
|
2014-02-22 11:01:15 +07:00
|
|
|
*
|
2014-03-27 23:55:06 +07:00
|
|
|
* @link https://github.com/PHPOffice/PHPWord
|
|
|
|
|
* @copyright 2014 PHPWord
|
|
|
|
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
2014-02-22 11:01:15 +07:00
|
|
|
*/
|
|
|
|
|
|
2014-03-22 10:06:08 +04:00
|
|
|
namespace PhpOffice\PhpWord\Style;
|
2014-02-22 11:01:15 +07:00
|
|
|
|
2014-03-24 00:26:10 +07:00
|
|
|
/**
|
|
|
|
|
* Table row style
|
|
|
|
|
*/
|
2014-03-22 10:06:08 +04:00
|
|
|
class Row
|
|
|
|
|
{
|
2014-02-22 11:01:15 +07:00
|
|
|
/**
|
|
|
|
|
* Repeat table row on every new page
|
|
|
|
|
*
|
|
|
|
|
* @var bool
|
|
|
|
|
*/
|
2014-03-13 19:09:35 +07:00
|
|
|
private $_tblHeader = false;
|
2014-02-22 11:01:15 +07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Table row cannot break across pages
|
|
|
|
|
*
|
|
|
|
|
* @var bool
|
|
|
|
|
*/
|
2014-03-13 19:09:35 +07:00
|
|
|
private $_cantSplit = false;
|
2014-02-22 11:01:15 +07:00
|
|
|
|
2014-03-29 22:53:34 +07:00
|
|
|
/**
|
2014-03-28 15:21:01 -04:00
|
|
|
* Table row exact height
|
2014-03-28 13:26:36 -04:00
|
|
|
*
|
2014-03-28 15:21:01 -04:00
|
|
|
* @var bool
|
2014-03-28 13:26:36 -04:00
|
|
|
*/
|
2014-03-28 15:21:01 -04:00
|
|
|
private $_exactHeight = false;
|
2014-03-28 13:26:36 -04:00
|
|
|
|
2014-02-22 11:01:15 +07:00
|
|
|
/**
|
|
|
|
|
* Create a new row style
|
|
|
|
|
*/
|
|
|
|
|
public function __construct()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set style value
|
2014-03-17 07:26:25 +07:00
|
|
|
*
|
|
|
|
|
* @param string $key
|
|
|
|
|
* @param mixed $value
|
2014-02-22 11:01:15 +07:00
|
|
|
*/
|
|
|
|
|
public function setStyleValue($key, $value)
|
|
|
|
|
{
|
|
|
|
|
$this->$key = $value;
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-17 07:26:25 +07:00
|
|
|
/**
|
|
|
|
|
* Set tblHeader
|
|
|
|
|
*
|
|
|
|
|
* @param boolean $pValue
|
2014-03-30 18:51:25 +07:00
|
|
|
* @return $this
|
2014-03-17 07:26:25 +07:00
|
|
|
*/
|
2014-03-13 19:09:35 +07:00
|
|
|
public function setTblHeader($pValue = false)
|
2014-02-22 11:01:15 +07:00
|
|
|
{
|
2014-03-13 19:09:35 +07:00
|
|
|
if (!is_bool($pValue)) {
|
|
|
|
|
$pValue = false;
|
|
|
|
|
}
|
2014-02-22 11:01:15 +07:00
|
|
|
$this->_tblHeader = $pValue;
|
2014-03-13 19:09:35 +07:00
|
|
|
return $this;
|
2014-02-22 11:01:15 +07:00
|
|
|
}
|
|
|
|
|
|
2014-03-17 07:26:25 +07:00
|
|
|
/**
|
|
|
|
|
* Get tblHeader
|
|
|
|
|
*
|
|
|
|
|
* @return boolean
|
|
|
|
|
*/
|
2014-02-22 11:01:15 +07:00
|
|
|
public function getTblHeader()
|
|
|
|
|
{
|
2014-03-13 19:09:35 +07:00
|
|
|
return $this->_tblHeader;
|
2014-02-22 11:01:15 +07:00
|
|
|
}
|
|
|
|
|
|
2014-03-17 07:26:25 +07:00
|
|
|
/**
|
|
|
|
|
* Set cantSplit
|
|
|
|
|
*
|
|
|
|
|
* @param boolean $pValue
|
2014-03-30 18:51:25 +07:00
|
|
|
* @return $this
|
2014-03-17 07:26:25 +07:00
|
|
|
*/
|
2014-03-13 19:09:35 +07:00
|
|
|
public function setCantSplit($pValue = false)
|
2014-02-22 11:01:15 +07:00
|
|
|
{
|
2014-03-13 19:09:35 +07:00
|
|
|
if (!is_bool($pValue)) {
|
|
|
|
|
$pValue = false;
|
|
|
|
|
}
|
2014-02-22 11:01:15 +07:00
|
|
|
$this->_cantSplit = $pValue;
|
2014-03-13 19:09:35 +07:00
|
|
|
return $this;
|
2014-02-22 11:01:15 +07:00
|
|
|
}
|
|
|
|
|
|
2014-03-17 07:26:25 +07:00
|
|
|
/**
|
|
|
|
|
* Get cantSplit
|
|
|
|
|
*
|
|
|
|
|
* @return boolean
|
|
|
|
|
*/
|
2014-02-22 11:01:15 +07:00
|
|
|
public function getCantSplit()
|
|
|
|
|
{
|
2014-03-13 19:09:35 +07:00
|
|
|
return $this->_cantSplit;
|
2014-02-22 11:01:15 +07:00
|
|
|
}
|
2014-03-28 13:26:36 -04:00
|
|
|
|
|
|
|
|
/**
|
2014-03-28 15:21:01 -04:00
|
|
|
* Set exactHeight
|
2014-03-28 13:26:36 -04:00
|
|
|
*
|
2014-03-28 15:21:01 -04:00
|
|
|
* @param bool $pValue
|
2014-03-30 18:51:25 +07:00
|
|
|
* @return $this
|
2014-03-28 13:26:36 -04:00
|
|
|
*/
|
2014-03-28 15:21:01 -04:00
|
|
|
public function setExactHeight($pValue = false)
|
2014-03-28 13:26:36 -04:00
|
|
|
{
|
2014-03-28 15:21:01 -04:00
|
|
|
if (!is_bool($pValue)) {
|
|
|
|
|
$pValue = false;
|
2014-03-28 13:26:36 -04:00
|
|
|
}
|
2014-03-28 15:21:01 -04:00
|
|
|
$this->_exactHeight = $pValue;
|
2014-03-28 13:26:36 -04:00
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-03-28 15:21:01 -04:00
|
|
|
* Get exactHeight
|
2014-03-28 13:26:36 -04:00
|
|
|
*
|
2014-03-28 15:21:01 -04:00
|
|
|
* @return boolean
|
2014-03-28 13:26:36 -04:00
|
|
|
*/
|
2014-03-28 15:21:01 -04:00
|
|
|
public function getExactHeight()
|
2014-03-28 13:26:36 -04:00
|
|
|
{
|
2014-03-28 15:21:01 -04:00
|
|
|
return $this->_exactHeight;
|
2014-03-28 13:26:36 -04:00
|
|
|
}
|
2014-03-11 19:26:56 +07:00
|
|
|
}
|