Tizen 2.1 base
[platform/core/system/sync-agent.git] / include / initialization / interface.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 INITIALIZATION_INTERFACE_H_
19 #define INITIALIZATION_INTERFACE_H_
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif                          /* __cplusplus */
24
25 #include "error.h"
26
27 /**
28  * @file        interface.h
29  * @brief       Support to initialize framework for agent
30  */
31
32 /** @addtogroup initialization
33  *      @{
34  */
35
36 /**
37  * @brief       Initialization of Agent Framework
38  * @remarks     Framework will be initialized using by config file written by the agent developer.
39  * Initialization config file format is XML.
40  * @par Usage:
41  * @code
42  *
43  * const char *init_config_path = "/tmp/config_file";
44  * sync_agent_init_error_e init_error = sync_agent_init(init_config_path);
45  * if (init_error != SYNC_AGENT_INIT_SUCCESS) {
46  *   ...
47  * }
48  *
49  * @endcode
50  * @param[in]   init_config_path framework init config file - XML format
51  * @return      SYNC_AGENT_INIT_SUCCESS on success, otherwise a error value.
52  * @retval      SYNC_AGENT_INIT_SUCCESS Successful
53  * @retval      SYNC_AGENT_INIT_PARSER_FAIL Parsing the initialization config file failed
54  * @retval      SYNC_AGENT_INIT_ENGINE_CONTROLLER_FAIL Engine controller Initialization failed
55  * @retval      SYNC_AGENT_INIT_SYNC_AGENT_EVENT_FAIL Event module Initialization failed
56  * @retval      SYNC_AGENT_INIT_COMMON_DB_FAIL CommonDataBase Initialization failed
57  * @retval      SYNC_AGENT_INIT_PLUGIN_FAIL PlugIn Initialization failed
58  * @retval      SYNC_AGENT_INIT_PM_FAIL PlatformMonitor Initialization failed
59  * @retval      SYNC_AGENT_INIT_DM_FAIL DeviceManagent Initialization failed
60  * @retval      SYNC_AGENT_INIT_NETWORK_FAIL NetworkAccess Initialization failed
61  * @retval      SYNC_AGENT_INIT_DEVICE_FAIL Device Initialization failed
62  * @pre         Has not been called before. This function should be called one time.
63  * @post        Framework is initialized as described in the file. Agent can use the Framework's function.
64  */
65         sync_agent_init_error_e sync_agent_init(const char *init_config_path);
66
67 /**
68  * @brief       Deinitialization of Agent Framework
69  * @remarks Framework must be initialized using by config file written by the agent developer.
70  * @par Usage:
71  * @code
72  *
73  * const char *init_config_path = "/tmp/config_file";
74  * sync_agent_init_error_e init_error = sync_agent_init(init_config_path);
75  * if (init_error != SYNC_AGENT_INIT_SUCCESS) {
76  *    ...
77  *   }
78  *   ...
79  * sync_agent_deinit_error_e deinit_error = sync_agent_deinit();
80  * if (deinit_error != SYNC_AGENT_DEINIT_SUCCESS) {
81  *    ...
82  *   }
83  *
84  * @endcode
85  * @return      SYNC_AGENT_DEINIT_SUCCESS on success, SYNC_AGENT_DEINIT_FAIL on error
86  */
87         sync_agent_deinit_error_e sync_agent_deinit();
88
89 /**
90  *      @}
91  */
92
93 #ifdef __cplusplus
94 }
95 #endif                          /* __cplusplus */
96 #endif                          /* INITIALIZATION_INTERFACE_H_ */