PageMargins.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <?php
  2. /**
  3. * PHPExcel
  4. *
  5. * Copyright (c) 2006 - 2013 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 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
  24. * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
  25. * @version 1.7.9, 2013-06-02
  26. */
  27. /**
  28. * PHPExcel_Worksheet_PageMargins
  29. *
  30. * @category PHPExcel
  31. * @package PHPExcel_Worksheet
  32. * @copyright Copyright (c) 2006 - 2013 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. return $this->_left;
  85. }
  86. /**
  87. * Set Left
  88. *
  89. * @param double $pValue
  90. * @return PHPExcel_Worksheet_PageMargins
  91. */
  92. public function setLeft($pValue) {
  93. $this->_left = $pValue;
  94. return $this;
  95. }
  96. /**
  97. * Get Right
  98. *
  99. * @return double
  100. */
  101. public function getRight() {
  102. return $this->_right;
  103. }
  104. /**
  105. * Set Right
  106. *
  107. * @param double $pValue
  108. * @return PHPExcel_Worksheet_PageMargins
  109. */
  110. public function setRight($pValue) {
  111. $this->_right = $pValue;
  112. return $this;
  113. }
  114. /**
  115. * Get Top
  116. *
  117. * @return double
  118. */
  119. public function getTop() {
  120. return $this->_top;
  121. }
  122. /**
  123. * Set Top
  124. *
  125. * @param double $pValue
  126. * @return PHPExcel_Worksheet_PageMargins
  127. */
  128. public function setTop($pValue) {
  129. $this->_top = $pValue;
  130. return $this;
  131. }
  132. /**
  133. * Get Bottom
  134. *
  135. * @return double
  136. */
  137. public function getBottom() {
  138. return $this->_bottom;
  139. }
  140. /**
  141. * Set Bottom
  142. *
  143. * @param double $pValue
  144. * @return PHPExcel_Worksheet_PageMargins
  145. */
  146. public function setBottom($pValue) {
  147. $this->_bottom = $pValue;
  148. return $this;
  149. }
  150. /**
  151. * Get Header
  152. *
  153. * @return double
  154. */
  155. public function getHeader() {
  156. return $this->_header;
  157. }
  158. /**
  159. * Set Header
  160. *
  161. * @param double $pValue
  162. * @return PHPExcel_Worksheet_PageMargins
  163. */
  164. public function setHeader($pValue) {
  165. $this->_header = $pValue;
  166. return $this;
  167. }
  168. /**
  169. * Get Footer
  170. *
  171. * @return double
  172. */
  173. public function getFooter() {
  174. return $this->_footer;
  175. }
  176. /**
  177. * Set Footer
  178. *
  179. * @param double $pValue
  180. * @return PHPExcel_Worksheet_PageMargins
  181. */
  182. public function setFooter($pValue) {
  183. $this->_footer = $pValue;
  184. return $this;
  185. }
  186. /**
  187. * Implement PHP __clone to create a deep clone, not just a shallow copy.
  188. */
  189. public function __clone() {
  190. $vars = get_object_vars($this);
  191. foreach ($vars as $key => $value) {
  192. if (is_object($value)) {
  193. $this->$key = clone $value;
  194. } else {
  195. $this->$key = $value;
  196. }
  197. }
  198. }
  199. }