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 __DMTEVENTDATA_H__
     18 #define __DMTEVENTDATA_H__
     19 
     20 #ifndef __cplusplus
     21 #error "This is a C++ header file; it requires C++ to compile."
     22 #endif
     23 
     24 /**
     25   \file dmtEventData.hpp
     26   \brief The dmtEventData.hpp header file contains DmtEventData class  definition. \n
     27        This class represents updates performed on particular DM node.
     28 */
     29 
     30 #include "dmtEvent.hpp"
     31 #include "dmstring.h"
     32 #include "dmvector.h"
     33 
     34 /**
     35 * DmtEventData represents actual updates performed on DM node.
     36 * \par Category: General
     37 * \par Persistence: Transient
     38 * \par Security: Non-Secure
     39 * \par Migration State: FINAL
     40 */
     41 class DmtEventData : public JemBaseObject
     42 {
     43 
     44 public:
     45 
     46   /**
     47     * Default Constructor - no memory allocation performed.
     48     */
     49   DmtEventData()
     50   {
     51         m_eAction = SYNCML_DM_EVENT_NONE;
     52         m_bIsLeaf = FALSE;
     53   }
     54 
     55   /**
     56     * Default Destructor.
     57     */
     58   virtual ~DmtEventData() {}
     59 
     60  /**
     61   * Retrieves operations (actions) performed on node.
     62   * \par Sync (or) Async:
     63   * This is a Synchronous function.
     64   * \par Secure (or) Non-Secure (or) N/A:
     65   * This is a Non-Secure function.
     66   * \return Return Type (SYNCML_DM_EVENT_ACTION_T)\n
     67   * - Bit-wised actions performed on node
     68   * \par Prospective Clients:
     69   * All potential applications that require configuration settings and Internal Classes.
     70   */
     71   inline SYNCML_DM_EVENT_ACTION_T GetAction() const { return  m_eAction; }
     72 
     73 
     74   /**
     75   * Retrieves type of node (leaf or interior).
     76   * \par Sync (or) Async:
     77   * This is a Synchronous function.
     78   * \par Secure (or) Non-Secure (or) N/A:
     79   * This is a Non-Secure function.
     80   * \return TRUE if node is leaf\n
     81   * \par Prospective Clients:
     82   * All potential applications that require configuration settings and Internal Classes.
     83   */
     84   inline BOOLEAN IsLeaf() const { return  m_bIsLeaf; }
     85 
     86 
     87   /**
     88   * Retrieves node name.
     89   * \par Sync (or) Async:
     90   * This is a Synchronous function.
     91   * \par Secure (or) Non-Secure (or) N/A:
     92   * This is a Non-Secure function.
     93   * \return const reference on node name\n
     94   * \par Prospective Clients:
     95   * All potential applications that require configuration settings and Internal Classes.
     96   */
     97   const DMString & GetName() const { return m_strName; }
     98 
     99   /**
    100   * Retrieves node name.
    101   * \par Sync (or) Async:
    102   * This is a Synchronous function.
    103   * \par Secure (or) Non-Secure (or) N/A:
    104   * This is a Non-Secure function.
    105   * \return reference on node name\n
    106   * \par Prospective Clients:
    107   * All potential applications that require configuration settings and Internal Classes.
    108   */
    109   DMString & GetName() { return m_strName; }
    110 
    111 
    112 /**
    113   * Retrieves new node name (Rename was performed).
    114   * \par Sync (or) Async:
    115   * This is a Synchronous function.
    116   * \par Secure (or) Non-Secure (or) N/A:
    117   * This is a Non-Secure function.
    118   * \return const reference on new node name\n
    119   * \par Prospective Clients:
    120   * All potential applications that require configuration settings and Internal Classes.
    121   */
    122   const DMString & GetNewName() const { return m_strNewName; }
    123 
    124 /**
    125   * Retrieves new node name (Rename was performed).
    126   * \par Sync (or) Async:
    127   * This is a Synchronous function.
    128   * \par Secure (or) Non-Secure (or) N/A:
    129   * This is a Non-Secure function.
    130   * \return reference on new node name\n
    131   * \par Prospective Clients:
    132   * All potential applications that require configuration settings and Internal Classes.
    133   */
    134   DMString & GetNewName() { return m_strNewName; }
    135 
    136 
    137 
    138 protected:
    139  /** child node name */
    140   DMString  m_strName;
    141  /**  child node new name*/
    142   DMString  m_strNewName;
    143 
    144  /** child node operation */
    145   SYNCML_DM_EVENT_ACTION_T m_eAction;
    146  /** flag contains info is a node is a leaf*/
    147   BOOLEAN m_bIsLeaf;
    148 };
    149 
    150 
    151 /**
    152 * Type definition for DmtEventData smart pointer
    153 */
    154 typedef JemSmartPtr<DmtEventData> PDmtEventData;
    155 
    156 /**
    157 * Type definition for vector containing DmtEventData smart pointers
    158 */
    159 typedef DMVector<PDmtEventData> DmtEventDataVector;
    160 
    161 /**
    162 * Type definition for map containing parent node path and vector of updates on children nodes
    163 */
    164 typedef DMMap<DMString, DmtEventDataVector> DmtEventMap;
    165 
    166 #endif
    167