1 | <?php |
||
28 | class Paragraph implements ComparableInterface |
||
29 | { |
||
30 | /** |
||
31 | * Rich text elements |
||
32 | * |
||
33 | * @var \PhpOffice\PhpPresentation\Shape\RichText\TextElementInterface[] |
||
34 | */ |
||
35 | private $richTextElements; |
||
36 | |||
37 | /** |
||
38 | * Alignment |
||
39 | * |
||
40 | * @var \PhpOffice\PhpPresentation\Style\Alignment |
||
41 | */ |
||
42 | private $alignment; |
||
43 | |||
44 | /** |
||
45 | * Font |
||
46 | * |
||
47 | * @var \PhpOffice\PhpPresentation\Style\Font |
||
48 | */ |
||
49 | private $font; |
||
50 | |||
51 | /** |
||
52 | * Bullet style |
||
53 | * |
||
54 | * @var \PhpOffice\PhpPresentation\Style\Bullet |
||
55 | */ |
||
56 | private $bulletStyle; |
||
57 | |||
58 | /** |
||
59 | * @var integer |
||
60 | */ |
||
61 | private $lineSpacing = 100; |
||
62 | |||
63 | /** |
||
64 | * @var boolean |
||
65 | */ |
||
66 | private $lineSpacingModeExact = false; |
||
67 | |||
68 | /** |
||
69 | * @var float |
||
70 | */ |
||
71 | private $spacingBefore = 0; |
||
72 | |||
73 | 300 | /** |
|
74 | * @var float |
||
75 | */ |
||
76 | 300 | private $spacingAfter = 0; |
|
77 | 300 | ||
78 | 300 | /** |
|
79 | 300 | * Hash index |
|
80 | 300 | * |
|
81 | * @var string |
||
82 | */ |
||
83 | private $hashIndex; |
||
84 | |||
85 | /** |
||
86 | * Create a new \PhpOffice\PhpPresentation\Shape\RichText\Paragraph instance |
||
87 | 235 | */ |
|
88 | public function __construct() |
||
96 | |||
97 | /** |
||
98 | 13 | * Get alignment |
|
99 | * |
||
100 | 13 | * @return \PhpOffice\PhpPresentation\Style\Alignment |
|
101 | */ |
||
102 | 13 | public function getAlignment() |
|
106 | |||
107 | /** |
||
108 | * Set alignment |
||
109 | * |
||
110 | 236 | * @param \PhpOffice\PhpPresentation\Style\Alignment $alignment |
|
111 | * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph |
||
112 | 236 | */ |
|
113 | public function setAlignment(Alignment $alignment) |
||
119 | |||
120 | /** |
||
121 | * Get font |
||
122 | 13 | * |
|
123 | * @return \PhpOffice\PhpPresentation\Style\Font |
||
124 | 13 | */ |
|
125 | public function getFont() |
||
129 | |||
130 | /** |
||
131 | * Set font |
||
132 | * |
||
133 | * @param \PhpOffice\PhpPresentation\Style\Font $pFont Font |
||
134 | 60 | * @throws \Exception |
|
135 | * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph |
||
136 | 60 | */ |
|
137 | public function setFont(Font $pFont = null) |
||
143 | |||
144 | /** |
||
145 | * Get bullet style |
||
146 | 13 | * |
|
147 | * @return \PhpOffice\PhpPresentation\Style\Bullet |
||
148 | 13 | */ |
|
149 | public function getBulletStyle() |
||
153 | |||
154 | /** |
||
155 | * Set bullet style |
||
156 | * |
||
157 | * @param \PhpOffice\PhpPresentation\Style\Bullet $style |
||
158 | * @throws \Exception |
||
159 | * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph |
||
160 | 4 | */ |
|
161 | public function setBulletStyle(Bullet $style = null) |
||
167 | |||
168 | /** |
||
169 | * Create text (can not be formatted !) |
||
170 | * |
||
171 | * @param string $pText Text |
||
172 | * @return \PhpOffice\PhpPresentation\Shape\RichText\TextElement |
||
173 | * @throws \Exception |
||
174 | */ |
||
175 | 56 | public function createText($pText = '') |
|
182 | |||
183 | /** |
||
184 | * Add text |
||
185 | * |
||
186 | * @param \PhpOffice\PhpPresentation\Shape\RichText\TextElementInterface $pText Rich text element |
||
187 | * @throws \Exception |
||
188 | 12 | * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph |
|
189 | */ |
||
190 | 12 | public function addText(TextElementInterface $pText = null) |
|
196 | |||
197 | /** |
||
198 | * Create break |
||
199 | * |
||
200 | * @return \PhpOffice\PhpPresentation\Shape\RichText\BreakElement |
||
201 | * @throws \Exception |
||
202 | */ |
||
203 | 52 | public function createBreak() |
|
210 | |||
211 | /** |
||
212 | * Create text run (can be formatted) |
||
213 | * |
||
214 | * @param string $pText Text |
||
215 | * @return \PhpOffice\PhpPresentation\Shape\RichText\Run |
||
216 | * @throws \Exception |
||
217 | 1 | */ |
|
218 | public function createTextRun($pText = '') |
||
226 | |||
227 | 3 | /** |
|
228 | * Convert to string |
||
229 | * |
||
230 | 3 | * @return string |
|
231 | */ |
||
232 | public function __toString() |
||
236 | |||
237 | /** |
||
238 | * Get plain text |
||
239 | * |
||
240 | 3 | * @return string |
|
241 | */ |
||
242 | public function getPlainText() |
||
257 | |||
258 | /** |
||
259 | * Get Rich Text elements |
||
260 | 6 | * |
|
261 | * @return \PhpOffice\PhpPresentation\Shape\RichText\TextElementInterface[] |
||
262 | 6 | */ |
|
263 | 1 | public function getRichTextElements() |
|
267 | |||
268 | /** |
||
269 | * Set Rich Text elements |
||
270 | * |
||
271 | * @param \PhpOffice\PhpPresentation\Shape\RichText\TextElementInterface[] $pElements Array of elements |
||
272 | * @throws \Exception |
||
273 | * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph |
||
274 | 20 | */ |
|
275 | public function setRichTextElements($pElements = null) |
||
283 | |||
284 | /** |
||
285 | * Get hash code |
||
286 | * |
||
287 | * @return string Hash code |
||
288 | */ |
||
289 | public function getHashCode() |
||
298 | |||
299 | /** |
||
300 | * Get hash index |
||
301 | * |
||
302 | * Note that this index may vary during script execution! Only reliable moment is |
||
303 | * while doing a write of a workbook and when changes are not allowed. |
||
304 | * |
||
305 | 1 | * @return string Hash index |
|
306 | */ |
||
307 | 1 | public function getHashIndex() |
|
311 | |||
312 | /** |
||
313 | 36 | * Set hash index |
|
314 | * |
||
315 | 36 | * Note that this index may vary during script execution! Only reliable moment is |
|
316 | * while doing a write of a workbook and when changes are not allowed. |
||
317 | * |
||
318 | * @param string $value Hash index |
||
319 | */ |
||
320 | public function setHashIndex($value) |
||
324 | 2 | ||
325 | 2 | /** |
|
326 | * @return int |
||
327 | */ |
||
328 | public function getLineSpacing() |
||
332 | |||
333 | /** |
||
334 | * @param int $lineSpacing |
||
335 | * @return Paragraph |
||
336 | */ |
||
337 | public function setLineSpacing($lineSpacing) |
||
342 | |||
343 | /** |
||
344 | * @return boolean |
||
345 | */ |
||
346 | public function getLineSpacingModeExact() |
||
350 | |||
351 | /** |
||
352 | * @param boolean $lineSpacingModeExact |
||
353 | * @return Paragraph |
||
354 | */ |
||
355 | public function setLineSpacingModeExact($lineSpacingModeExact) |
||
360 | |||
361 | /** |
||
362 | * @return float |
||
363 | */ |
||
364 | public function getSpacingBefore() |
||
368 | |||
369 | /** |
||
370 | * @param float $spacingBefore |
||
371 | * @return Paragraph |
||
372 | */ |
||
373 | public function setSpacingBefore($spacingBefore) |
||
378 | |||
379 | /** |
||
380 | * @return float |
||
381 | */ |
||
382 | public function getSpacingAfter() |
||
386 | |||
387 | /** |
||
388 | * @param float $spacingAfter |
||
389 | * @return Paragraph |
||
390 | */ |
||
391 | public function setSpacingAfter($spacingAfter) |
||
396 | } |
||
397 |