2014-02-22 11:01:15 +07:00
|
|
|
<?php
|
|
|
|
|
/**
|
2014-05-05 13:06:53 +04:00
|
|
|
* This file is part of PHPWord - A pure PHP library for reading and writing
|
|
|
|
|
* word processing documents.
|
|
|
|
|
*
|
|
|
|
|
* PHPWord is free software distributed under the terms of the GNU Lesser
|
|
|
|
|
* General Public License version 3 as published by the Free Software Foundation.
|
|
|
|
|
*
|
|
|
|
|
* For the full copyright and license information, please read the LICENSE
|
|
|
|
|
* file that was distributed with this source code. For the full list of
|
|
|
|
|
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
|
2014-02-22 11:01:15 +07:00
|
|
|
*
|
2014-03-27 23:55:06 +07:00
|
|
|
* @link https://github.com/PHPOffice/PHPWord
|
2015-12-05 21:25:59 +04:00
|
|
|
* @copyright 2010-2015 PHPWord contributors
|
2014-05-04 21:03:28 +04:00
|
|
|
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
|
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-04-17 16:19:23 +07:00
|
|
|
*
|
|
|
|
|
* @since 0.8.0
|
2014-03-24 00:26:10 +07:00
|
|
|
*/
|
2014-04-08 03:03:14 +07:00
|
|
|
class Row extends AbstractStyle
|
2014-03-22 10:06:08 +04:00
|
|
|
{
|
2014-02-22 11:01:15 +07:00
|
|
|
/**
|
|
|
|
|
* Repeat table row on every new page
|
|
|
|
|
*
|
|
|
|
|
* @var bool
|
|
|
|
|
*/
|
2014-04-06 18:03:03 +07:00
|
|
|
private $tblHeader = false;
|
2014-02-22 11:01:15 +07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Table row cannot break across pages
|
|
|
|
|
*
|
|
|
|
|
* @var bool
|
|
|
|
|
*/
|
2014-04-06 18:03:03 +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-04-06 18:03:03 +07: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()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-17 07:26:25 +07:00
|
|
|
/**
|
2014-05-04 15:13:31 +07:00
|
|
|
* Is tblHeader
|
2014-03-17 07:26:25 +07:00
|
|
|
*
|
2014-05-04 15:13:31 +07:00
|
|
|
* @return bool
|
|
|
|
|
*/
|
|
|
|
|
public function isTblHeader()
|
|
|
|
|
{
|
|
|
|
|
return $this->tblHeader;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Is tblHeader
|
|
|
|
|
*
|
|
|
|
|
* @param bool $value
|
2014-04-11 21:16:07 +07:00
|
|
|
* @return self
|
2014-03-17 07:26:25 +07:00
|
|
|
*/
|
2014-05-13 11:05:12 +07:00
|
|
|
public function setTblHeader($value = true)
|
2014-02-22 11:01:15 +07:00
|
|
|
{
|
2014-04-11 21:16:07 +07:00
|
|
|
$this->tblHeader = $this->setBoolVal($value, $this->tblHeader);
|
2014-05-08 19:25:29 +07:00
|
|
|
|
|
|
|
|
return $this;
|
2014-02-22 11:01:15 +07:00
|
|
|
}
|
|
|
|
|
|
2014-03-17 07:26:25 +07:00
|
|
|
/**
|
2014-05-04 15:13:31 +07:00
|
|
|
* Is cantSplit
|
2014-03-17 07:26:25 +07:00
|
|
|
*
|
2014-05-04 15:13:31 +07:00
|
|
|
* @return bool
|
2014-03-17 07:26:25 +07:00
|
|
|
*/
|
2014-05-04 15:13:31 +07:00
|
|
|
public function isCantSplit()
|
2014-02-22 11:01:15 +07:00
|
|
|
{
|
2014-05-04 15:13:31 +07:00
|
|
|
return $this->cantSplit;
|
2014-02-22 11:01:15 +07:00
|
|
|
}
|
|
|
|
|
|
2014-03-17 07:26:25 +07:00
|
|
|
/**
|
2014-05-04 15:13:31 +07:00
|
|
|
* Is cantSplit
|
2014-03-17 07:26:25 +07:00
|
|
|
*
|
2014-05-04 15:13:31 +07:00
|
|
|
* @param bool $value
|
2014-04-11 21:16:07 +07:00
|
|
|
* @return self
|
2014-03-17 07:26:25 +07:00
|
|
|
*/
|
2014-05-13 11:05:12 +07:00
|
|
|
public function setCantSplit($value = true)
|
2014-02-22 11:01:15 +07:00
|
|
|
{
|
2014-04-11 21:16:07 +07:00
|
|
|
$this->cantSplit = $this->setBoolVal($value, $this->cantSplit);
|
2014-05-08 19:25:29 +07:00
|
|
|
|
|
|
|
|
return $this;
|
2014-02-22 11:01:15 +07:00
|
|
|
}
|
|
|
|
|
|
2014-03-17 07:26:25 +07:00
|
|
|
/**
|
2014-05-04 15:13:31 +07:00
|
|
|
* Is exactHeight
|
2014-03-17 07:26:25 +07:00
|
|
|
*
|
2014-05-04 15:13:31 +07:00
|
|
|
* @return bool
|
2014-03-17 07:26:25 +07:00
|
|
|
*/
|
2014-05-04 15:13:31 +07:00
|
|
|
public function isExactHeight()
|
2014-02-22 11:01:15 +07:00
|
|
|
{
|
2014-05-04 15:13:31 +07:00
|
|
|
return $this->exactHeight;
|
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-04-11 21:16:07 +07:00
|
|
|
* @param bool $value
|
|
|
|
|
* @return self
|
2014-03-28 13:26:36 -04:00
|
|
|
*/
|
2014-05-13 11:05:12 +07:00
|
|
|
public function setExactHeight($value = true)
|
2014-03-28 13:26:36 -04:00
|
|
|
{
|
2014-04-11 21:16:07 +07:00
|
|
|
$this->exactHeight = $this->setBoolVal($value, $this->exactHeight);
|
2014-05-08 19:25:29 +07:00
|
|
|
|
2014-03-28 13:26:36 -04:00
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-04 15:13:31 +07:00
|
|
|
/**
|
|
|
|
|
* Get tblHeader
|
|
|
|
|
*
|
|
|
|
|
* @deprecated 0.10.0
|
2015-10-10 19:06:23 +04:00
|
|
|
*
|
2014-05-04 15:13:31 +07:00
|
|
|
* @codeCoverageIgnore
|
|
|
|
|
*/
|
|
|
|
|
public function getTblHeader()
|
|
|
|
|
{
|
|
|
|
|
return $this->isTblHeader();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get cantSplit
|
|
|
|
|
*
|
|
|
|
|
* @deprecated 0.10.0
|
2015-10-10 19:06:23 +04:00
|
|
|
*
|
2014-05-04 15:13:31 +07:00
|
|
|
* @codeCoverageIgnore
|
|
|
|
|
*/
|
|
|
|
|
public function getCantSplit()
|
|
|
|
|
{
|
|
|
|
|
return $this->isCantSplit();
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-28 13:26:36 -04:00
|
|
|
/**
|
2014-03-28 15:21:01 -04:00
|
|
|
* Get exactHeight
|
2014-03-28 13:26:36 -04:00
|
|
|
*
|
2014-05-04 15:13:31 +07:00
|
|
|
* @deprecated 0.10.0
|
2015-10-10 19:06:23 +04:00
|
|
|
*
|
2014-05-04 15:13:31 +07:00
|
|
|
* @codeCoverageIgnore
|
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-05-04 15:13:31 +07:00
|
|
|
return $this->isExactHeight();
|
2014-03-28 13:26:36 -04:00
|
|
|
}
|
2014-03-11 19:26:56 +07:00
|
|
|
}
|