PageMargins.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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_Worksheet
  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_Worksheet_PageMargins
  29. *
  30. * @category PHPExcel
  31. * @package PHPExcel_Worksheet
  32. * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
  33. */
  34. class PHPExcel_Worksheet_PageMargins
  35. {
  36. /**
  37. * Left
  38. *
  39. * @var double
  40. */
  41. private $left = 0.7;
  42. /**
  43. * Right
  44. *
  45. * @var double
  46. */
  47. private $right = 0.7;
  48. /**
  49. * Top
  50. *
  51. * @var double
  52. */
  53. private $top = 0.75;
  54. /**
  55. * Bottom
  56. *
  57. * @var double
  58. */
  59. private $bottom = 0.75;
  60. /**
  61. * Header
  62. *
  63. * @var double
  64. */
  65. private $header = 0.3;
  66. /**
  67. * Footer
  68. *
  69. * @var double
  70. */
  71. private $footer = 0.3;
  72. /**
  73. * Create a new PHPExcel_Worksheet_PageMargins
  74. */
  75. public function __construct()
  76. {
  77. }
  78. /**
  79. * Get Left
  80. *
  81. * @return double
  82. */
  83. public function getLeft()
  84. {
  85. return $this->left;
  86. }
  87. /**
  88. * Set Left
  89. *
  90. * @param double $pValue
  91. * @return PHPExcel_Worksheet_PageMargins
  92. */
  93. public function setLeft($pValue)
  94. {
  95. $this->left = $pValue;
  96. return $this;
  97. }
  98. /**
  99. * Get Right
  100. *
  101. * @return double
  102. */
  103. public function getRight()
  104. {
  105. return $this->right;
  106. }
  107. /**
  108. * Set Right
  109. *
  110. * @param double $pValue
  111. * @return PHPExcel_Worksheet_PageMargins
  112. */
  113. public function setRight($pValue)
  114. {
  115. $this->right = $pValue;
  116. return $this;
  117. }
  118. /**
  119. * Get Top
  120. *
  121. * @return double
  122. */
  123. public function getTop()
  124. {
  125. return $this->top;
  126. }
  127. /**
  128. * Set Top
  129. *
  130. * @param double $pValue
  131. * @return PHPExcel_Worksheet_PageMargins
  132. */
  133. public function setTop($pValue)
  134. {
  135. $this->top = $pValue;
  136. return $this;
  137. }
  138. /**
  139. * Get Bottom
  140. *
  141. * @return double
  142. */
  143. public function getBottom()
  144. {
  145. return $this->bottom;
  146. }
  147. /**
  148. * Set Bottom
  149. *
  150. * @param double $pValue
  151. * @return PHPExcel_Worksheet_PageMargins
  152. */
  153. public function setBottom($pValue)
  154. {
  155. $this->bottom = $pValue;
  156. return $this;
  157. }
  158. /**
  159. * Get Header
  160. *
  161. * @return double
  162. */
  163. public function getHeader()
  164. {
  165. return $this->header;
  166. }
  167. /**
  168. * Set Header
  169. *
  170. * @param double $pValue
  171. * @return PHPExcel_Worksheet_PageMargins
  172. */
  173. public function setHeader($pValue)
  174. {
  175. $this->header = $pValue;
  176. return $this;
  177. }
  178. /**
  179. * Get Footer
  180. *
  181. * @return double
  182. */
  183. public function getFooter()
  184. {
  185. return $this->footer;
  186. }
  187. /**
  188. * Set Footer
  189. *
  190. * @param double $pValue
  191. * @return PHPExcel_Worksheet_PageMargins
  192. */
  193. public function setFooter($pValue)
  194. {
  195. $this->footer = $pValue;
  196. return $this;
  197. }
  198. /**
  199. * Implement PHP __clone to create a deep clone, not just a shallow copy.
  200. */
  201. public function __clone()
  202. {
  203. $vars = get_object_vars($this);
  204. foreach ($vars as $key => $value) {
  205. if (is_object($value)) {
  206. $this->$key = clone $value;
  207. } else {
  208. $this->$key = $value;
  209. }
  210. }
  211. }
  212. }