Extrusion.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. /**
  3. * This file is part of PHPWord - A pure PHP library for reading and writing
  4. * word processing documents.
  5. *
  6. * PHPWord 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/PHPWord/contributors.
  12. *
  13. * @see https://github.com/PHPOffice/PHPWord
  14. * @copyright 2010-2018 PHPWord contributors
  15. * @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
  16. */
  17. namespace PhpOffice\PhpWord\Style;
  18. /**
  19. * 3D extrusion style
  20. *
  21. * @see http://www.schemacentral.com/sc/ooxml/t-o_CT_Extrusion.html
  22. * @since 0.12.0
  23. */
  24. class Extrusion extends AbstractStyle
  25. {
  26. /**
  27. * Type constants
  28. *
  29. * @const string
  30. */
  31. const EXTRUSION_PARALLEL = 'parallel';
  32. const EXTRUSION_PERSPECTIVE = 'perspective';
  33. /**
  34. * Type: parallel|perspective
  35. *
  36. * @var string
  37. */
  38. private $type;
  39. /**
  40. * Color
  41. *
  42. * @var string
  43. */
  44. private $color;
  45. /**
  46. * Create a new instance
  47. *
  48. * @param array $style
  49. */
  50. public function __construct($style = array())
  51. {
  52. $this->setStyleByArray($style);
  53. }
  54. /**
  55. * Get type
  56. *
  57. * @return string
  58. */
  59. public function getType()
  60. {
  61. return $this->type;
  62. }
  63. /**
  64. * Set pattern
  65. *
  66. * @param string $value
  67. * @return self
  68. */
  69. public function setType($value = null)
  70. {
  71. $enum = array(self::EXTRUSION_PARALLEL, self::EXTRUSION_PERSPECTIVE);
  72. $this->type = $this->setEnumVal($value, $enum, null);
  73. return $this;
  74. }
  75. /**
  76. * Get color
  77. *
  78. * @return string
  79. */
  80. public function getColor()
  81. {
  82. return $this->color;
  83. }
  84. /**
  85. * Set color
  86. *
  87. * @param string $value
  88. * @return self
  89. */
  90. public function setColor($value = null)
  91. {
  92. $this->color = $value;
  93. return $this;
  94. }
  95. }