For God so loved the world, that He gave His only begotten Son, that all who believe in Him should not perish but have everlasting life
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
3.0 KiB

  1. <?php
  2. /**
  3. * PHPExcel
  4. *
  5. * Copyright (c) 2006 - 2015 PHPExcel
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. *
  21. * @category PHPExcel
  22. * @package PHPExcel_Reader_Excel2007
  23. * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
  24. * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
  25. * @version ##VERSION##, ##DATE##
  26. */
  27. /**
  28. * PHPExcel_Reader_Excel2007_Theme
  29. *
  30. * @category PHPExcel
  31. * @package PHPExcel_Reader_Excel2007
  32. * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
  33. */
  34. class PHPExcel_Reader_Excel2007_Theme
  35. {
  36. /**
  37. * Theme Name
  38. *
  39. * @var string
  40. */
  41. private $themeName;
  42. /**
  43. * Colour Scheme Name
  44. *
  45. * @var string
  46. */
  47. private $colourSchemeName;
  48. /**
  49. * Colour Map indexed by position
  50. *
  51. * @var array of string
  52. */
  53. private $colourMapValues;
  54. /**
  55. * Colour Map
  56. *
  57. * @var array of string
  58. */
  59. private $colourMap;
  60. /**
  61. * Create a new PHPExcel_Theme
  62. *
  63. */
  64. public function __construct($themeName, $colourSchemeName, $colourMap)
  65. {
  66. // Initialise values
  67. $this->themeName = $themeName;
  68. $this->colourSchemeName = $colourSchemeName;
  69. $this->colourMap = $colourMap;
  70. }
  71. /**
  72. * Get Theme Name
  73. *
  74. * @return string
  75. */
  76. public function getThemeName()
  77. {
  78. return $this->themeName;
  79. }
  80. /**
  81. * Get colour Scheme Name
  82. *
  83. * @return string
  84. */
  85. public function getColourSchemeName()
  86. {
  87. return $this->colourSchemeName;
  88. }
  89. /**
  90. * Get colour Map Value by Position
  91. *
  92. * @return string
  93. */
  94. public function getColourByIndex($index = 0)
  95. {
  96. if (isset($this->colourMap[$index])) {
  97. return $this->colourMap[$index];
  98. }
  99. return null;
  100. }
  101. /**
  102. * Implement PHP __clone to create a deep clone, not just a shallow copy.
  103. */
  104. public function __clone()
  105. {
  106. $vars = get_object_vars($this);
  107. foreach ($vars as $key => $value) {
  108. if ((is_object($value)) && ($key != '_parent')) {
  109. $this->$key = clone $value;
  110. } else {
  111. $this->$key = $value;
  112. }
  113. }
  114. }
  115. }