Device.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Http
  17. * @subpackage UserAgent
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. /**
  22. * Interface defining a browser device type.
  23. *
  24. * @category Zend
  25. * @package Zend_Http
  26. * @subpackage UserAgent
  27. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  28. * @license http://framework.zend.com/license/new-bsd New BSD License
  29. */
  30. interface Zend_Http_UserAgent_Device extends Serializable
  31. {
  32. /**
  33. * Constructor
  34. *
  35. * Allows injecting user agent, server array, and/or config array. If an
  36. * array is provided for the first argument, the assumption should be that
  37. * the device object is being seeded with cached values from serialization.
  38. *
  39. * @param null|string|array $userAgent
  40. * @param array $server
  41. * @param array $config
  42. * @return void
  43. */
  44. public function __construct($userAgent = null, array $server = array(), array $config = array());
  45. /**
  46. * Attempt to match the user agent
  47. *
  48. * Return either an array of browser signature strings, or a boolean.
  49. *
  50. * @param string $userAgent
  51. * @param array $server
  52. * @return bool|array
  53. */
  54. public static function match($userAgent, $server);
  55. /**
  56. * Get all browser/device features
  57. *
  58. * @return array
  59. */
  60. public function getAllFeatures();
  61. /**
  62. * Get all of the browser/device's features' groups
  63. *
  64. * @return void
  65. */
  66. public function getAllGroups();
  67. /**
  68. * Whether or not the device has a given feature
  69. *
  70. * @param string $feature
  71. * @return bool
  72. */
  73. public function hasFeature($feature);
  74. /**
  75. * Get the value of a specific device feature
  76. *
  77. * @param string $feature
  78. * @return mixed
  79. */
  80. public function getFeature($feature);
  81. /**
  82. * Get the browser type
  83. *
  84. * @return string
  85. */
  86. public function getBrowser();
  87. /**
  88. * Retrurn the browser version
  89. *
  90. * @return string
  91. */
  92. public function getBrowserVersion();
  93. /**
  94. * Get an array of features associated with a group
  95. *
  96. * @param string $group
  97. * @return array
  98. */
  99. public function getGroup($group);
  100. /**
  101. * Retrieve image format support
  102. *
  103. * @return array
  104. */
  105. public function getImageFormatSupport();
  106. /**
  107. * Get image types
  108. *
  109. * @return array
  110. */
  111. public function getImages();
  112. /**
  113. * Get the maximum image height supported by this device
  114. *
  115. * @return int
  116. */
  117. public function getMaxImageHeight();
  118. /**
  119. * Get the maximum image width supported by this device
  120. *
  121. * @return int
  122. */
  123. public function getMaxImageWidth();
  124. /**
  125. * Get the physical screen height of this device
  126. *
  127. * @return int
  128. */
  129. public function getPhysicalScreenHeight();
  130. /**
  131. * Get the physical screen width of this device
  132. *
  133. * @return int
  134. */
  135. public function getPhysicalScreenWidth();
  136. /**
  137. * Get the preferred markup type
  138. *
  139. * @return string
  140. */
  141. public function getPreferredMarkup();
  142. /**
  143. * Get the user agent string
  144. *
  145. * @return string
  146. */
  147. public function getUserAgent();
  148. /**
  149. * Get supported X/HTML version
  150. *
  151. * @return int
  152. */
  153. public function getXhtmlSupportLevel();
  154. /**
  155. * Does the device support Flash?
  156. *
  157. * @return bool
  158. */
  159. public function hasFlashSupport();
  160. /**
  161. * Does the device support PDF?
  162. *
  163. * @return bool
  164. */
  165. public function hasPdfSupport();
  166. /**
  167. * Does the device have a phone number associated with it?
  168. *
  169. * @return bool
  170. */
  171. public function hasPhoneNumber();
  172. /**
  173. * Does the device support HTTPS?
  174. *
  175. * @return bool
  176. */
  177. public function httpsSupport();
  178. }