Tizen 2.0 Release
[pkgs/o/oma-ds-service.git] / include / service-engine / se_common.h
1 /*
2  * oma-ds-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 /**
19  *   @SE_Common.h
20  *   @version                                                                   0.1
21  *   @brief                                                                             This file is the header file of enumeration and define used in SE
22  */
23
24 #ifndef SE_COMMON_H_
25 #define SE_COMMON_H_
26
27 #define DEFINE_SYNC_PROGRESS_NONE "PROGRESS_NONE"
28 #define DEFINE_SYNC_INIT "INIT"
29 #define DEFINE_SYNC_CONNECTING "CONNECTING"
30 #define DEFINE_SYNC_AUTHENTICATED "AUTHENTICATED"
31 #define DEFINE_SYNC_DONE "DONE"
32 #define DEFINE_SYNC_ERROR "ERROR"
33
34 #define DEFINE_ERROR_NONE "ERROR_NONE"
35 #define DEFINE_ERROR_CONNECTION "CONNECTION"
36 #define DEFINE_ERROR_SYNCHDR "SYNCHDR"
37 #define DEFINE_ERROR_INTERNAL "INTERNAL"
38 #define DEFINE_ERROR_SUSPENDED "SUSPENDED"
39 #define DEFINE_ERROR_DB "DB"
40 #define DEFINE_ERROR_ABORT "ABORT"
41 #define DEFINE_ERROR_SERVER "SERVER"
42 #define DEFINE_ERROR_MEMORY_FULL "MEMORY_FULL"
43 #define DEFINE_ERROR_AUTHENTICATE "AUTHENTICATE"
44 #define DEFINE_ERROR_AUTOCONFIG_NOT_SUPPORT_BY_SERVER "AUTOCONFIG_NOT_SUPPORT_BY_SERVER"
45 #define DEFINE_ERROR_LOW_BATTERY "LOW_BATTERY"
46
47 #define DEFINE_PROGRESS_NONE "PROGRESS_NONE"
48 #define DEFINE_PROGRESS_SUCCESS "PROGRESS_SUCCESS"
49 #define DEFINE_FAILED_DB "FAILED_DB"
50 #define DEFINE_FAILED_DB_FORBIDDEN "FAILED_DB_FORBIDDEN"
51 #define DEFINE_FAILED_DB_ITEM "FAILED_DB_ITEM"
52 #define DEFINE_FAILED_DB_CONFIG "FAILED_DB_CONFIG"
53 #define DEFINE_FAILED_DB_DEVICEFULL "FAILED_DB_DEVICEFULL"
54
55 #define DEFINE_NOOP "NOOP"
56 #define DEFINE_ADD "ADD"
57 #define DEFINE_DELETE "DELETE"
58 #define DEFINE_MOVE "MOVE"
59 #define DEFINE_COPY "COPY"
60 #define DEFINE_REPLACE "REPLACE"
61
62 #define DEFINE_DBSYNC_SUCCESS "success"
63 #define DEFINE_DBSYNC_STOP "stop"
64 #define DEFINE_DBSYNC_FAIL "fail"
65 #define DEFINE_DBSYNC_NO "No"
66
67 typedef enum {
68         PROGRESS_NONE = 0,
69         PROGRESS_INIT = 1,
70         PROGRESS_CONNECTING = 2,
71         PROGRESS_AUTHENTICATED = 3,
72         PROGRESS_DONE = 4,
73         PROGRESS_ERROR = 5
74 } sync_progress_e;
75
76 typedef enum {
77         ERROR_NONE = 0,
78         ERROR_CONNECTION = 1,
79         ERROR_SYNCHDR = 2,
80         ERROR_INTERNAL = 3,
81         ERROR_SUSPENDED = 4,
82         ERROR_DB = 5,
83         ERROR_ABORT = 6,
84         ERROR_SERVER = 7,
85         ERROR_MEMORY_FULL = 8,
86         ERROR_AUTHENTICATE = 9,
87         ERROR_AUTOCONFIG_NOT_SUPPORT_BY_SERVER = 10,
88         ERROR_LOW_BATTERY = 11
89 } sync_error_e;
90
91 typedef enum {
92         SYNC_PROGRESS_NONE = 0,
93         SYNC_PROGRESS_SUCCESS,
94         SYNC_FAILED_DB,
95         SYNC_FAILED_DB_FORBIDDEN,
96         SYNC_FAILED_DB_ITEM,
97         SYNC_FAILED_DB_CONFIG,
98         SYNC_FAILED_DB_DEVICEFULL
99 } sync_progress_status_e;
100
101 typedef enum {
102         OPERATION_NOOP = 0,
103         OPERATION_ADD,
104         OPERATION_DELETE,
105         OPERATION_MOVE,
106         OPERATION_COPY,
107         OPERATION_REPLACE
108 } operation_type_e;
109
110 typedef enum {
111         COMMAND_RESULT_INIT = 0,
112         COMMAND_RESULT_OK = 200,        /*[R] OK exception */
113         COMMAND_RESULT_ADDED = 201,     /*[AR] Item added exception */
114         COMMAND_RESULT_DELETE_PARTIAL = 206,    /*[D] Partial content exception condition */
115         COMMAND_RESULT_DELETE_WITHOUT_ARCHIVE = 210,    /*[D] Delete without archive exception */
116         COMMAND_RESULT_NOT_EXIST = 211, /*[D] Item not deleted exception */
117         COMMAND_RESULT_UNAUTHRIZED = 401,       /*[ARD] Unauthorized exception */
118         COMMAND_RESULT_AUTHENTICATION_REQUIRED = 407,   /*[ARD] Authentication required exception */
119         COMMAND_RESULT_INCOMPLETE = 412,        /*[D] Incomplete command exception */
120         COMMAND_RESULT_UNSUPPORTED_TYPE = 415,  /*[A] Unsupported media type or format exception */
121         COMMAND_RESULT_ALREADY_EXIST = 418,     /*[A] Already exists exception */
122         COMMAND_RESULT_DEVICE_FULL = 420,       /*[AR] Device full exception */
123         COMMAND_RESULT_PARTIAL_REPLACE_NOT_ACCEPTED = 426,      /*[R] Partial item not accepted */
124         COMMAND_RESULT_NOT_EMPTY = 427, /*[D] Item not empty */
125         COMMAND_RESULT_COMMAND_FAIL = 500       /*[ARD] Command failed exception */
126 } command_result_e;
127
128 #endif                          /* SE_COMMON_H_ */