[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/SyncML/ -> DeviceInfo.php (source)

   1  <?php
   2  /**
   3   * SyncML_DeviceInfo represents a device information set according to the
   4   * SyncML spec.
   5   *
   6   * See http://www.syncml.org/docs/syncml_devinf_v11_20020215.pdf
   7   *
   8   * A DeviceInfo object is created by Command/Put::SyncML_Command_Put from an
   9   * appropriate XML message. SyncML_Command_Put directly populates the members
  10   * variables.
  11   *
  12   * The current implementation should handle all DevInf 1.1 DTD elements
  13   * expcept DSMem entries.
  14   *
  15   * Copyright 2005-2006 Karsten Fourmont <karsten@horde.org>
  16   *
  17   * See the enclosed file COPYING for license information (LGPL). If you
  18   * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  19   *
  20   * $Horde: framework/SyncML/SyncML/DeviceInfo.php,v 1.2.2.6 2006/05/05 21:14:45 karsten Exp $
  21   *
  22   * @author  Karsten Fourmont <karsten@horde.org>
  23   * @package SyncML
  24   */
  25  class SyncML_DeviceInfo {
  26  
  27      var $_VerDTD;
  28      var $_Man;
  29      var $_Mod;
  30      var $_OEM;
  31      var $_FwV;
  32      var $_SwV;
  33      var $_HwV;
  34      var $_DevID;
  35      var $_DevTyp;
  36  
  37      /**
  38       * Array of SyncML_DataStore objects.
  39       */
  40      var $_DataStore;
  41  
  42      /**
  43       * Array: CTType => array: PropertyName => SyncML_Property object.
  44       */
  45      var $_CTCap;
  46  
  47      /**
  48       * Array XNam => array of Xval entries.
  49       */
  50      var $_Ext;
  51  
  52      /**
  53       * @var boolean
  54       */
  55      var $_UTC;
  56  
  57      /**
  58       * @var boolean
  59       */
  60      var $_SupportLargeObjs;
  61  
  62      /**
  63       * @var boolean
  64       */
  65      var $_SupportNumberOfChanges;
  66  
  67  
  68      /**
  69       * Returns the DevInf data for a datastore identified by $sourceURI
  70       * (_SourceRef parameter).  Returns a SyncML_DataStore object or null if
  71       * no such datastore exists.
  72       */ 
  73      function getDataStore($sourceURI)
  74      {
  75  
  76          if (is_array($this->_DataStore)) {
  77              foreach ($this->_DataStore as $v) {
  78                  if ($v->_SourceRef == $sourceURI) {
  79                      return $v;
  80                  }
  81              }
  82          }
  83          return null;
  84      }
  85  }
  86  
  87  /**
  88   * The SyncML_DataStore class describes one of the possible datastores
  89   * (i.e. databases) of the device.  Most important attributes are the
  90   * preferred Mime Types for sending and receiving data for this datastore:
  91   * _Tx-Pref and _Rx-Pref
  92   *
  93   * @package SyncML
  94   */
  95  class SyncML_DataStore {
  96  
  97      /**
  98       * The local URI of the datastore.
  99       */
 100      var $_SourceRef;
 101  
 102      /**
 103       * Optional.
 104       */
 105      var $_DisplayName;
 106  
 107      /**
 108       * Optional.
 109       */
 110      var $_MaxGUIDSize;
 111  
 112      /**
 113       * One element array of CTType => VerCT
 114       */
 115      var $_Rx_Pref;
 116  
 117      /**
 118       * Array of CTType => VerCT
 119       */
 120      var $_Rx;
 121  
 122      /**
 123       * One element array of CTType => VerCT
 124       */
 125      var $_Tx_Pref;
 126  
 127      /**
 128       * Array of CTType => VerCT
 129       */
 130      var $_Tx;
 131  
 132      /**
 133       * Optional.
 134       */
 135      var $_DSMem;
 136  
 137      /**
 138       * Array SyncType => true
 139       */
 140      var $_SyncCap;
 141  
 142      /**
 143       * Returns the preferred contentype the client wants to receive (RX). Or
 144       * NULL if not specified (which is not allowed by protocol).
 145       */
 146      function getPreferredRXContentType()
 147      {
 148          if (is_array($this->_Rx_Pref)) {
 149              $r = array_keys($this->_Rx_Pref);
 150              return $r[0];
 151          }
 152          return null;
 153      }
 154  
 155      /**
 156       * Returns the version of the preferred contentype the client wants to
 157       * receive (RX). Or NULL if not specified (which is not allowed by
 158       * protocol).
 159       */
 160      function getPreferredRXContentTypeVersion()
 161      {
 162          if (is_array($this->_Rx_Pref)) {
 163              $r = array_values($this->_Rx_Pref);
 164              return $r[0];
 165          }
 166          return NULL;
 167      }
 168  }
 169  
 170  /**
 171   * The class SyncML_Property is used to define a single property of a vcard
 172   * element.  The contents of a Property can be defined by an enumeration of
 173   * valid values (_ValEnum) or by a DataType/Size combination, or not at all.
 174   *
 175   * @package SyncML
 176   */
 177  class SyncML_Property {
 178  
 179      /**
 180       * Array of valid values => true
 181       */
 182      var $_ValEnum;
 183  
 184      /**
 185       * If not ValEnum.
 186       */
 187      var $_DataType;
 188  
 189      /**
 190       * If not ValEnum, optional.
 191       */
 192      var $_Size;
 193  
 194      /**
 195       * Optional.
 196       */
 197      var $_DisplayName;
 198  
 199      /**
 200       * Array of ParamName => SyncML_PropertyParameter
 201       */
 202      var $_params;
 203  
 204  }
 205  
 206  /**
 207   * The class SyncML_PropertyParameter is used to define a single parameter of
 208   * a property of a vcard element.  The contents of a PropertyParameter can be
 209   * defined by an enumeration of valid values (_ValEnum) or by a DataType/Size
 210   * combination, or not at all.
 211   *
 212   * @package SyncML
 213   */
 214  class SyncML_PropertyParameter {
 215  
 216      /**
 217       * If provided: array of ValEnum => true
 218       */
 219      var $_ValEnum;
 220  
 221      /**
 222       * If not ValEnum.
 223       */
 224      var $_DataType;
 225  
 226      /**
 227       * If not ValEnum, optional.
 228       */
 229      var $_Size;
 230  
 231      /**
 232       * Optional.
 233       */
 234      var $_DisplayName;
 235  
 236  }


Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7