Tizen 2.1 base
[platform/core/system/sync-agent.git] / include / plugin / device_manager_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 DEVICE_MANAGER_INTERFACE_H_
19 #define DEVICE_MANAGER_INTERFACE_H_
20
21 #include "device-manager/mdm_control_code.h"
22 #include "device-manager/mdm_error.h"
23 #include "device-manager/mdm_type.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif                          /* __cplusplus */
28
29 /**
30  * @file device_manager_interface.h
31  * @brief Defines plug-in interfaces about device manager
32  */
33
34 /** @addtogroup plugin_devicemanager DeviceManager Domain
35  * @ingroup plugin
36  *      @{
37  */
38
39 /**
40  * API to register client to the service
41  *
42  * @param[in] pkg_name client package name
43  *
44  * @return SYNC_AGENT_DM_MDM_SUCCEEDED on success, otherwise error
45  *
46  * @par Since:
47  *
48  *
49  * @see sync_agent_start_mdm_service(int, char *)
50  *
51  */
52         sync_agent_dm_mdm_return_e sync_agent_plugin_start_service(char *pkg_name);
53
54 /**
55  * API to deregister client to the service
56  * @remarks client should be called sync_agent_plugin_start_service() and returned SYNC_AGENT_DM_MDM_SUCCEEDED
57  *
58  * @param[in] pkg_name client package name
59  *
60  * @return SYNC_AGENT_DM_MDM_SUCCEEDED on success, otherwise error
61  *
62  * @par Since:
63  *
64  *
65  * @see  sync_agent_stop_mdm_service(int, char *)
66  *
67  */
68         sync_agent_dm_mdm_return_e sync_agent_plugin_stop_service(char *pkg_name);
69
70 /**
71  * API to set user value to the service
72  *
73  * @param[in] ctrl item that user want to set
74  * @param[in] va user value
75  *
76  * @return SYNC_AGENT_DM_MDM_SUCCEEDED on success, otherwise error
77  *
78  * @par Since:
79  *
80  *
81  * @see sync_agent_set_mdm_value(int, sync_agent_dm_mdm_ctrl_e, ...)
82  *
83  */
84         sync_agent_dm_mdm_return_e sync_agent_plugin_set_device_manager_value(sync_agent_dm_mdm_ctrl_e ctrl, va_list va);
85
86 /**
87  * API to get value that user want to know
88  *
89  * @param[in] ctrl item that user want to know
90  * @param[in] va as returned by sync_agent_plugin_get_device_manager_value() - service value
91  *
92  * @return SYNC_AGENT_DM_MDM_SUCCEEDED on success, otherwise error
93  *
94  * @par Since:
95  *
96  *
97  * @see sync_agent_get_mdm_value(int, sync_agent_dm_mdm_ctrl_e, ...)
98  *
99  */
100         sync_agent_dm_mdm_return_e sync_agent_plugin_get_device_manager_value(sync_agent_dm_mdm_ctrl_e ctrl, va_list va);
101
102 /**
103  * API to execute service that user want to do
104  *
105  * @param[in] ctrl item that user want to execute
106  * @param[in] va user value
107  *
108  * @return SYNC_AGENT_DM_MDM_SUCCEEDED on success, otherwise error
109  *
110  * @par Since:
111  *
112  *
113  * @see sync_agent_execute_mdm(int, sync_agent_dm_mdm_ctrl_e, ...)
114  *
115  */
116         sync_agent_dm_mdm_return_e sync_agent_plugin_execute_device_manager(sync_agent_dm_mdm_ctrl_e ctrl, va_list va);
117
118 /**
119  * API to register user callback function for each service event
120  * @remarks not supported api
121  *
122  * @param[in] event service event
123  * @param[in] callback user callback function
124  * @param[in] userdata additional user data
125  *
126  * @return SYNC_AGENT_DM_MDM_SUCCEEDED on success, otherwise error
127  *
128  * @par Since:
129  *
130  *
131  * @see dm_register_mdm_callback(int, sync_agent_dm_mdm_event_e, sync_agent_device_manager_cb, void *)
132  *
133  */
134         int sync_agent_plugin_register_device_manager_cb(sync_agent_dm_mdm_event_e event, sync_agent_device_manager_cb callback, void *userdata);
135
136 /**
137  * API to deregister user callback function that was previously registered to the service
138  * @remarks not supported api
139  *
140  * @param[in] handle
141  *
142  * @return SYNC_AGENT_DM_MDM_SUCCEEDED on success, otherwise error
143  *
144  * @par Since:
145  *
146  *
147  * @see dm_register_deregister_mdm_callback(int, int)
148  *
149  */
150         sync_agent_dm_mdm_return_e sync_agent_plugin_deregister_device_manager_cb(int handle);
151
152 /**
153  *      @}
154  */
155
156 #ifdef __cplusplus
157 }
158 #endif                          /* __cplusplus */
159 #endif                          /* DEVICE_MANAGER_INTERFACE_H_ */