Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
8 / 8 |
|
100.00% |
7 / 7 |
CRAP | |
100.00% |
1 / 1 |
| TOC | |
100.00% |
8 / 8 |
|
100.00% |
7 / 7 |
7 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getTabPos | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setTabPos | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getTabLeader | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setTabLeader | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getIndent | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setIndent | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This file is part of PHPWord - A pure PHP library for reading and writing |
| 5 | * word processing documents. |
| 6 | * |
| 7 | * PHPWord is free software distributed under the terms of the GNU Lesser |
| 8 | * General Public License version 3 as published by the Free Software Foundation. |
| 9 | * |
| 10 | * For the full copyright and license information, please read the LICENSE |
| 11 | * file that was distributed with this source code. For the full list of |
| 12 | * contributors, visit https://github.com/PHPOffice/PHPWord/contributors. |
| 13 | * |
| 14 | * @see https://github.com/PHPOffice/PHPWord |
| 15 | * |
| 16 | * @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3 |
| 17 | */ |
| 18 | |
| 19 | namespace PhpOffice\PhpWord\Style; |
| 20 | |
| 21 | /** |
| 22 | * TOC style. |
| 23 | */ |
| 24 | class TOC extends Tab |
| 25 | { |
| 26 | /** |
| 27 | * Indent. |
| 28 | * |
| 29 | * @var float|int (twip) |
| 30 | */ |
| 31 | private $indent = 200; |
| 32 | |
| 33 | /** |
| 34 | * Create a new TOC Style. |
| 35 | */ |
| 36 | public function __construct() |
| 37 | { |
| 38 | parent::__construct(self::TAB_STOP_RIGHT, 9062, self::TAB_LEADER_DOT); |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Get Tab Position. |
| 43 | * |
| 44 | * @return float|int |
| 45 | */ |
| 46 | public function getTabPos() |
| 47 | { |
| 48 | return $this->getPosition(); |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Set Tab Position. |
| 53 | * |
| 54 | * @param float|int $value |
| 55 | * |
| 56 | * @return self |
| 57 | */ |
| 58 | public function setTabPos($value) |
| 59 | { |
| 60 | return $this->setPosition($value); |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Get Tab Leader. |
| 65 | * |
| 66 | * @return string |
| 67 | */ |
| 68 | public function getTabLeader() |
| 69 | { |
| 70 | return $this->getLeader(); |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Set Tab Leader. |
| 75 | * |
| 76 | * @param string $value |
| 77 | * |
| 78 | * @return self |
| 79 | */ |
| 80 | public function setTabLeader($value = self::TAB_LEADER_DOT) |
| 81 | { |
| 82 | return $this->setLeader($value); |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Get Indent. |
| 87 | * |
| 88 | * @return float|int |
| 89 | */ |
| 90 | public function getIndent() |
| 91 | { |
| 92 | return $this->indent; |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * Set Indent. |
| 97 | * |
| 98 | * @param float|int $value |
| 99 | * |
| 100 | * @return self |
| 101 | */ |
| 102 | public function setIndent($value) |
| 103 | { |
| 104 | $this->indent = $this->setNumericVal($value, $this->indent); |
| 105 | |
| 106 | return $this; |
| 107 | } |
| 108 | } |