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