|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* This file is part of PHPPresentation - A pure PHP library for reading and writing |
|
4
|
|
|
* presentations documents. |
|
5
|
|
|
* |
|
6
|
|
|
* PHPPresentation is free software distributed under the terms of the GNU Lesser |
|
7
|
|
|
* General Public License version 3 as published by the Free Software Foundation. |
|
8
|
|
|
* |
|
9
|
|
|
* For the full copyright and license information, please read the LICENSE |
|
10
|
|
|
* file that was distributed with this source code. For the full list of |
|
11
|
|
|
* contributors, visit https://github.com/PHPOffice/PHPPresentation/contributors. |
|
12
|
|
|
* |
|
13
|
|
|
* @link https://github.com/PHPOffice/PHPPresentation |
|
14
|
|
|
* @copyright 2009-2015 PHPPresentation contributors |
|
15
|
|
|
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3 |
|
16
|
|
|
*/ |
|
17
|
|
|
namespace PhpOffice\PhpPresentation\Slide; |
|
18
|
|
|
|
|
19
|
|
|
use PhpOffice\PhpPresentation\ComparableInterface; |
|
20
|
|
|
use PhpOffice\PhpPresentation\ShapeContainerInterface; |
|
21
|
|
|
use PhpOffice\PhpPresentation\Style\ColorMap; |
|
22
|
|
|
|
|
23
|
|
|
class SlideLayout extends AbstractSlide implements ComparableInterface, ShapeContainerInterface |
|
24
|
|
|
{ |
|
25
|
|
|
protected $slideMaster; |
|
26
|
|
|
/** |
|
27
|
|
|
* Slide relation ID (should not be used by user code!) |
|
28
|
|
|
* |
|
29
|
|
|
* @var string |
|
30
|
|
|
*/ |
|
31
|
|
|
public $relationId; |
|
32
|
|
|
/** |
|
33
|
|
|
* Slide layout NR (should not be used by user code!) |
|
34
|
|
|
* |
|
35
|
|
|
* @var int |
|
36
|
|
|
*/ |
|
37
|
|
|
public $layoutNr; |
|
38
|
|
|
/** |
|
39
|
|
|
* Slide layout ID (should not be used by user code!) |
|
40
|
|
|
* |
|
41
|
|
|
* @var int |
|
42
|
|
|
*/ |
|
43
|
|
|
public $layoutId; |
|
44
|
|
|
/** |
|
45
|
|
|
* Slide layout ID (should not be used by user code!) |
|
46
|
|
|
* |
|
47
|
|
|
* @var int |
|
48
|
|
|
*/ |
|
49
|
|
|
protected $layoutName; |
|
50
|
|
|
/** |
|
51
|
|
|
* Mapping of colors to the theme |
|
52
|
|
|
* |
|
53
|
|
|
* @var \PhpOffice\PhpPresentation\Style\ColorMap |
|
54
|
|
|
*/ |
|
55
|
|
|
public $colorMap; |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* Create a new slideLayout |
|
59
|
|
|
* |
|
60
|
|
|
* @param SlideMaster $pSlideMaster |
|
61
|
|
|
*/ |
|
62
|
214 |
|
public function __construct(SlideMaster $pSlideMaster) |
|
63
|
|
|
{ |
|
64
|
|
|
// Set parent |
|
65
|
214 |
|
$this->slideMaster = $pSlideMaster; |
|
66
|
|
|
// Shape collection |
|
67
|
214 |
|
$this->shapeCollection = new \ArrayObject(); |
|
68
|
|
|
// Set identifier |
|
69
|
214 |
|
$this->identifier = md5(rand(0, 9999) . time()); |
|
70
|
|
|
// Set a basic colorMap |
|
71
|
214 |
|
$this->colorMap = new ColorMap(); |
|
72
|
214 |
|
} |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* @return int |
|
76
|
|
|
*/ |
|
77
|
104 |
|
public function getLayoutName() |
|
78
|
|
|
{ |
|
79
|
104 |
|
return $this->layoutName; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* @param int $layoutName |
|
84
|
|
|
* @return SlideLayout |
|
85
|
|
|
*/ |
|
86
|
5 |
|
public function setLayoutName($layoutName) |
|
87
|
|
|
{ |
|
88
|
5 |
|
$this->layoutName = $layoutName; |
|
89
|
5 |
|
return $this; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* @return SlideMaster |
|
94
|
|
|
*/ |
|
95
|
2 |
|
public function getSlideMaster() |
|
96
|
|
|
{ |
|
97
|
2 |
|
return $this->slideMaster; |
|
98
|
|
|
} |
|
99
|
|
|
} |
|
100
|
|
|
|