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