1 | <?php |
||
12 | class Styler |
||
13 | { |
||
14 | /** |
||
15 | * Holds unique styles. |
||
16 | * |
||
17 | * @var Style[] |
||
18 | */ |
||
19 | private $styles = array(); |
||
20 | |||
21 | /** |
||
22 | * Holds unique fonts. |
||
23 | * |
||
24 | * @var Font[] |
||
25 | */ |
||
26 | private $fonts = array(); |
||
27 | |||
28 | /** |
||
29 | * Holds uniqiue fills. |
||
30 | * |
||
31 | * @var Fill[] |
||
32 | */ |
||
33 | private $fills = array(); |
||
34 | |||
35 | /** |
||
36 | * Holds uniqiue borders. |
||
37 | 4 | * |
|
38 | * @var Border[] |
||
39 | 4 | */ |
|
40 | 4 | private $borders = array(); |
|
41 | 4 | ||
42 | 4 | /** |
|
43 | * Holds (hash => component id) mappings. |
||
44 | * |
||
45 | * @var array |
||
46 | */ |
||
47 | private $hashes = array(); |
||
48 | |||
49 | 4 | /** |
|
50 | * Styler constructor to initialize reserved default styles. |
||
51 | 4 | */ |
|
52 | 4 | public function __construct() |
|
58 | |||
59 | /** |
||
60 | * Add a new style, if it doesnt exists yet. |
||
61 | * |
||
62 | * @param Style $style |
||
63 | */ |
||
64 | public function addStyle(Style $style) |
||
74 | 4 | ||
75 | 4 | /** |
|
76 | * Register a new style/font/fill component to account |
||
77 | 4 | * for reusable styles, fills, fonts, ... |
|
78 | * |
||
79 | * @param Component $component |
||
80 | * @param array $collection |
||
81 | */ |
||
82 | 1 | private function register(Component $component, &$collection) |
|
94 | 2 | ||
95 | 2 | /** |
|
96 | 2 | * Return default style (Calibri,11). |
|
97 | 2 | * |
|
98 | * @return Style |
||
99 | 2 | */ |
|
100 | 2 | public function getDefaultStyle() |
|
104 | 2 | ||
105 | 2 | /** |
|
106 | * Return entire xml string for the style sheet. |
||
107 | 2 | * |
|
108 | 2 | * @return string |
|
109 | 2 | */ |
|
110 | 2 | public function getStyleSheetXml() |
|
136 | } |
||
137 |