Home | History | Annotate | Download | only in hdr
      1 #ifndef _DM_TREE_PLUGIN_ROOT_NODE_CLASS_H
      2 #define _DM_TREE_PLUGIN_ROOT_NODE_CLASS_H
      3 
      4 #ifndef __cplusplus
      5 #error "This is a C++ header file; it requires C++ to compile."
      6 #endif
      7 //------------------------------------------------------------------------
      8 //  General Description: This file contains the definition of
      9 //                       DMPluginRootNode class
     10 //------------------------------------------------------------------------
     11 // Revision History:
     12 //    Author           Modification     Tracking        Description
     13 //  (core ID)             Date          Number         of Changes
     14 // -----------------------------------------------------------------------
     15 //                        2003-2007                      refactoring
     16 // cdp180              03/16/2007    LIBll55345   Removing ACL check for internal calls
     17 //------------------------------------------------------------------------
     18 //                       INCLUDE FILES
     19 //------------------------------------------------------------------------
     20 #include "dm_tree_node_class.H"
     21 #include "dmt.hpp"
     22 #include "dmPlugin.h"
     23 #include "dmMetaDataNode.h"
     24 
     25 //------------------------------------------------------------------------
     26 //                        CONSTANTS
     27 //------------------------------------------------------------------------
     28 //------------------------------------------------------------------------
     29 //                         MACROS
     30 //------------------------------------------------------------------------
     31 //------------------------------------------------------------------------
     32 //                          ENUMS
     33 //------------------------------------------------------------------------
     34 //------------------------------------------------------------------------
     35 //                 STRUCTURES AND OTHER TYPEDEFS
     36 //------------------------------------------------------------------------
     37 //------------------------------------------------------------------------
     38 //                  GLOBAL VARIABLE DECLARATIONS
     39 //------------------------------------------------------------------------
     40 //------------------------------------------------------------------------
     41 //                    FUNCTION PROTOTYPES
     42 //------------------------------------------------------------------------
     43 //------------------------------------------------------------------------
     44 //                          CLASS
     45 //------------------------------------------------------------------------
     46 
     47 //class Definition for Default interior nodes
     48 //Only DM_XXX methods are implemented in this class.
     49 // The Plug-in MUST implement functions for
     50 //    Initialization,
     51 //    CreateObject callback,
     52 //    SessionEndcallback and
     53 //    GetClassUUID methods.
     54 
     55 class DMPluginRootNode:public DMNode
     56 {
     57 public:
     58    //default constructor
     59    DMPluginRootNode( PDMPlugin pPlugin );
     60 
     61    //destructor of the class
     62    virtual ~DMPluginRootNode();
     63 
     64    //function to add an INTERIOR node for which no plug-in
     65    //registered
     66    virtual SYNCML_DM_RET_STATUS_T Add (DMAddData & oAddData);
     67 
     68    //To delete a node's data :COMMAND NOT ALLOWED on interior node
     69    virtual SYNCML_DM_RET_STATUS_T Delete(CPCHAR pURI);
     70 
     71    //To get node's data: COMMAND NOT ALLOWED on interior node
     72    virtual SYNCML_DM_RET_STATUS_T Get(CPCHAR pURI, DMGetData & oReturnData);
     73 
     74    virtual SYNCML_DM_RET_STATUS_T Find(CPCHAR pbUri);
     75 
     76    virtual SYNCML_DM_RET_STATUS_T SetAddedNode(CPCHAR pbUri);
     77 
     78    virtual SYNCML_DM_RET_STATUS_T RemoveAddedNode(CPCHAR pbUri);
     79 
     80    //To get node's format of data: COMMAND NOT ALLOWED on interior node
     81    virtual SYNCML_DM_RET_STATUS_T GetFormat(CPCHAR pURI, SYNCML_DM_FORMAT_T *pdwRetPropertyData);
     82 
     83    //To get node's type of data: COMMAND NOT ALLOWED on interior node
     84    virtual SYNCML_DM_RET_STATUS_T GetType(CPCHAR pURI, DMString& strType);
     85 
     86    //To get node's size of data: COMMAND NOT ALLOWED on interior node
     87    virtual SYNCML_DM_RET_STATUS_T GetSize (CPCHAR pURI,UINT32 * pdwRetPropertyData);
     88 
     89    //To update node's new name in database: COMMAND NOT ALLOWED
     90    //on interior node
     91    virtual SYNCML_DM_RET_STATUS_T Rename(CPCHAR pURI, CPCHAR psNewNodeName);
     92 
     93    //To replace node's size of data: COMMAND NOT ALLOWED
     94    //on interior node
     95    virtual SYNCML_DM_RET_STATUS_T Replace(DMAddData & oReplace);
     96 
     97    // To rollback the operation,not supported in Phase 1
     98    virtual SYNCML_DM_RET_STATUS_T Rollback (SYNCML_DM_COMMAND_T bDMCommand, CPCHAR pURI);
     99 
    100    //Work on Multiple Nodes
    101    virtual SYNCML_DM_RET_STATUS_T GetName(CPCHAR pURI, DMString& strName );
    102 
    103    virtual SYNCML_DM_RET_STATUS_T SetName(CPCHAR pURI, CPCHAR pbNewName);
    104 
    105    virtual SYNCML_DM_RET_STATUS_T GetTitle(CPCHAR pURI,DMString& ppbTitle);
    106 
    107    virtual SYNCML_DM_RET_STATUS_T SetTitle(CPCHAR pURI, CPCHAR pbNewTitle);
    108 #ifdef LOB_SUPPORT
    109    virtual SYNCML_DM_RET_STATUS_T  IsESN(CPCHAR pbUri, BOOLEAN& bESN);
    110 #endif
    111    SYNCML_DM_RET_STATUS_T GetTree(PDmtAPIPluginTree & ptrTree);
    112 
    113    inline PDMPlugin GetPlugin() { return m_ptrPlugin;}
    114 
    115    CPCHAR GetPluginURI(CPCHAR pURI);
    116 
    117    virtual BOOLEAN  IsGetAccess(CPCHAR pURI) const;
    118 
    119 #ifndef DM_IGNORE_TSTAMP_AND_VERSION
    120 
    121    //TStamp and VerNo are AutoSet.
    122    virtual XPL_CLK_CLOCK_T GetTStamp(CPCHAR pURI);
    123 
    124    virtual SYNCML_DM_RET_STATUS_T SetTStamp(CPCHAR /*pURI*/, XPL_CLK_CLOCK_T /*timeStamp*/)
    125    {
    126       return SYNCML_DM_FEATURE_NOT_SUPPORTED;
    127    }
    128 
    129    virtual UINT16 GetVerNo(CPCHAR pURI);
    130 
    131    virtual SYNCML_DM_RET_STATUS_T SetVerNo(CPCHAR /*pURI*/, UINT16 /*wVerNo*/)
    132    {
    133       return SYNCML_DM_FEATURE_NOT_SUPPORTED;
    134    }
    135 
    136 #endif
    137 
    138   private:
    139    virtual SYNCML_DM_RET_STATUS_T GetTree();
    140 
    141 
    142    PDMPlugin m_ptrPlugin;
    143    PDmtAPIPluginTree m_ptrPluginTree;
    144 
    145 };
    146 
    147 
    148 
    149 class DMOverlayDataPluginNode:public DMPluginRootNode
    150 {
    151 public:
    152    //default constructor
    153    DMOverlayDataPluginNode( PDMPlugin pPlugin );
    154 
    155 
    156    virtual SYNCML_DM_RET_STATUS_T GetFormat(CPCHAR pURI, SYNCML_DM_FORMAT_T *pdwRetPropertyData);
    157 
    158    inline void SetNodeAttributes(  SYNCML_DM_ACCESS_TYPE_T  wAccessType,
    159       SYNCML_DM_FORMAT_T nNodeFormat )
    160     {
    161       m_wAccessType = wAccessType;
    162       m_nNodeFormat = nNodeFormat;
    163     }
    164 
    165 
    166 private:
    167     SYNCML_DM_ACCESS_TYPE_T  m_wAccessType;
    168     SYNCML_DM_FORMAT_T m_nNodeFormat;
    169 
    170 };
    171 
    172 //------------------------------------------------------------------------
    173 #endif //_DM_TREE_PLUGIN_ROOT_NODE_CLASS_H
    174