2014-03-22 10:06:08 +04:00
|
|
|
<?php
|
|
|
|
|
/**
|
2014-03-26 16:33:20 +07:00
|
|
|
* PHPWord
|
2014-03-22 10:06:08 +04: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-03-22 10:06:08 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace PhpOffice\PhpWord\Style;
|
|
|
|
|
|
2014-03-24 00:26:10 +07:00
|
|
|
/**
|
|
|
|
|
* List item style
|
|
|
|
|
*/
|
2014-03-22 10:06:08 +04:00
|
|
|
class ListItem
|
|
|
|
|
{
|
|
|
|
|
const TYPE_NUMBER = 7;
|
|
|
|
|
const TYPE_NUMBER_NESTED = 8;
|
|
|
|
|
const TYPE_ALPHANUM = 9;
|
|
|
|
|
const TYPE_BULLET_FILLED = 3;
|
|
|
|
|
const TYPE_BULLET_EMPTY = 5;
|
|
|
|
|
const TYPE_SQUARE_FILLED = 1;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* List Type
|
|
|
|
|
*/
|
2014-04-06 18:03:03 +07:00
|
|
|
private $listType;
|
2014-03-22 10:06:08 +04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new ListItem Style
|
|
|
|
|
*/
|
|
|
|
|
public function __construct()
|
|
|
|
|
{
|
2014-04-06 18:03:03 +07:00
|
|
|
$this->listType = self::TYPE_BULLET_FILLED;
|
2014-03-22 10:06:08 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set style value
|
|
|
|
|
*
|
|
|
|
|
* @param string $key
|
|
|
|
|
* @param string $value
|
|
|
|
|
*/
|
|
|
|
|
public function setStyleValue($key, $value)
|
|
|
|
|
{
|
2014-04-06 18:03:03 +07:00
|
|
|
if (substr($key, 0, 1) == '_') {
|
|
|
|
|
$key = substr($key, 1);
|
|
|
|
|
}
|
2014-03-22 10:06:08 +04:00
|
|
|
$this->$key = $value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set List Type
|
|
|
|
|
*
|
|
|
|
|
* @param int $pValue
|
|
|
|
|
*/
|
|
|
|
|
public function setListType($pValue = self::TYPE_BULLET_FILLED)
|
|
|
|
|
{
|
2014-04-06 18:03:03 +07:00
|
|
|
$this->listType = $pValue;
|
2014-03-22 10:06:08 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get List Type
|
|
|
|
|
*/
|
|
|
|
|
public function getListType()
|
|
|
|
|
{
|
2014-04-06 18:03:03 +07:00
|
|
|
return $this->listType;
|
2014-03-22 10:06:08 +04:00
|
|
|
}
|
|
|
|
|
}
|