Tizen 2.1 base
[platform/core/system/sync-agent.git] / include / device-manager / mo_struct.h
1 /*
2  * sync-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #ifndef MO_STRUCT_H_
19 #define MO_STRUCT_H_
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif                          /* __cplusplus */
24
25 /**
26  * @file        mo_struct.h
27  * @brief       Definition of framework codes for device manager module
28  */
29
30 /** @addtogroup device_manager
31  *      @{
32  */
33
34 #define DEVICE_MANAGER_MO_BOOL_TRUE     "T"
35 #define DEVICE_MANAGER_MO_BOOL_FALSE    "F"
36
37 /**
38  * @brief       Enumerations of sync_agent_dm_mo_type_e
39  */
40         typedef enum {
41                 SYNC_AGENT_DM_MO_TYPE_DMACC = 0,        /**< dm acc type*/
42                 SYNC_AGENT_DM_MO_TYPE_DEVINFO = 1,      /**< device info type*/
43                 SYNC_AGENT_DM_MO_TYPE_DEVDETAIL = 2,
44                                                 /**< device detail type*/
45                 SYNC_AGENT_DM_MO_TYPE_FUMO = 4,         /**< fumo type*/
46                 SYNC_AGENT_DM_MO_TYPE_LAWMO = 8,        /**< lawmo type*/
47                 SYNC_AGENT_DM_MO_TYPE_SCOMO = 16,       /**< scomo type*/
48                 SYNC_AGENT_DM_MO_TYPE_NO_TYPE = 32      /**< mo no type*/
49         } sync_agent_dm_mo_type_e;
50
51 #define DEVICE_MANAGER_MO_ACCESSTYPE_CNT  6
52
53 /**
54  * @brief       Enumerations of sync_agent_dm_mo_access_type_e
55  */
56         typedef enum {
57                 SYNC_AGENT_DM_MO_ACCESSTYPE_NO_SET = 0,
58                                                 /**< accesstype no */
59                 SYNC_AGENT_DM_MO_ACCESSTYPE_ADD = 1,    /**< accesstype add */
60                 SYNC_AGENT_DM_MO_ACCESSTYPE_COPY = 2,   /**< accesstype copy */
61                 SYNC_AGENT_DM_MO_ACCESSTYPE_DELETE = 4,
62                                                 /**< accesstype delete */
63                 SYNC_AGENT_DM_MO_ACCESSTYPE_EXEC = 8,   /**< accesstype exec */
64                 SYNC_AGENT_DM_MO_ACCESSTYPE_GET = 16,   /**< accesstype get */
65                 SYNC_AGENT_DM_MO_ACCESSTYPE_REPLACE = 32/**< accesstype replace */
66         } sync_agent_dm_mo_access_type_e;
67
68 /**
69  * @brief       Enumerations of sync_agent_dm_mo_format_e
70  */
71         typedef enum {
72                 SYNC_AGENT_DM_MO_FORMAT_NO_SET = 0,
73                                                 /**< format no */
74                 SYNC_AGENT_DM_MO_FORMAT_B64,            /**< format b64 */
75                 SYNC_AGENT_DM_MO_FORMAT_BIN,            /**< format bin */
76                 SYNC_AGENT_DM_MO_FORMAT_BOOL,           /**< format bool */
77                 SYNC_AGENT_DM_MO_FORMAT_CHR,            /**< format chr */
78                 SYNC_AGENT_DM_MO_FORMAT_INT,            /**< format int */
79                 SYNC_AGENT_DM_MO_FORMAT_NODE,           /**< format node */
80                 SYNC_AGENT_DM_MO_FORMAT_NULL,           /**< format null */
81                 SYNC_AGENT_DM_MO_FORMAT_XML,            /**< format xml */
82                 SYNC_AGENT_DM_MO_FORMAT_DATE,           /**< format date */
83                 SYNC_AGENT_DM_MO_FORMAT_TIME,           /**< format time */
84                 SYNC_AGENT_DM_MO_FORMAT_FLOAT           /**< format float */
85         } sync_agent_dm_mo_format_e;
86
87 /**
88  * @brief       Enumerations of sync_agent_dm_mo_occurrence_e
89  */
90         typedef enum {
91                 SYNC_AGENT_DM_MO_OCCURRENCE_NO_SET = 0,
92                                                 /**< occurence no */
93                 SYNC_AGENT_DM_MO_OCCURRENCE_ONE,                /**< occurence one */
94                 SYNC_AGENT_DM_MO_OCCURRENCE_ZEROORONE,  /**< occurence zero or one */
95                 SYNC_AGENT_DM_MO_OCCURRENCE_ZEROORMORE,
96                                                 /**< occurence zero or more */
97                 SYNC_AGENT_DM_MO_OCCURRENCE_ONEORMORE,  /**< occurence one or more */
98                 SYNC_AGENT_DM_MO_OCCURRENCE_ZEROORN,    /**< occurence zero or n */
99                 SYNC_AGENT_DM_MO_OCCURRENCE_ONEORN              /**< occurence one or n */
100         } sync_agent_dm_mo_occurrence_e;
101
102 /**
103  * @brief       Enumerations of sync_agent_dm_mo_scope_e
104  */
105         typedef enum {
106                 SYNC_AGENT_DM_MO_SCOPE_NO_SET = 0,
107                                                 /**< scope no */
108                 SYNC_AGENT_DM_MO_SCOPE_PERMANENT,
109                                                 /**< scope premanent */
110                 SYNC_AGENT_DM_MO_SCOPE_DYNAMIC  /**< scope dynamic */
111         } sync_agent_dm_mo_scope_e;
112
113 /**
114  * @brief       Enumerations of sync_agent_dm_mo_df_type_e
115  */
116         typedef enum {
117                 SYNC_AGENT_DM_MO_DF_TYPE_NO_SET = 0,
118                                                 /**< df type no */
119                 SYNC_AGENT_DM_MO_DF_TYPE_MIME,          /**< df type mime */
120                 SYNC_AGENT_DM_MO_DF_TYPE_DDFNAME        /**< df type ddfname */
121         } sync_agent_dm_mo_df_type_e;
122
123 /**
124  * @brief       structure of sync_agent_dm_mo_framework_property_s
125  */
126         typedef struct {
127                 sync_agent_dm_mo_access_type_e accessType;      /**< accesstype enum */
128                 char *defaultValue;                                                             /**< default value */
129                 char *description;                                                              /**< description */
130                 sync_agent_dm_mo_format_e dffFormat;                    /**< ddf format enum */
131                 sync_agent_dm_mo_occurrence_e occurrence;               /**< occurrence enum */
132                 int occurrence_num;                                                             /**< occurrence number */
133                 sync_agent_dm_mo_scope_e scope;                                 /**< scope enum */
134                 char *dfTitle;                                                                  /**< df title */
135                 sync_agent_dm_mo_df_type_e dfType;                              /**< df type enum */
136                 char *dfType_Value;                                                             /**< df type value */
137         } sync_agent_dm_mo_framework_property_s;
138
139 /**
140  * @brief       structure of sync_agent_dm_mo_runtime_property_s
141  */
142         typedef struct {
143                 char *acl;                                                                              /**< acl value */
144                 sync_agent_dm_mo_format_e format;                       /**< format enum */
145                 char *name;                                                                     /**< name */
146                 char *size;                                                                     /**< size */
147                 char *title;                                                                    /**< title */
148                 char *tStamp;                                                                   /**< time stamp */
149                 sync_agent_dm_mo_df_type_e type;                        /**< df type */
150                 char *type_value;                                                               /**< type value */
151                 char *verNo;                                                                    /**< version number */
152         } sync_agent_dm_mo_runtime_property_s;
153
154 /**
155  * @brief       Enumerations of sync_agent_dm_mo_node_type_e
156  */
157         typedef enum {
158                 SYNC_AGENT_DM_MO_NODE_ROOT = 1,                         /**< root node type */
159                 SYNC_AGENT_DM_MO_NODE_FIRST,                            /**< first node type */
160                 SYNC_AGENT_DM_MO_NODE_INTERIOR,                         /**< interior node type */
161                 SYNC_AGENT_DM_MO_NODE_LEAF                                      /**< leaf node type */
162         } sync_agent_dm_mo_node_type_e;
163
164 /**
165  * @brief       structure of sync_agent_dm_mo_node_s
166  */
167         typedef struct sync_agent_dm_mo_node_s {
168                 int id;                                                                                                         /**< id in db */
169                 int parent_id;                                                                                          /**< parent id in db*/
170                 char *name;                                                                                                     /**< name */
171                 char *value;                                                                                                    /**< value */
172                 char *full_path;                                                                                                /**< mo node path */
173                 sync_agent_dm_mo_node_type_e type;                                                      /**< node type */
174                 sync_agent_dm_mo_type_e mo_type;                                                        /**< mo type */
175                 int server_type;                                                                                                /**< server type */
176                 sync_agent_dm_mo_framework_property_s *framework_property;
177                                                                         /**< framework property */
178                 sync_agent_dm_mo_runtime_property_s *runtime_property;  /**< runtime property */
179                 struct sync_agent_dm_mo_node_s *child_node_list;                        /**< child node list */
180                 struct sync_agent_dm_mo_node_s *next_node;                              /**< next node */
181                 struct sync_agent_dm_mo_node_s *parent_node;                            /**< parent node */
182                 int child_node_cnt;                                                                                     /**< child node count */
183         } sync_agent_dm_mo_node_s;
184
185 /**
186  * @brief       Enumerations of sync_agent_dm_mo_get_option_e
187  */
188         typedef enum {
189                 SYNC_AGENT_DM_MO_GET_OPTION_ALL = 0,            /**< get type all */
190                 SYNC_AGENT_DM_MO_GET_OPTION_NODE                        /**< get type node value */
191         } sync_agent_dm_mo_get_option_e;
192
193 /**
194  * @brief       Enumerations of sync_agent_dm_mo_transaction_e
195  */
196         typedef enum {
197                 SYNC_AGENT_DM_MO_TRANSACTION_COMMIT = 0,/**< db transaction commit */
198                 SYNC_AGENT_DM_MO_TRANSACTION_ROLLBACK   /**< db transaction rollback */
199         } sync_agent_dm_mo_transaction_e;
200
201 /**
202  * @brief       Enumerations of sync_agent_dm_tnds_type_e
203  */
204         typedef enum {
205                 SYNC_AGENT_DM_MO_TNDS_TYPE_XML = 0,             /**< tnds xml type */
206                 SYNC_AGENT_DM_MO_TNDS_TYPE_WBXML                        /**< tnds wbxml type */
207         } sync_agent_dm_tnds_type_e;
208
209 /**
210  * @brief       Enumerations of sync_agent_dm_tnds_action_e
211  */
212         typedef enum {
213                 SYNC_AGENT_DM_MO_TNDS_ACTION_ADD = 0,           /**< tnds add action */
214                 SYNC_AGENT_DM_MO_TNDS_ACTION_REPLACE            /**< tnds replace action */
215         } sync_agent_dm_tnds_action_e;
216
217 /**
218  * @brief       structure of sync_agent_dm_acc_info_s
219  */
220         typedef struct {
221                 char *auth_name;                                                                /**< auth name */
222                 char *auth_secret;                                                      /**< auth secret */
223                 char *auth_data;                                                                /**< auth data(nonce) */
224                 char *auth_type;                                                                /**< auth type */
225                 char *auth_level;                                                               /**< auth level */
226                 char *addr;                                                                     /**< server url */
227         } sync_agent_dm_acc_info_s;
228
229 /**
230  * @brief       structure of sync_agent_dm_acc_type_e
231  */
232         typedef enum {
233                 DEVICE_MANAGE_ACC_TYPE_SERVER,                          /**< dm acc server type */
234                 DEVICE_MANAGE_ACC_TYPE_CLIENT                           /**< dm acc client type */
235         } sync_agent_dm_acc_type_e;
236
237 /**
238  * @brief       structure of sync_agent_dm_server_info_s
239  */
240         typedef struct sync_agent_dm_server_info_s {
241                 char *server_id;                                                                /**< server id */
242                 int server_type;                                                                /**< server type */
243                 struct sync_agent_dm_server_info_s *next;       /**< sync_agent_dm_server_info_s struct */
244         } sync_agent_dm_server_info_s;
245
246 /**
247  *      @}
248  */
249
250 #ifdef __cplusplus
251 }
252 #endif                          /* __cplusplus */
253 #endif                          /* MO_STRUCT_H_ */