Home | History | Annotate | Download | only in native
      1 /*
      2  * Copyright (C) 2014 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifndef __DMTNODE_H__
     18 #define __DMTNODE_H__
     19 
     20 #ifndef __cplusplus
     21 #error "This is a C++ header file; it requires C++ to compile."
     22 #endif
     23 
     24 /**
     25  \file dmtNode.hpp
     26  \brief  The dmtNode.hpp header file contains DmtNode class definition. \n
     27                 DmtNode is the object representing tree nodes as they are\n
     28                 created and added to the tree. The class is NOT designed\n
     29                 to serve navigation of the DM Tree.
     30 */
     31 
     32 #include "jem_defs.hpp"
     33 
     34 #include "dmt.hpp"
     35 
     36 class DmtTree;
     37 
     38 /**
     39 DmtNode is the object representing tree nodes as they are
     40 created and added to the tree. The class is NOT designed
     41 for its objects to serve for navigation of the tree.
     42 Almost all methods return a smart pointer to the
     43 error description object if failed and NULL if succeeded
     44 
     45 <P>
     46 
     47 Sample usage:<P>
     48 
     49 <PRE>
     50    DmtPrincipal principal("localhost");
     51    PDmtTree ptrTree;
     52    SYNCML_DM_RET_STATUS_T ret_status ;
     53 
     54    if ( (ret_status = DmtFactory::GetTree(principal, ptrTree ) ) != SYNCML_DM_SUCCESS )
     55    {
     56      ... error handling
     57      return;
     58    }
     59 
     60    PDmtNode ptrNode;
     61 
     62    if ( (ret_status = ptrTree->GetNode( "./SyncML/DMAcc/GUID/AddrType", ptrNode ) ) != SYNCML_DM_SUCCESS )
     63    {
     64       ... error handling
     65      return;
     66    }
     67 
     68    std::string str;
     69    if ( (ptrError = ptrNode->GetStringValue( str )) != NULL )
     70    {
     71       ... error handling
     72      return;
     73    }
     74 
     75    printf( "String value is %s\n", str.c_str() );
     76 </PRE>
     77 * \par Category: General
     78 * \par Persistence: Transient
     79 * \par Security: Non-Secure
     80 * \par Migration State: FINAL
     81 */
     82 class DmtNode : public JemBaseObject
     83 {
     84 protected:
     85   /** Destructor - freeing all dynamic resources */
     86   virtual ~DmtNode(){}
     87 
     88 public:
     89   /**
     90   * Retrieves device management tree
     91   * \par Sync (or) Async:
     92   * This is a Synchronous function.
     93   * \par Secure (or) Non-Secure (or) N/A:
     94   * This is a Non-Secure function.
     95   * \param ptrTree [out] - reference to the DM tree
     96   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
     97   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
     98   * - All other codes indicates failure. The description can be found in dmtError.h
     99   * \par Prospective Clients:
    100   * All potential applications that require configuration settings.
    101   */
    102   virtual SYNCML_DM_RET_STATUS_T GetTree( PDmtTree& ptrTree ) const = 0;
    103 
    104   /**
    105   * Retrieves node path
    106   * \par Sync (or) Async:
    107   * This is a Synchronous function.
    108   * \par Secure (or) Non-Secure (or) N/A:
    109   * This is a Non-Secure function.
    110   * \param path [out] - reference to path in the tree
    111   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    112   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    113   * - All other codes indicates failure. The description can be found in dmtError.h
    114   * \par Prospective Clients:
    115   * All potential applications that require configuration settings.
    116   */
    117   virtual SYNCML_DM_RET_STATUS_T GetPath( DMString & path ) const = 0;
    118 
    119   /**
    120   * Gets a copy of DmtAttributes, user can modify the DmtAttributes individually.
    121   * \warning Any change made to DmtAttributes will not propagated to the Node until a setAttributes is called.
    122   * \par Sync (or) Async:
    123   * This is a Synchronous function.
    124   * \par Secure (or) Non-Secure (or) N/A:
    125   * This is a Non-Secure function.
    126   * \param  oAttr [out] - reference to DM tree attributes
    127   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    128   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    129   * - All other codes indicates failure. The description can be found in dmtError.h
    130   * \par Prospective Clients:
    131   * All potential applications that require configuration settings.
    132   */
    133   virtual SYNCML_DM_RET_STATUS_T GetAttributes( DmtAttributes& oAttr ) const = 0;
    134 
    135   /**
    136   * Updates title information for the node.
    137   * \par Sync (or) Async:
    138   * This is a Synchronous function.
    139   * \par Secure (or) Non-Secure (or) N/A:
    140   * This is a Non-Secure function.
    141   * \param szTitle [in] - node titles string
    142   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    143   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    144   * - All other codes indicates failure. The description can be found in dmtError.h
    145   * \par Prospective Clients:
    146   * All potential applications that require configuration settings.
    147   */
    148   virtual SYNCML_DM_RET_STATUS_T SetTitle( CPCHAR szTitle ) = 0;
    149 
    150   /**
    151    * Updates ACL for the node.
    152   * \par Sync (or) Async:
    153   * This is a Synchronous function.
    154   * \par Secure (or) Non-Secure (or) N/A:
    155   * This is a Non-Secure function.
    156   * \param oAcl [in] - reference to DMT ACL object
    157   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    158   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    159   * - All other codes indicates failure. The description can be found in dmtError.h
    160   * \par Prospective Clients:
    161   * All potential applications that require configuration settings.
    162   */
    163   virtual SYNCML_DM_RET_STATUS_T SetAcl( const DmtAcl& oAcl ) = 0;
    164 
    165   /**
    166   * The DmtValue is a copy of current data of the node. Could set empty DmtData object if there is no value associated with it.
    167   * \warning The node value will not be changed until a setValue is called.
    168   * \par Sync (or) Async:
    169   * This is a Synchronous function.
    170   * \par Secure (or) Non-Secure (or) N/A:
    171   * This is a Non-Secure function.
    172   * \param oData [out] - reference to DmtData object
    173   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    174   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    175   * - All other codes indicates failure. The description can be found in dmtError.h
    176   * \par Prospective Clients:
    177   * All potential applications that require configuration settings.
    178   */
    179   virtual SYNCML_DM_RET_STATUS_T GetValue( DmtData& oData ) const = 0;
    180 
    181   /**
    182   * Changes the value of a node. If not successful, return an error code.
    183   * \par Sync (or) Async:
    184   * This is a Synchronous function.
    185   * \par Secure (or) Non-Secure (or) N/A:
    186   * This is a Non-Secure function.
    187   * \param value [in] - new node value
    188   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    189   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    190   * - All other codes indicates failure. The description can be found in dmtError.h
    191   * \par Prospective Clients:
    192   * All potential applications that require configuration settings.
    193   */
    194   virtual SYNCML_DM_RET_STATUS_T SetValue( const DmtData& value ) = 0;
    195 
    196   /**
    197   * Fills in the vector oChildren list of child nodes.
    198   * \par Sync (or) Async:
    199   * This is a Synchronous function.
    200   * \par Secure (or) Non-Secure (or) N/A:
    201   * This is a Non-Secure function.
    202   * \param oChildren [out] - vector for child nodes
    203   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    204   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    205   * - All other codes indicates failure. The description can be found in dmtError.h
    206   * \par Prospective Clients:
    207   * All potential applications that require configuration settings.
    208   */
    209   virtual SYNCML_DM_RET_STATUS_T GetChildNodes( DMVector<PDmtNode>& oChildren ) const = 0;
    210 
    211 
    212   /**
    213   * Checks if a node is a leaf
    214   * \par Sync (or) Async:
    215   * This is a Synchronous function.
    216   * \par Secure (or) Non-Secure (or) N/A:
    217   * This is a Non-Secure function.
    218   * \return 'true' if the node is a leaf
    219   * \par Prospective Clients:
    220   * All potential applications that require configuration settings.
    221   */
    222   virtual BOOLEAN IsLeaf() const = 0;
    223 
    224   /**
    225   * Function sets child node object by name
    226   * \par Sync (or) Async:
    227   * This is a Synchronous function.
    228   * \par Secure (or) Non-Secure (or) N/A:
    229   * This is a Non-Secure function.
    230   * \param szPath [in] - name of node
    231   * \param ptrNode [out] - reference to DmtNode
    232   * \return status code
    233   * \par Prospective Clients:
    234   * All potential applications that require configuration settings.
    235   */
    236   virtual SYNCML_DM_RET_STATUS_T GetChildNode( CPCHAR szPath, PDmtNode& ptrNode ) = 0;
    237 
    238   /**
    239   * Executes a node according to the specified path, passing a String
    240   * parameter to the executable code
    241   * \warning This functions is  for internal usage only!!!
    242   * \par Sync (or) Async:
    243   * This is a Synchronous function.
    244   * \par Secure (or) Non-Secure (or) N/A:
    245   * This is a Non-Secure function.
    246   * \param strData [in] - data to be executed as a string
    247   * \param result [out] - the result of executing will be set to this string
    248   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    249   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    250   * - All other codes indicates failure. The description can be found in dmtError.h
    251   * \par Prospective Clients:
    252   * All potential applications that require configuration settings.
    253   */
    254   virtual SYNCML_DM_RET_STATUS_T Execute( CPCHAR strData, DMString& result ) = 0;
    255 
    256 
    257   /**
    258   * This is helper function: gets value of the node with type "string".
    259   * It is a shortcut to the GetValue()->GetString().
    260   * \par Sync (or) Async:
    261   * This is a Synchronous function.
    262   * \par Secure (or) Non-Secure (or) N/A:
    263   * This is a Non-Secure function.
    264   * \param str [out] - result string
    265   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    266   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    267   * - All other codes indicates failure. The description can be found in dmtError.h
    268   * \par Prospective Clients:
    269   * All potential applications that require configuration settings.
    270   */
    271   SYNCML_DM_RET_STATUS_T GetStringValue( DMString& str ) const;
    272 
    273   /**
    274   * This is a helper function: gets value of the node with type "integer".
    275   * It is a shortcut to the GetValue()->GetInt()
    276   * \par Sync (or) Async:
    277   * This is a Synchronous function.
    278   * \par Secure (or) Non-Secure (or) N/A:
    279   * This is a Non-Secure function.
    280   * \param nValue [out] - result integer
    281   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    282   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    283   * - All other codes indicates failure. The description can be found in dmtError.h
    284   * \par Prospective Clients:
    285   * All potential applications that require configuration settings.
    286   */
    287   SYNCML_DM_RET_STATUS_T GetIntValue( INT32& nValue ) const;
    288 
    289   /**
    290   * This is a helper function: gets value of the node with type "boolean".
    291   * It is a shortcut to the GetValue()->GetBoolean()
    292   * \par Sync (or) Async:
    293   * This is a Synchronous function.
    294   * \par Secure (or) Non-Secure (or) N/A:
    295   * This is a Non-Secure function.
    296   * \param bValue [out] - result boolean
    297   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    298   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    299   * - All other codes indicates failure. The description can be found in dmtError.h
    300   * \par Prospective Clients:
    301   * All potential applications that require configuration settings.
    302   */
    303   SYNCML_DM_RET_STATUS_T GetBooleanValue( BOOLEAN& bValue ) const;
    304 
    305   /**
    306   * This is a helper function:  gets value of the node with type "boolean"  (use for backward compatibility BOOLTYPE == bool).
    307   * It is a  shortcut to the GetValue()->GetBoolean().
    308   * \par Sync (or) Async:
    309   * This is a Synchronous function.
    310   * \par Secure (or) Non-Secure (or) N/A:
    311   * This is a Non-Secure function.
    312   * \param bValue [out] - result boolean
    313   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    314   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    315   * - All other codes indicates failure. The description can be found in dmtError.h
    316   * \par Prospective Clients:
    317   * All potential applications that require configuration settings.
    318   */
    319   SYNCML_DM_RET_STATUS_T GetBooleanValue( BOOLTYPE& bValue ) const;
    320 
    321   /**
    322   * This is a helper function: gets value of the node with type "float".
    323   * It is a  shortcut to the GetValue()->GetFloat()
    324   * \par Sync (or) Async:
    325   * This is a Synchronous function.
    326   * \par Secure (or) Non-Secure (or) N/A:
    327   * This is a Non-Secure function.
    328   * \param sFloat [out] - result float
    329   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    330   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    331   * - All other codes indicates failure. The description can be found in dmtError.h
    332   * \par Prospective Clients:
    333   * All potential applications that require configuration settings.
    334   */
    335   SYNCML_DM_RET_STATUS_T GetFloatValue(DMString& sFloat ) const;
    336 
    337   /**
    338    * This is a helper function: gets value of the node with type ""date".
    339    * It is a shortcut to GetValue()->GetDate().
    340   * \par Sync (or) Async:
    341   * This is a Synchronous function.
    342   * \par Secure (or) Non-Secure (or) N/A:
    343   * This is a Non-Secure function.
    344   * \param sDate [out] - result date string
    345   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    346   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    347   * - All other codes indicates failure. The description can be found in dmtError.h
    348   * \par Prospective Clients:
    349   * All potential applications that require configuration settings.
    350   */
    351   SYNCML_DM_RET_STATUS_T GetDateValue( DMString& sDate ) const;
    352 
    353  /**
    354   * This is a helper function: gets value of the node with type "string".
    355   * It is a shortcut to GetValue()->GetTime().
    356   * \par Sync (or) Async:
    357   * This is a Synchronous function.
    358   * \par Secure (or) Non-Secure (or) N/A:
    359   * This is a Non-Secure function.
    360   * \param sTime [out] - result time string
    361   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    362   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    363   * - All other codes indicates failure. The description can be found in dmtError.h
    364   * \par Prospective Clients:
    365   * All potential applications that require configuration settings.
    366   */
    367   SYNCML_DM_RET_STATUS_T GetTimeValue( DMString& sTime ) const;
    368 
    369   /**
    370   * This is a helper function: gets value of the node with type "binary".
    371   * It is a shortcut to GetValue()->GetBinary().
    372   * \par Sync (or) Async:
    373   * This is a Synchronous function.
    374   * \par Secure (or) Non-Secure (or) N/A:
    375   * This is a Non-Secure function.
    376   * \param binValue [out] - result binary blob
    377   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    378   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    379   * - All other codes indicates failure. The description can be found in dmtError.h
    380   * \par Prospective Clients:
    381   * All potential applications that require configuration settings.
    382   */
    383   SYNCML_DM_RET_STATUS_T GetBinaryValue( DMVector<UINT8>& binValue ) const;
    384 
    385   /**
    386   * This is a helper function: sets value of the node with type "string".
    387   * It is a  shortcut to the SetValue(DmtData()).
    388   * \par Sync (or) Async:
    389   * This is a Synchronous function.
    390   * \par Secure (or) Non-Secure (or) N/A:
    391   * This is a Non-Secure function.
    392   * \param str [in] -  the value that should be set
    393   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    394   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    395   * - All other codes indicates failure. The description can be found in dmtError.h
    396   * \par Prospective Clients:
    397   * All potential applications that require configuration settings.
    398   */
    399   SYNCML_DM_RET_STATUS_T SetStringValue( CPCHAR str );
    400 
    401   /**
    402   * This is a helper function: sets value of the node with type "integer".
    403   * It is a  shortcut to the SetValue(DmtData()).
    404   * \par Sync (or) Async:
    405   * This is a Synchronous function.
    406   * \par Secure (or) Non-Secure (or) N/A:
    407   * This is a Non-Secure function.
    408   * \param nValue  [in]-  the value that should be set
    409   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    410   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    411   * - All other codes indicates failure. The description can be found in dmtError.h
    412   * \par Prospective Clients:
    413   * All potential applications that require configuration settings.
    414   */
    415   SYNCML_DM_RET_STATUS_T SetIntValue( INT32 nValue );
    416 
    417   /**
    418   * This is a helper function: sets value of the node with type "boolean".
    419   * It is a  shortcut to the SetValue(DmtData())
    420   * \par Sync (or) Async:
    421   * This is a Synchronous function.
    422   * \par Secure (or) Non-Secure (or) N/A:
    423   * This is a Non-Secure function.
    424   * \param bValue [in] -  the value that should be set
    425   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    426   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    427   * - All other codes indicates failure. The description can be found in dmtError.h
    428   * \par Prospective Clients:
    429   * All potential applications that require configuration settings.
    430   */
    431   SYNCML_DM_RET_STATUS_T SetBooleanValue( BOOLEAN bValue );
    432 
    433   /**
    434   * This is a helper function: sets value of the node with type "float".
    435   * It is a shortcut to the SetValue(DmtData())
    436   * \par Sync (or) Async:
    437   * This is a Synchronous function.
    438   * \par Secure (or) Non-Secure (or) N/A:
    439   * This is a Non-Secure function.
    440   * \param fValue [in] -  the value that should be set
    441   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    442   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    443   * - All other codes indicates failure. The description can be found in dmtError.h
    444   * \par Prospective Clients:
    445   * All potential applications that require configuration settings.
    446   */
    447   SYNCML_DM_RET_STATUS_T SetFloatValue( CPCHAR fValue );
    448 
    449   /**
    450   * This is a helper function: sets value of the node with type "date".
    451   * It is a shortcut to the SetValue(DmtData()).
    452   * \par Sync (or) Async:
    453   * This is a Synchronous function.
    454   * \par Secure (or) Non-Secure (or) N/A:
    455   * This is a Non-Secure function.
    456   * \param sDate [in] - the value that should be set
    457   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    458   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    459   * - All other codes indicates failure. The description can be found in dmtError.h
    460   * \par Prospective Clients:
    461   * All potential applications that require configuration settings.
    462   */
    463   SYNCML_DM_RET_STATUS_T SetDateValue( CPCHAR sDate );
    464 
    465   /**
    466   * This is a helper function: sets value of the node with type "time".
    467   * It is a shortcut to the SetValue(DmtData()).
    468   * \par Sync (or) Async:
    469   * This is a Synchronous function.
    470   * \par Secure (or) Non-Secure (or) N/A:
    471   * This is a Non-Secure function.
    472   * \param sTime [in] -  the value that should be set
    473   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    474   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    475   * - All other codes indicates failure. The description can be found in dmtError.h
    476   * \par Prospective Clients:
    477   * All potential applications that require configuration settings.
    478   */
    479   SYNCML_DM_RET_STATUS_T SetTimeValue( CPCHAR sTime );
    480 
    481   /**
    482   * This is a helper function: sets value of the node with type "binary".
    483   * It is a shortcut to the SetValue(DmtData()).
    484   * \par Sync (or) Async:
    485   * This is a Synchronous function.
    486   * \par Secure (or) Non-Secure (or) N/A:
    487   * This is a Non-Secure function.
    488   * \param bin [in] -  binary blob that should be set
    489   * \param len  [in] - length of the parameter "bin"
    490   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    491   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    492   * - All other codes indicates failure. The description can be found in dmtError.h
    493   * \par Prospective Clients:
    494   * All potential applications that require configuration settings.
    495   */
    496   SYNCML_DM_RET_STATUS_T SetBinaryValue( const UINT8 * bin, INT32 len );
    497 
    498 
    499   /**
    500   * Gets the name of the node.
    501   * \par Sync (or) Async:
    502   * This is a Synchronous function.
    503   * \par Secure (or) Non-Secure (or) N/A:
    504   * This is a Non-Secure function.
    505   * \param name [out] - name of the node
    506   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    507   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    508   * - All other codes indicates failure. The description can be found in dmtError.h
    509   * \par Prospective Clients:
    510   * All potential applications that require configuration settings.
    511   */
    512   virtual SYNCML_DM_RET_STATUS_T GetNodeName(DMString & name) const = 0;
    513 
    514   /**
    515   * Gets the name of the node (wrapper for backward compatibility).
    516   * \par Sync (or) Async:
    517   * This is a Synchronous function.
    518   * \par Secure (or) Non-Secure (or) N/A:
    519   * This is a Non-Secure function.
    520   * \return name of the node  \n
    521   * \par Prospective Clients:
    522   * All potential applications that require configuration settings.
    523   */
    524   virtual DMString GetNodeName() const = 0;
    525 
    526   /**
    527   * Gets the first chunk of  an ESN (External Storage Node) data . The chunk buffer is allocated internally.
    528   * \par Sync (or) Async:
    529   * This is a Synchronous function.
    530   * \par Secure (or) Non-Secure (or) N/A:
    531   * This is a Non-Secure function.
    532   * \param dmtChunkData [out] - result as a reference to the  DMT Data Chunk object
    533   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    534   * - SYNCML_DM_SUCCESS - indicate that the ESN data reading successfully. \n
    535   * - All other codes indicates failure. The description can be found in dmtError.h
    536   * \par Prospective Clients:
    537   * All potential applications that require configuration settings.
    538   */
    539 virtual SYNCML_DM_RET_STATUS_T GetFirstChunk(DmtDataChunk&  dmtChunkData) = 0;
    540 
    541   /**
    542   * Gets the next chunk of  an ESN (External Storage Node) data.
    543   * \par Sync (or) Async:
    544   * This is a Synchronous function.
    545   * \par Secure (or) Non-Secure (or) N/A:
    546   * This is a Non-Secure function.
    547   * \param dmtChunkData [out] - result as a reference to the  DMT Data Chunk object
    548   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    549   * - SYNCML_DM_SUCCESS - indicate that the next chunk of ESN data reading successfully. \n
    550   * - All other codes indicates failure. The description can be found in dmtError.h
    551   * \par Prospective Clients:
    552   * All potential applications that require configuration settings.
    553   */
    554 virtual SYNCML_DM_RET_STATUS_T GetNextChunk(DmtDataChunk& dmtChunkData) = 0;
    555 
    556   /**
    557   * Sets the first chunk of  an ESN (External Storage Node) data . The chunk buffer is allocated internally.
    558   * \par Sync (or) Async:
    559   * This is a Synchronous function.
    560   * \par Secure (or) Non-Secure (or) N/A:
    561   * This is a Non-Secure function.
    562   * \param dmtChunkData [in] - reference to the  DMT Data Chunk object that should be set.
    563   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    564   * - SYNCML_DM_SUCCESS - indicate that the ESN data reading successfully and first chunk of ESN data has been written. \n
    565   * - All other codes indicates failure. The description can be found in dmtError.h
    566   * \par Prospective Clients:
    567   * All potential applications that require configuration settings.
    568   */
    569 virtual SYNCML_DM_RET_STATUS_T SetFirstChunk(DmtDataChunk& dmtChunkData) = 0;
    570 
    571   /**
    572   * Sets the next chunk of  an ESN (External Storage Node) data .
    573   * \par Sync (or) Async:
    574   * This is a Synchronous function.
    575   * \par Secure (or) Non-Secure (or) N/A:
    576   * This is a Non-Secure function.
    577   * \param dmtChunkData [in] - reference to the  DMT Data Chunk object that should be set.
    578   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    579   * - SYNCML_DM_SUCCESS - indicate that the next  chunk of ESN data has been written successfully. \n
    580   * - All other codes indicates failure. The description can be found in dmtError.h
    581   * \par Prospective Clients:
    582   * All potential applications that require configuration settings.
    583   */
    584 virtual SYNCML_DM_RET_STATUS_T SetNextChunk(DmtDataChunk& dmtChunkData) = 0;
    585 
    586   /**
    587   * Sets the last chunk of  an ESN (External Storage Node) data .
    588   * \par Sync (or) Async:
    589   * This is a Synchronous function.
    590   * \par Secure (or) Non-Secure (or) N/A:
    591   * This is a Non-Secure function.
    592   * \param dmtChunkData [in] - reference to the  DMT Data Chunk object that should be set.
    593   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    594   * - SYNCML_DM_SUCCESS - indicate that the last  chunk of ESN data has been written successfully. \n
    595   * - All other codes indicates failure. The description can be found in dmtError.h
    596   * \par Prospective Clients:
    597   * All potential applications that require configuration settings.
    598   */
    599 virtual SYNCML_DM_RET_STATUS_T SetLastChunk(DmtDataChunk& dmtChunkData) = 0;
    600 
    601   /**
    602   * This function verifies if a node is an  External Storage Node
    603   * \par Sync (or) Async:
    604   * This is a Synchronous function.
    605   * \par Secure (or) Non-Secure (or) N/A:
    606   * This is a Non-Secure function.
    607   * \return 'true' if the node is an External Storage Node
    608   * \par Prospective Clients:
    609   * All potential applications that require configuration settings.
    610   */
    611 virtual boolean IsExternalStorageNode(void) const= 0;
    612 };
    613 
    614   /**
    615   * Gets  value of the node with type "string".
    616   * \par Sync (or) Async:
    617   * This is a Synchronous function.
    618   * \par Secure (or) Non-Secure (or) N/A:
    619   * This is a Non-Secure function.
    620   * \param str [out] - value of the node
    621   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    622   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    623   * - All other codes indicates failure. The description can be found in dmtError.h
    624   * \par Prospective Clients:
    625   * All potential applications that require configuration settings.
    626   */
    627 inline SYNCML_DM_RET_STATUS_T DmtNode::GetStringValue( DMString& str ) const
    628 {
    629   DmtData data;
    630   SYNCML_DM_RET_STATUS_T ptrError = GetValue( data );
    631   if ( ptrError != SYNCML_DM_SUCCESS )
    632     return ptrError;
    633   return data.GetString( str );
    634 }
    635 
    636   /**
    637   * Gets  value of the node with type "integer".
    638   * \par Sync (or) Async:
    639   * This is a Synchronous function.
    640   * \par Secure (or) Non-Secure (or) N/A:
    641   * This is a Non-Secure function.
    642   * \param nValue [out] - result integer
    643   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    644   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    645   * - All other codes indicates failure. The description can be found in dmtError.h
    646   * \par Prospective Clients:
    647   * All potential applications that require configuration settings.
    648   */
    649 inline SYNCML_DM_RET_STATUS_T DmtNode::GetIntValue( INT32& nValue ) const
    650 {
    651   DmtData data;
    652   SYNCML_DM_RET_STATUS_T ptrError = GetValue( data );
    653   if ( ptrError != SYNCML_DM_SUCCESS )
    654     return ptrError;
    655   return data.GetInt( nValue );
    656 }
    657 
    658   /**
    659   * Gets value of the node with type "boolean".
    660   * \par Sync (or) Async:
    661   * This is a Synchronous function.
    662   * \par Secure (or) Non-Secure (or) N/A:
    663   * This is a Non-Secure function.
    664   * \param bValue [out] - result boolean
    665   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    666   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    667   * - All other codes indicates failure. The description can be found in dmtError.h
    668   * \par Prospective Clients:
    669   * All potential applications that require configuration settings.
    670   */
    671 inline SYNCML_DM_RET_STATUS_T DmtNode::GetBooleanValue( BOOLEAN& bValue ) const
    672 {
    673   DmtData data;
    674   SYNCML_DM_RET_STATUS_T ptrError = GetValue( data );
    675   if ( ptrError != SYNCML_DM_SUCCESS )
    676     return ptrError;
    677   return data.GetBoolean( bValue );
    678 }
    679 
    680   /**
    681   * This is a helper function: gets boolean value of the node (use for backward compatibility BOOLTYPE == bool).
    682   * It is a shortcut to the GetValue()->GetBoolean().
    683   * \par Sync (or) Async:
    684   * This is a Synchronous function.
    685   * \par Secure (or) Non-Secure (or) N/A:
    686   * This is a Non-Secure function.
    687   * \param bValue [out] - result boolean
    688   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    689   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    690   * - All other codes indicates failure. The description can be found in dmtError.h
    691   * \par Prospective Clients:
    692   * All potential applications that require configuration settings.
    693   */
    694 inline SYNCML_DM_RET_STATUS_T DmtNode::GetBooleanValue( BOOLTYPE& bValue ) const
    695 {
    696   DmtData data;
    697   SYNCML_DM_RET_STATUS_T ptrError = GetValue( data );
    698   if ( ptrError != SYNCML_DM_SUCCESS )
    699     return ptrError;
    700   return data.GetBoolean( bValue );
    701 }
    702 
    703   /**
    704   * Gets value of the node with type "float".
    705   * \par Sync (or) Async:
    706   * This is a Synchronous function.
    707   * \par Secure (or) Non-Secure (or) N/A:
    708   * This is a Non-Secure function.
    709   * \param  sFloat [out] - result float as a string
    710   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    711   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    712   * - All other codes indicates failure. The description can be found in dmtError.h
    713   * \par Prospective Clients:
    714   * All potential applications that require configuration settings.
    715   */
    716 inline SYNCML_DM_RET_STATUS_T DmtNode::GetFloatValue( DMString& sFloat ) const
    717 {
    718   DmtData data;
    719   SYNCML_DM_RET_STATUS_T ptrError = GetValue( data );
    720   if ( ptrError != SYNCML_DM_SUCCESS )
    721     return ptrError;
    722   return data.GetFloat( sFloat );
    723 }
    724 
    725   /**
    726   * Gets value of the node with type "date".
    727   * \par Sync (or) Async:
    728   * This is a Synchronous function.
    729   * \par Secure (or) Non-Secure (or) N/A:
    730   * This is a Non-Secure function.
    731   * \param sDate [out] - result date as a string
    732   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    733   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    734   * - All other codes indicates failure. The description can be found in dmtError.h
    735   * \par Prospective Clients:
    736   * All potential applications that require configuration settings.
    737   */
    738 inline SYNCML_DM_RET_STATUS_T DmtNode::GetDateValue( DMString& sDate ) const
    739 {
    740   DmtData data;
    741   SYNCML_DM_RET_STATUS_T ptrError = GetValue( data );
    742   if ( ptrError != SYNCML_DM_SUCCESS )
    743     return ptrError;
    744   return data.GetDate( sDate );
    745 }
    746 
    747  /**
    748   * Gets value of the node with type "time".
    749   * \par Sync (or) Async:
    750   * This is a Synchronous function.
    751   * \par Secure (or) Non-Secure (or) N/A:
    752   * This is a Non-Secure function.
    753   * \param sTime [out] - result time as a string
    754   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    755   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    756   * - All other codes indicates failure. The description can be found in dmtError.h
    757   * \par Prospective Clients:
    758   * All potential applications that require configuration settings.
    759   */
    760 inline SYNCML_DM_RET_STATUS_T DmtNode::GetTimeValue( DMString& sTime ) const
    761 {
    762   DmtData data;
    763   SYNCML_DM_RET_STATUS_T ptrError = GetValue( data );
    764   if ( ptrError != SYNCML_DM_SUCCESS )
    765     return ptrError;
    766   return data.GetTime( sTime );
    767 }
    768 
    769 /**
    770   * Gets value of the node with type "binary";
    771   * \par Sync (or) Async:
    772   * This is a Synchronous function.
    773   * \par Secure (or) Non-Secure (or) N/A:
    774   * This is a Non-Secure function.
    775   * \param binValue [out] - result binary blob
    776   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    777   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    778   * - All other codes indicates failure. The description can be found in dmtError.h
    779   * \par Prospective Clients:
    780   * All potential applications that require configuration settings.
    781   */
    782 inline SYNCML_DM_RET_STATUS_T DmtNode::GetBinaryValue( DMVector<UINT8>& binValue ) const
    783 {
    784   DmtData data;
    785   SYNCML_DM_RET_STATUS_T ptrError = GetValue( data );
    786   if ( ptrError != SYNCML_DM_SUCCESS )
    787     return ptrError;
    788   return data.GetBinary( binValue );
    789 }
    790 
    791   /**
    792    *  Sets value of the node with type "string".
    793   * \par Sync (or) Async:
    794   * This is a Synchronous function.
    795   * \par Secure (or) Non-Secure (or) N/A:
    796   * This is a Non-Secure function.
    797   * \param str [in] -  the value that should be set
    798   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    799   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    800   * - All other codes indicates failure. The description can be found in dmtError.h
    801   * \par Prospective Clients:
    802   * All potential applications that require configuration settings.
    803   */
    804 inline SYNCML_DM_RET_STATUS_T DmtNode::SetStringValue( CPCHAR str )
    805 {
    806   return SetValue( DmtData( str ) );
    807 }
    808 
    809   /**
    810   *  Sets value of the node with type "integer".
    811   * \par Sync (or) Async:
    812   * This is a Synchronous function.
    813   * \par Secure (or) Non-Secure (or) N/A:
    814   * This is a Non-Secure function.
    815   * \param nValue [in] -  the value that should be set
    816   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    817   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    818   * - All other codes indicates failure. The description can be found in dmtError.h
    819   * \par Prospective Clients:
    820   * All potential applications that require configuration settings.
    821   */
    822 inline SYNCML_DM_RET_STATUS_T DmtNode::SetIntValue( INT32 nValue )
    823 {
    824   return SetValue( DmtData( nValue ) );
    825 }
    826 
    827    /**
    828   *  Sets value of the node with type "boolean".
    829   * \par Sync (or) Async:
    830   * This is a Synchronous function.
    831   * \par Secure (or) Non-Secure (or) N/A:
    832   * This is a Non-Secure function.
    833   * \param bValue [in] -  the value that should be set
    834   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    835   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    836   * - All other codes indicates failure. The description can be found in dmtError.h
    837   * \par Prospective Clients:
    838   * All potential applications that require configuration settings.
    839   */
    840 inline SYNCML_DM_RET_STATUS_T DmtNode::SetBooleanValue( BOOLEAN bValue )
    841 {
    842   return SetValue( DmtData( bValue ) );
    843 }
    844 
    845 
    846   /**
    847   *  Sets value of the node with type "float".
    848   * \par Sync (or) Async:
    849   * This is a Synchronous function.
    850   * \par Secure (or) Non-Secure (or) N/A:
    851   * This is a Non-Secure function.
    852   * \param sFloat [in] - the value that should be set
    853   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    854   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    855   * - All other codes indicates failure. The description can be found in dmtError.h
    856   * \par Prospective Clients:
    857   * All potential applications that require configuration settings.
    858   */
    859 inline SYNCML_DM_RET_STATUS_T DmtNode::SetFloatValue( CPCHAR sFloat )
    860 {
    861   return SetValue( DmtData( sFloat, SYNCML_DM_DATAFORMAT_FLOAT ) );
    862 }
    863 
    864  /**
    865   *  Sets value of the node with type "date".
    866   * \par Sync (or) Async:
    867   * This is a Synchronous function.
    868   * \par Secure (or) Non-Secure (or) N/A:
    869   * This is a Non-Secure function.
    870   * \param sDate [in] -  the value that should be set
    871   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    872   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    873   * - All other codes indicates failure. The description can be found in dmtError.h
    874   * \par Prospective Clients:
    875   * All potential applications that require configuration settings.
    876   */
    877 inline SYNCML_DM_RET_STATUS_T DmtNode::SetDateValue( CPCHAR sDate )
    878 {
    879   return SetValue( DmtData( sDate, SYNCML_DM_DATAFORMAT_DATE ) );
    880 }
    881 
    882   /**
    883   *  Sets value of the node with type "time".
    884   * \par Sync (or) Async:
    885   * This is a Synchronous function.
    886   * \par Secure (or) Non-Secure (or) N/A:
    887   * This is a Non-Secure function.
    888   * \param sTime [in] - the value that should be set
    889   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    890   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    891   * - All other codes indicates failure. The description can be found in dmtError.h
    892   * \par Prospective Clients:
    893   * All potential applications that require configuration settings.
    894   */
    895 
    896 inline SYNCML_DM_RET_STATUS_T DmtNode::SetTimeValue( CPCHAR sTime )
    897 {
    898   return SetValue( DmtData( sTime, SYNCML_DM_DATAFORMAT_TIME ) );
    899 }
    900 
    901   /**
    902   *  Sets value of the node with type "binary".
    903   * \par Sync (or) Async:
    904   * This is a Synchronous function.
    905   * \par Secure (or) Non-Secure (or) N/A:
    906   * This is a Non-Secure function.
    907   * \param bin [in] - binary blob  that should be set
    908   * \param len [in] - length of the parameter "bin"
    909   * \return Return Type (SYNCML_DM_RET_STATUS_T) \n
    910   * - SYNCML_DM_SUCCESS - indicates that the operation is completed successfully. \n
    911   * - All other codes indicates failure. The description can be found in dmtError.h
    912   * \par Prospective Clients:
    913   * All potential applications that require configuration settings.
    914   */
    915 inline SYNCML_DM_RET_STATUS_T DmtNode::SetBinaryValue( const UINT8 * bin, INT32 len )
    916 {
    917   return SetValue( DmtData( bin, len ) );
    918 }
    919 
    920 #endif
    921