Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
7 / 7
CRAP
100.00% covered (success)
100.00%
12 / 12
AutoShape
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
7 / 7
7
100.00% covered (success)
100.00%
12 / 12
 __construct
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
 getText
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 setText
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 getType
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 setType
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 getOutline
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 setOutline
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
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 * @see        https://github.com/PHPOffice/PHPPresentation
14 *
15 * @copyright   2009-2015 PHPPresentation contributors
16 * @license     http://www.gnu.org/licenses/lgpl.txt LGPL version 3
17 */
18
19declare(strict_types=1);
20
21namespace PhpOffice\PhpPresentation\Shape;
22
23use PhpOffice\PhpPresentation\AbstractShape;
24use PhpOffice\PhpPresentation\ComparableInterface;
25use PhpOffice\PhpPresentation\Style\Outline;
26
27/**
28 * AutoShape shape
29 *
30 * @see : https://github.com/scanny/python-pptx/blob/eaa1e0fd3db28b03a353e116a5c7d2084dd87c26/pptx/enum/shapes.py
31 */
32class AutoShape extends AbstractShape implements ComparableInterface
33{
34    public const TYPE_10_POINT_STAR = 'star10';
35    public const TYPE_12_POINT_STAR = 'star12';
36    public const TYPE_16_POINT_STAR = 'star16';
37    public const TYPE_24_POINT_STAR = 'star24';
38    public const TYPE_32_POINT_STAR = 'star32';
39    public const TYPE_4_POINT_STAR = 'star4';
40    public const TYPE_5_POINT_STAR = 'star5';
41    public const TYPE_6_POINT_STAR = 'star6';
42    public const TYPE_7_POINT_STAR = 'star7';
43    public const TYPE_8_POINT_STAR = 'star8';
44    public const TYPE_ACTION_BUTTON_BACK_OR_PREVIOUS = 'actionButtonBackPrevious';
45    public const TYPE_ACTION_BUTTON_BEGINNING = 'actionButtonBeginning';
46    public const TYPE_ACTION_BUTTON_CUSTOM = 'actionButtonBlank';
47    public const TYPE_ACTION_BUTTON_DOCUMENT = 'actionButtonDocument';
48    public const TYPE_ACTION_BUTTON_END = 'actionButtonEnd';
49    public const TYPE_ACTION_BUTTON_FORWARD_OR_NEXT = 'actionButtonForwardNext';
50    public const TYPE_ACTION_BUTTON_HELP = 'actionButtonHelp';
51    public const TYPE_ACTION_BUTTON_HOME = 'actionButtonHome';
52    public const TYPE_ACTION_BUTTON_INFORMATION = 'actionButtonInformation';
53    public const TYPE_ACTION_BUTTON_MOVIE = 'actionButtonMovie';
54    public const TYPE_ACTION_BUTTON_RETURN = 'actionButtonReturn';
55    public const TYPE_ACTION_BUTTON_SOUND = 'actionButtonSound';
56    public const TYPE_ARC = 'arc';
57    public const TYPE_BALLOON = 'wedgeRoundRectCallout';
58    public const TYPE_BENT_ARROW = 'bentArrow';
59    public const TYPE_BENT_UP_ARROW = 'bentUpArrow';
60    public const TYPE_BEVEL = 'bevel';
61    public const TYPE_BLOCK_ARC = 'blockArc';
62    public const TYPE_CAN = 'can';
63    public const TYPE_CHART_PLUS = 'chartPlus';
64    public const TYPE_CHART_STAR = 'chartStar';
65    public const TYPE_CHARTX = 'chartX';
66    public const TYPE_CHEVRON = 'chevron';
67    public const TYPE_CHORD = 'chord';
68    public const TYPE_CIRCULAR_ARROW = 'circularArrow';
69    public const TYPE_CLOUD = 'cloud';
70    public const TYPE_CLOUD_CALLOUT = 'cloudCallout';
71    public const TYPE_CORNER = 'corner';
72    public const TYPE_CORNER_TABS = 'cornerTabs';
73    public const TYPE_CROSS = 'plus';
74    public const TYPE_CUBE = 'cube';
75    public const TYPE_CURVED_DOWN_ARROW = 'curvedDownArrow';
76    public const TYPE_CURVED_DOWN_RIBBON = 'ellipseRibbon';
77    public const TYPE_CURVED_LEFT_ARROW = 'curvedLeftArrow';
78    public const TYPE_CURVED_RIGHT_ARROW = 'curvedRightArrow';
79    public const TYPE_CURVED_UP_ARROW = 'curvedUpArrow';
80    public const TYPE_CURVED_UP_RIBBON = 'ellipseRibbon2';
81    public const TYPE_DECAGON = 'decagon';
82    public const TYPE_DIAGONALSTRIPE = 'diagStripe';
83    public const TYPE_DIAMOND = 'diamond';
84    public const TYPE_DODECAGON = 'dodecagon';
85    public const TYPE_DONUT = 'donut';
86    public const TYPE_DOUBLE_BRACE = 'bracePair';
87    public const TYPE_DOUBLE_BRACKET = 'bracketPair';
88    public const TYPE_DOUBLE_WAVE = 'doubleWave';
89    public const TYPE_DOWN_ARROW = 'downArrow';
90    public const TYPE_DOWN_ARROWCALLOUT = 'downArrowCallout';
91    public const TYPE_DOWN_RIBBON = 'ribbon';
92    public const TYPE_EXPLOSIONEXPLOSION1 = 'irregularSeal1';
93    public const TYPE_EXPLOSIONEXPLOSION2 = 'irregularSeal2';
94    public const TYPE_FLOWCHART_ALTERNATEPROCESS = 'flowChartAlternateProcess';
95    public const TYPE_FLOWCHART_CARD = 'flowChartPunchedCard';
96    public const TYPE_FLOWCHART_COLLATE = 'flowChartCollate';
97    public const TYPE_FLOWCHART_CONNECTOR = 'flowChartConnector';
98    public const TYPE_FLOWCHART_DATA = 'flowChartInputOutput';
99    public const TYPE_FLOWCHART_DECISION = 'flowChartDecision';
100    public const TYPE_FLOWCHART_DELAY = 'flowChartDelay';
101    public const TYPE_FLOWCHART_DIRECT_ACCESS_STORAGE = 'flowChartMagneticDrum';
102    public const TYPE_FLOWCHART_DISPLAY = 'flowChartDisplay';
103    public const TYPE_FLOWCHART_DOCUMENT = 'flowChartDocument';
104    public const TYPE_FLOWCHART_EXTRACT = 'flowChartExtract';
105    public const TYPE_FLOWCHART_INTERNAL_STORAGE = 'flowChartInternalStorage';
106    public const TYPE_FLOWCHART_MAGNETIC_DISK = 'flowChartMagneticDisk';
107    public const TYPE_FLOWCHART_MANUAL_INPUT = 'flowChartManualInput';
108    public const TYPE_FLOWCHART_MANUAL_OPERATION = 'flowChartManualOperation';
109    public const TYPE_FLOWCHART_MERGE = 'flowChartMerge';
110    public const TYPE_FLOWCHART_MULTIDOCUMENT = 'flowChartMultidocument';
111    public const TYPE_FLOWCHART_OFFLINE_STORAGE = 'flowChartOfflineStorage';
112    public const TYPE_FLOWCHART_OFFPAGE_CONNECTOR = 'flowChartOffpageConnector';
113    public const TYPE_FLOWCHART_OR = 'flowChartOr';
114    public const TYPE_FLOWCHART_PREDEFINED_PROCESS = 'flowChartPredefinedProcess';
115    public const TYPE_FLOWCHART_PREPARATION = 'flowChartPreparation';
116    public const TYPE_FLOWCHART_PROCESS = 'flowChartProcess';
117    public const TYPE_FLOWCHART_PUNCHEDTAPE = 'flowChartPunchedTape';
118    public const TYPE_FLOWCHART_SEQUENTIAL_ACCESS_STORAGE = 'flowChartMagneticTape';
119    public const TYPE_FLOWCHART_SORT = 'flowChartSort';
120    public const TYPE_FLOWCHART_STORED_DATA = 'flowChartOnlineStorage';
121    public const TYPE_FLOWCHART_SUMMING_JUNCTION = 'flowChartSummingJunction';
122    public const TYPE_FLOWCHART_TERMINATOR = 'flowChartTerminator';
123    public const TYPE_FOLDED_CORNER = 'foldedCorner';
124    public const TYPE_FRAME = 'frame';
125    public const TYPE_FUNNEL = 'funnel';
126    public const TYPE_GEAR_6 = 'gear6';
127    public const TYPE_GEAR_9 = 'gear9';
128    public const TYPE_HALF_FRAME = 'halfFrame';
129    public const TYPE_HEART = 'heart';
130    public const TYPE_HEPTAGON = 'heptagon';
131    public const TYPE_HEXAGON = 'hexagon';
132    public const TYPE_HORIZONTAL_SCROLL = 'horizontalScroll';
133    public const TYPE_ISOSCELES_TRIANGLE = 'triangle';
134    public const TYPE_LEFT_ARROW = 'leftArrow';
135    public const TYPE_LEFT_ARROW_CALLOUT = 'leftArrowCallout';
136    public const TYPE_LEFT_BRACE = 'leftBrace';
137    public const TYPE_LEFT_BRACKET = 'leftBracket';
138    public const TYPE_LEFT_CIRCULAR_ARROW = 'leftCircularArrow';
139    public const TYPE_LEFT_RIGHT_ARROW = 'leftRightArrow';
140    public const TYPE_LEFT_RIGHT_ARROW_CALLOUT = 'leftRightArrowCallout';
141    public const TYPE_LEFT_RIGHT_CIRCULAR_ARROW = 'leftRightCircularArrow';
142    public const TYPE_LEFT_RIGHT_RIBBON = 'leftRightRibbon';
143    public const TYPE_LEFT_RIGHT_UP_ARROW = 'leftRightUpArrow';
144    public const TYPE_LEFT_UP_ARROW = 'leftUpArrow';
145    public const TYPE_LIGHTNING_BOLT = 'lightningBolt';
146    public const TYPE_LINE_CALLOUT_1 = 'borderCallout1';
147    public const TYPE_LINE_CALLOUT_1_ACCENT_BAR = 'accentCallout1';
148    public const TYPE_LINE_CALLOUT_1_BORDER_AND_ACCENT_BAR = 'accentBorderCallout1';
149    public const TYPE_LINE_CALLOUT_1_NO_BORDER = 'callout1';
150    public const TYPE_LINE_CALLOUT_2 = 'borderCallout2';
151    public const TYPE_LINE_CALLOUT_2_ACCENT_BAR = 'accentCallout2';
152    public const TYPE_LINE_CALLOUT_2_BORDER_AND_ACCENT_BAR = 'accentBorderCallout2';
153    public const TYPE_LINE_CALLOUT_2_NO_BORDER = 'callout2';
154    public const TYPE_LINE_CALLOUT_3 = 'borderCallout3';
155    public const TYPE_LINE_CALLOUT_3_ACCENT_BAR = 'accentCallout3';
156    public const TYPE_LINE_CALLOUT_3_BORDER_AND_ACCENT_BAR = 'accentBorderCallout3';
157    public const TYPE_LINE_CALLOUT_3_NO_BORDER = 'callout3';
158    public const TYPE_LINE_CALLOUT_4 = 'borderCallout4';
159    public const TYPE_LINE_CALLOUT_4_ACCENT_BAR = 'accentCallout4';
160    public const TYPE_LINE_CALLOUT_4_BORDER_AND_ACCENT_BAR = 'accentBorderCallout4';
161    public const TYPE_LINE_CALLOUT_4_NO_BORDER = 'callout4';
162    public const TYPE_LINE_INVERSE = 'lineInv';
163    public const TYPE_MATH_DIVIDE = 'mathDivide';
164    public const TYPE_MATH_EQUAL = 'mathEqual';
165    public const TYPE_MATH_MINUS = 'mathMinus';
166    public const TYPE_MATH_MULTIPLY = 'mathMultiply';
167    public const TYPE_MATH_NOT_EQUAL = 'mathNotEqual';
168    public const TYPE_MATH_PLUS = 'mathPlus';
169    //public const TYPE_MIXED = '';
170    public const TYPE_MOON = 'moon';
171    public const TYPE_NON_ISOSCELES_TRAPEZOID = 'nonIsoscelesTrapezoid';
172    public const TYPE_NO_SYMBOL = 'noSmoking';
173    public const TYPE_NOTCHED_RIGHT_ARROW = 'notchedRightArrow';
174    //public const TYPE_NOTPRIMITIVE = '';
175    public const TYPE_OCTAGON = 'octagon';
176    public const TYPE_OVAL = 'ellipse';
177    public const TYPE_OVAL_CALLOUT = 'wedgeEllipseCallout';
178    public const TYPE_PARALLELOGRAM = 'parallelogram';
179    public const TYPE_PENTAGON = 'homePlate';
180    public const TYPE_PIE = 'pie';
181    public const TYPE_PIE_WEDGE = 'pieWedge';
182    public const TYPE_PLAQUE = 'plaque';
183    public const TYPE_PLAQUE_TABS = 'plaqueTabs';
184    public const TYPE_QUAD_ARROW = 'quadArrow';
185    public const TYPE_QUAD_ARROW_CALLOUT = 'quadArrowCallout';
186    public const TYPE_RECTANGLE = 'rect';
187    public const TYPE_RECTANGULAR_CALLOUT = 'wedgeRectCallout';
188    public const TYPE_REGULARP_ENTAGON = 'pentagon';
189    public const TYPE_RIGHT_ARROW = 'rightArrow';
190    public const TYPE_RIGHT_ARROW_CALLOUT = 'rightArrowCallout';
191    public const TYPE_RIGHT_BRACE = 'rightBrace';
192    public const TYPE_RIGHT_BRACKET = 'rightBracket';
193    public const TYPE_RIGHT_TRIANGLE = 'rtTriangle';
194    public const TYPE_ROUND_1_RECTANGLE = 'round1Rect';
195    public const TYPE_ROUND_2_DIAG_RECTANGLE = 'round2DiagRect';
196    public const TYPE_ROUND_2_SAME_RECTANGLE = 'round2SameRect';
197    public const TYPE_ROUNDED_RECTANGLE = 'roundRect';
198    public const TYPE_ROUNDED_RECTANGULAR_CALLOUT = 'wedgeRoundRectCallout';
199    public const TYPE_SMILEY_FACE = 'smileyFace';
200    public const TYPE_SNIP_1_RECTANGLE = 'snip1Rect';
201    public const TYPE_SNIP_2_DIAG_RECTANGLE = 'snip2DiagRect';
202    public const TYPE_SNIP_2_SAME_RECTANGLE = 'snip2SameRect';
203    public const TYPE_SNIP_ROUND_RECTANGLE = 'snipRoundRect';
204    public const TYPE_SQUARE_TABS = 'squareTabs';
205    public const TYPE_STRIPED_RIGHT_ARROW = 'stripedRightArrow';
206    public const TYPE_SUN = 'sun';
207    public const TYPE_SWOOSH_ARROW = 'swooshArrow';
208    public const TYPE_TEAR = 'teardrop';
209    public const TYPE_TRAPEZOID = 'trapezoid';
210    public const TYPE_UP_ARROW = 'upArrow';
211    public const TYPE_UP_ARROW_CALLOUT = 'upArrowCallout';
212    public const TYPE_UP_DOWN_ARROW = 'upDownArrow';
213    public const TYPE_UP_DOWN_ARROW_CALLOUT = 'upDownArrowCallout';
214    public const TYPE_UP_RIBBON = 'ribbon2';
215    public const TYPE_U_TURN_ARROW = 'uturnArrow';
216    public const TYPE_VERTICAL_SCROLL = 'verticalScroll';
217    public const TYPE_WAVE = 'wave';
218
219    /**
220     * @var string
221     */
222    protected $text = '';
223
224    /**
225     * @var string
226     */
227    protected $type = self::TYPE_HEART;
228
229    /**
230     * @var Outline
231     */
232    protected $outline;
233
234    public function __construct()
235    {
236        parent::__construct();
237
238        $this->outline = new Outline();
239    }
240
241    /**
242     * @return string
243     */
244    public function getText(): string
245    {
246        return $this->text;
247    }
248
249    /**
250     * @param string $text
251     *
252     * @return self
253     */
254    public function setText(string $text): self
255    {
256        $this->text = $text;
257
258        return $this;
259    }
260
261    /**
262     * @return string
263     */
264    public function getType(): string
265    {
266        return $this->type;
267    }
268
269    /**
270     * @param string $type
271     *
272     * @return self
273     */
274    public function setType(string $type): self
275    {
276        $this->type = $type;
277
278        return $this;
279    }
280
281    /**
282     * @return Outline
283     */
284    public function getOutline(): Outline
285    {
286        return $this->outline;
287    }
288
289    /**
290     * @param Outline $outline
291     *
292     * @return self
293     */
294    public function setOutline(Outline $outline): self
295    {
296        $this->outline = $outline;
297
298        return $this;
299    }
300}