2d534b4756c4b6a33a4b808879f20d4188160a9c.svn-base 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. /**
  3. * PHPExcel
  4. *
  5. * Copyright (c) 2006 - 2014 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_Cell
  23. * @copyright Copyright (c) 2006 - 2014 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_Cell_Hyperlink
  29. *
  30. * @category PHPExcel
  31. * @package PHPExcel_Cell
  32. * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
  33. */
  34. class PHPExcel_Cell_Hyperlink
  35. {
  36. /**
  37. * URL to link the cell to
  38. *
  39. * @var string
  40. */
  41. private $_url;
  42. /**
  43. * Tooltip to display on the hyperlink
  44. *
  45. * @var string
  46. */
  47. private $_tooltip;
  48. /**
  49. * Create a new PHPExcel_Cell_Hyperlink
  50. *
  51. * @param string $pUrl Url to link the cell to
  52. * @param string $pTooltip Tooltip to display on the hyperlink
  53. */
  54. public function __construct($pUrl = '', $pTooltip = '')
  55. {
  56. // Initialise member variables
  57. $this->_url = $pUrl;
  58. $this->_tooltip = $pTooltip;
  59. }
  60. /**
  61. * Get URL
  62. *
  63. * @return string
  64. */
  65. public function getUrl() {
  66. return $this->_url;
  67. }
  68. /**
  69. * Set URL
  70. *
  71. * @param string $value
  72. * @return PHPExcel_Cell_Hyperlink
  73. */
  74. public function setUrl($value = '') {
  75. $this->_url = $value;
  76. return $this;
  77. }
  78. /**
  79. * Get tooltip
  80. *
  81. * @return string
  82. */
  83. public function getTooltip() {
  84. return $this->_tooltip;
  85. }
  86. /**
  87. * Set tooltip
  88. *
  89. * @param string $value
  90. * @return PHPExcel_Cell_Hyperlink
  91. */
  92. public function setTooltip($value = '') {
  93. $this->_tooltip = $value;
  94. return $this;
  95. }
  96. /**
  97. * Is this hyperlink internal? (to another worksheet)
  98. *
  99. * @return boolean
  100. */
  101. public function isInternal() {
  102. return strpos($this->_url, 'sheet://') !== false;
  103. }
  104. /**
  105. * Get hash code
  106. *
  107. * @return string Hash code
  108. */
  109. public function getHashCode() {
  110. return md5(
  111. $this->_url
  112. . $this->_tooltip
  113. . __CLASS__
  114. );
  115. }
  116. }