1 | <?php |
||
12 | abstract class AbstractDecoratorWriter extends \PhpOffice\PhpPresentation\Writer\AbstractDecoratorWriter |
||
13 | { |
||
14 | /** |
||
15 | * Write relationship |
||
16 | * |
||
17 | * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer |
||
18 | * @param int $pId Relationship ID. rId will be prepended! |
||
19 | * @param string $pType Relationship type |
||
20 | * @param string $pTarget Relationship target |
||
21 | * @param string $pTargetMode Relationship target mode |
||
22 | * @throws \Exception |
||
23 | */ |
||
24 | 115 | protected function writeRelationship(XMLWriter $objWriter, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '') |
|
45 | |||
46 | /** |
||
47 | * Write Border |
||
48 | * |
||
49 | * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer |
||
50 | * @param \PhpOffice\PhpPresentation\Style\Border $pBorder Border |
||
51 | * @param string $pElementName Element name |
||
52 | * @throws \Exception |
||
53 | */ |
||
54 | 80 | protected function writeBorder(XMLWriter $objWriter, $pBorder, $pElementName = 'L') |
|
115 | |||
116 | /** |
||
117 | * @param XMLWriter $objWriter |
||
118 | * @param Color $color |
||
119 | * @param int|null $alpha |
||
120 | */ |
||
121 | 73 | protected function writeColor(XMLWriter $objWriter, Color $color, $alpha = null) |
|
138 | |||
139 | /** |
||
140 | * Write Fill |
||
141 | * |
||
142 | * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer |
||
143 | * @param \PhpOffice\PhpPresentation\Style\Fill $pFill Fill style |
||
144 | * @throws \Exception |
||
145 | */ |
||
146 | 79 | protected function writeFill(XMLWriter $objWriter, $pFill) |
|
147 | { |
||
148 | 79 | if (! $pFill instanceof Fill) { |
|
149 | return; |
||
150 | } |
||
151 | |||
152 | // Is it a fill? |
||
153 | 79 | if ($pFill->getFillType() == Fill::FILL_NONE) { |
|
154 | 71 | $objWriter->writeElement('a:noFill'); |
|
155 | 71 | return; |
|
156 | } |
||
157 | |||
158 | // Is it a solid fill? |
||
159 | 18 | if ($pFill->getFillType() == Fill::FILL_SOLID) { |
|
160 | 13 | $this->writeSolidFill($objWriter, $pFill); |
|
161 | 13 | return; |
|
162 | } |
||
163 | |||
164 | // Check if this is a pattern type or gradient type |
||
165 | 6 | if ($pFill->getFillType() == Fill::FILL_GRADIENT_LINEAR || $pFill->getFillType() == Fill::FILL_GRADIENT_PATH) { |
|
166 | // Gradient fill |
||
167 | 5 | $this->writeGradientFill($objWriter, $pFill); |
|
168 | 5 | } else { |
|
169 | // Pattern fill |
||
170 | 1 | $this->writePatternFill($objWriter, $pFill); |
|
171 | } |
||
172 | 6 | } |
|
173 | |||
174 | /** |
||
175 | * Write Solid Fill |
||
176 | * |
||
177 | * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer |
||
178 | * @param \PhpOffice\PhpPresentation\Style\Fill $pFill Fill style |
||
179 | * @throws \Exception |
||
180 | */ |
||
181 | 13 | protected function writeSolidFill(XMLWriter $objWriter, Fill $pFill) |
|
188 | |||
189 | /** |
||
190 | * Write Gradient Fill |
||
191 | * |
||
192 | * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer |
||
193 | * @param \PhpOffice\PhpPresentation\Style\Fill $pFill Fill style |
||
194 | * @throws \Exception |
||
195 | */ |
||
196 | 5 | protected function writeGradientFill(XMLWriter $objWriter, Fill $pFill) |
|
225 | |||
226 | /** |
||
227 | * Write Pattern Fill |
||
228 | * |
||
229 | * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer |
||
230 | * @param \PhpOffice\PhpPresentation\Style\Fill $pFill Fill style |
||
231 | * @throws \Exception |
||
232 | */ |
||
233 | 1 | protected function writePatternFill(XMLWriter $objWriter, Fill $pFill) |
|
254 | |||
255 | /** |
||
256 | * Write Outline |
||
257 | * @param XMLWriter $objWriter |
||
258 | * @param Outline $oOutline |
||
259 | */ |
||
260 | 28 | protected function writeOutline(XMLWriter $objWriter, $oOutline) |
|
282 | |||
283 | /** |
||
284 | * Determine absolute zip path |
||
285 | * |
||
286 | * @param string $path |
||
287 | * @return string |
||
288 | */ |
||
289 | protected function absoluteZipPath($path) |
||
310 | } |
||
311 |