1 | <?php |
||
27 | class PhpPresentation |
||
28 | { |
||
29 | /** |
||
30 | * Document properties |
||
31 | * |
||
32 | * @var \PhpOffice\PhpPresentation\DocumentProperties |
||
33 | */ |
||
34 | protected $documentProperties; |
||
35 | |||
36 | /** |
||
37 | * Presentation properties |
||
38 | * |
||
39 | * @var \PhpOffice\PhpPresentation\PresentationProperties |
||
40 | */ |
||
41 | protected $presentationProps; |
||
42 | |||
43 | /** |
||
44 | * Document layout |
||
45 | * |
||
46 | * @var \PhpOffice\PhpPresentation\DocumentLayout |
||
47 | */ |
||
48 | protected $layout; |
||
49 | |||
50 | /** |
||
51 | * Collection of Slide objects |
||
52 | * |
||
53 | * @var \PhpOffice\PhpPresentation\Slide[] |
||
54 | */ |
||
55 | protected $slideCollection = array(); |
||
56 | |||
57 | /** |
||
58 | * Active slide index |
||
59 | * |
||
60 | * @var int |
||
61 | */ |
||
62 | protected $activeSlideIndex = 0; |
||
63 | |||
64 | /** |
||
65 | * Collection of Master Slides |
||
66 | * @var \ArrayObject|\PhpOffice\PhpPresentation\Slide\SlideMaster[] |
||
67 | */ |
||
68 | protected $slideMasters; |
||
69 | |||
70 | /** |
||
71 | * Create a new PhpPresentation with one Slide |
||
72 | */ |
||
73 | 222 | public function __construct() |
|
87 | |||
88 | /** |
||
89 | * Get properties |
||
90 | * |
||
91 | * @return \PhpOffice\PhpPresentation\DocumentProperties |
||
92 | * @deprecated for getDocumentProperties |
||
93 | */ |
||
94 | 1 | public function getProperties() |
|
95 | { |
||
96 | 1 | return $this->getDocumentProperties(); |
|
97 | } |
||
98 | |||
99 | /** |
||
100 | * Set properties |
||
101 | * |
||
102 | * @param \PhpOffice\PhpPresentation\DocumentProperties $value |
||
103 | * @deprecated for setDocumentProperties |
||
104 | * @return PhpPresentation |
||
105 | */ |
||
106 | 1 | public function setProperties(DocumentProperties $value) |
|
107 | { |
||
108 | 1 | return $this->setDocumentProperties($value); |
|
109 | } |
||
110 | |||
111 | /** |
||
112 | * Get properties |
||
113 | * |
||
114 | * @return \PhpOffice\PhpPresentation\DocumentProperties |
||
115 | */ |
||
116 | 186 | public function getDocumentProperties() |
|
120 | |||
121 | /** |
||
122 | * Set properties |
||
123 | * |
||
124 | * @param \PhpOffice\PhpPresentation\DocumentProperties $value |
||
125 | * @return PhpPresentation |
||
126 | */ |
||
127 | 222 | public function setDocumentProperties(DocumentProperties $value) |
|
133 | |||
134 | /** |
||
135 | * Get presentation properties |
||
136 | * |
||
137 | * @return \PhpOffice\PhpPresentation\PresentationProperties |
||
138 | */ |
||
139 | 183 | public function getPresentationProperties() |
|
143 | |||
144 | /** |
||
145 | * Set presentation properties |
||
146 | * |
||
147 | * @param \PhpOffice\PhpPresentation\PresentationProperties $value |
||
148 | * @return PhpPresentation |
||
149 | */ |
||
150 | 222 | public function setPresentationProperties(PresentationProperties $value) |
|
155 | |||
156 | /** |
||
157 | * Get layout |
||
158 | * |
||
159 | * @return \PhpOffice\PhpPresentation\DocumentLayout |
||
160 | */ |
||
161 | 179 | public function getLayout() |
|
165 | |||
166 | /** |
||
167 | * Set layout |
||
168 | * |
||
169 | * @param \PhpOffice\PhpPresentation\DocumentLayout $value |
||
170 | * @return PhpPresentation |
||
171 | */ |
||
172 | 222 | public function setLayout(DocumentLayout $value) |
|
178 | |||
179 | /** |
||
180 | * Get active slide |
||
181 | * |
||
182 | * @return \PhpOffice\PhpPresentation\Slide |
||
183 | */ |
||
184 | 222 | public function getActiveSlide() |
|
188 | |||
189 | /** |
||
190 | * Create slide and add it to this presentation |
||
191 | * |
||
192 | * @return \PhpOffice\PhpPresentation\Slide |
||
193 | * @throws \Exception |
||
194 | */ |
||
195 | 222 | public function createSlide() |
|
201 | |||
202 | /** |
||
203 | * Add slide |
||
204 | * |
||
205 | * @param \PhpOffice\PhpPresentation\Slide $slide |
||
206 | * @throws \Exception |
||
207 | * @return \PhpOffice\PhpPresentation\Slide |
||
208 | */ |
||
209 | 222 | public function addSlide(Slide $slide = null) |
|
215 | |||
216 | /** |
||
217 | * Remove slide by index |
||
218 | * |
||
219 | * @param int $index Slide index |
||
220 | * @throws \Exception |
||
221 | * @return PhpPresentation |
||
222 | */ |
||
223 | 16 | public function removeSlideByIndex($index = 0) |
|
232 | |||
233 | /** |
||
234 | * Get slide by index |
||
235 | * |
||
236 | * @param int $index Slide index |
||
237 | * @return \PhpOffice\PhpPresentation\Slide |
||
238 | * @throws \Exception |
||
239 | */ |
||
240 | 193 | public function getSlide($index = 0) |
|
247 | |||
248 | /** |
||
249 | * Get all slides |
||
250 | * |
||
251 | * @return \PhpOffice\PhpPresentation\Slide[] |
||
252 | */ |
||
253 | 184 | public function getAllSlides() |
|
257 | |||
258 | /** |
||
259 | * Get index for slide |
||
260 | * |
||
261 | * @param \PhpOffice\PhpPresentation\Slide\AbstractSlide $slide |
||
262 | * @return int |
||
263 | * @throws \Exception |
||
264 | */ |
||
265 | 115 | public function getIndex(Slide\AbstractSlide $slide) |
|
276 | |||
277 | /** |
||
278 | * Get slide count |
||
279 | * |
||
280 | * @return int |
||
281 | */ |
||
282 | 196 | public function getSlideCount() |
|
286 | |||
287 | /** |
||
288 | * Get active slide index |
||
289 | * |
||
290 | * @return int Active slide index |
||
291 | */ |
||
292 | 1 | public function getActiveSlideIndex() |
|
296 | |||
297 | /** |
||
298 | * Set active slide index |
||
299 | * |
||
300 | * @param int $index Active slide index |
||
301 | * @throws \Exception |
||
302 | * @return \PhpOffice\PhpPresentation\Slide |
||
303 | */ |
||
304 | 222 | public function setActiveSlideIndex($index = 0) |
|
313 | |||
314 | /** |
||
315 | * Add external slide |
||
316 | * |
||
317 | * @param \PhpOffice\PhpPresentation\Slide $slide External slide to add |
||
318 | * @throws \Exception |
||
319 | * @return \PhpOffice\PhpPresentation\Slide |
||
320 | */ |
||
321 | 1 | public function addExternalSlide(Slide $slide) |
|
329 | |||
330 | /** |
||
331 | * Get slide iterator |
||
332 | * |
||
333 | * @return \PhpOffice\PhpPresentation\Slide\Iterator |
||
334 | */ |
||
335 | 1 | public function getSlideIterator() |
|
339 | |||
340 | /** |
||
341 | * Create a masterslide and add it to this presentation |
||
342 | * |
||
343 | * @return \PhpOffice\PhpPresentation\Slide\SlideMaster |
||
344 | * @throws \Exception |
||
345 | */ |
||
346 | 222 | public function createMasterSlide() |
|
352 | |||
353 | /** |
||
354 | * Add masterslide |
||
355 | * |
||
356 | * @param \PhpOffice\PhpPresentation\Slide\SlideMaster $slide |
||
357 | * @return \PhpOffice\PhpPresentation\Slide\SlideMaster |
||
358 | * @throws \Exception |
||
359 | */ |
||
360 | 222 | public function addMasterSlide(SlideMaster $slide = null) |
|
366 | |||
367 | /** |
||
368 | * Copy presentation (!= clone!) |
||
369 | * |
||
370 | * @return PhpPresentation |
||
371 | * @throws \Exception |
||
372 | */ |
||
373 | 1 | public function copy() |
|
385 | |||
386 | /** |
||
387 | * Mark a document as final |
||
388 | * @param bool $state |
||
389 | * @return PresentationProperties |
||
390 | * @deprecated for getPresentationProperties()->markAsFinal() |
||
391 | */ |
||
392 | 1 | public function markAsFinal($state = true) |
|
393 | { |
||
394 | 1 | return $this->getPresentationProperties()->markAsFinal($state); |
|
395 | } |
||
396 | |||
397 | /** |
||
398 | * Return if this document is marked as final |
||
399 | * @return bool |
||
400 | * @deprecated for getPresentationProperties()->isMarkedAsFinal() |
||
401 | */ |
||
402 | 1 | public function isMarkedAsFinal() |
|
403 | { |
||
404 | 1 | return $this->getPresentationProperties()->isMarkedAsFinal(); |
|
405 | } |
||
406 | |||
407 | /** |
||
408 | * Set the zoom of the document (in percentage) |
||
409 | * @param float $zoom |
||
410 | * @return PresentationProperties |
||
411 | * @deprecated for getPresentationProperties()->setZoom() |
||
412 | */ |
||
413 | 1 | public function setZoom($zoom = 1.0) |
|
414 | { |
||
415 | 1 | return $this->getPresentationProperties()->setZoom($zoom); |
|
416 | } |
||
417 | |||
418 | /** |
||
419 | * Return the zoom (in percentage) |
||
420 | * @return float |
||
421 | * @deprecated for getPresentationProperties()->getZoom() |
||
422 | */ |
||
423 | 1 | public function getZoom() |
|
424 | { |
||
425 | 1 | return $this->getPresentationProperties()->getZoom(); |
|
426 | } |
||
427 | |||
428 | /** |
||
429 | * @return \ArrayObject|Slide\SlideMaster[] |
||
430 | */ |
||
431 | 222 | public function getAllMasterSlides() |
|
435 | |||
436 | /** |
||
437 | * @param \ArrayObject|Slide\SlideMaster[] $slideMasters |
||
438 | * @return $this |
||
439 | */ |
||
440 | 4 | public function setAllMasterSlides($slideMasters = array()) |
|
447 | } |
||
448 |