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