Tizen 2.0 Release
[framework/system/oma-dm-agent.git] / include / dm-engine / dm_common_engine.h
1 /*
2  * oma-dm-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 DM_COMMON_ENGINE_H_
19 #define DM_COMMON_ENGINE_H_
20
21 /*dm-agent*/
22 #include "common/dm_error.h"
23 #include "common/dm_common_def.h"
24 #include "common/dm_common.h"
25 #include "framework/san-parser/pm_sanparser.h"
26 #include "framework/platform-event-handler/dm_platform_event_handler_internal.h"
27 #include "framework/platform-event-handler/dm_platform_event_handler.h"
28
29 #define CHECK_OPERATION                          1
30 #define NON_CHECK_OPERATION      0
31
32 /**
33  * @par Description: API to get service engine id
34  *
35  *
36  * @par Purpose:
37  * @par Typical use case:
38  * @par Method of function operation:
39  * @par Important notes:
40  * @param[out]  engine_id                                               engine id
41  * @param[in]   ui mode                                                 ui mode
42  *
43  * @return
44  *
45  * @par Errors:
46  *
47  * @pre None.
48  * @post
49  * @see
50  * @remarks None.
51  *
52  * @par Sample Code:
53  * @code
54  * @endcode
55  */
56 void get_service_engine_id(ENGINE_ID * service_engine_id, char *ui_mode);
57
58 /**
59  * @par Description: API to init dm engine
60  *
61  *
62  * @par Purpose:
63  * @par Typical use case:
64  * @par Method of function operation:
65  * @par Important notes:
66  * @param[out]  engine_id                                               engine id
67  * @param[in]   ui mode                                                 ui mode
68  *
69  * @return
70  *
71  * @par Errors:
72  *
73  * @pre None.
74  * @post
75  * @see
76  * @remarks None.
77  *
78  * @par Sample Code:
79  * @code
80  * @endcode
81  */
82 void init_Dm_Engine();
83
84 /**
85  * @par Description: API to engine Start
86  *
87  *
88  * @par Purpose:
89  * @par Typical use case:
90  * @par Method of function operation:
91  * @par Important notes:
92  * @param[in]   server id                                               server id
93  * @param[in]   full_path                                               full path
94  * @param[in]   correlator                                              correlator
95  * @param[in]   resultCode                                              resultCode
96  *
97  * @return                      DM_OK                                                   success
98  *                                      DM_ERRORS                                       fail
99  *
100  * @par Errors:
101  *
102  * @pre None.
103  * @post
104  * @see
105  * @remarks None.
106  *
107  * @par Sample Code:
108  * @code
109  * @endcode
110  */
111 DM_ERROR engine_start(char *server_id, char *full_path, char *correlator, ENGINE_ID * service_engine_id, int *resultCode);
112
113 /**
114  * @par Description: API to service_engine_Start
115  *
116  *
117  * @par Purpose:
118  * @par Typical use case:
119  * @par Method of function operation:
120  * @par Important notes:
121  * @param[in]   service engine id                       service engine id
122  * @param[out]  service_ret                                             service_ret
123  *
124  * @return                      DM_OK                                                   success
125  *                                      DM_ERRORS                                       fail
126  *
127  * @par Errors:
128  *
129  * @pre None.
130  * @post
131  * @see
132  * @remarks None.
133  *
134  * @par Sample Code:
135  * @code
136  * @endcode
137  */
138 DM_ERROR service_engine_start(ENGINE_ID service_engine_id, DM_ERROR * service_ret);
139
140 /**
141  * @par Description: API to set_engine_status_idle
142  *
143  *
144  * @par Purpose:
145  * @par Typical use case:
146  * @par Method of function operation:
147  * @par Important notes:
148  * @param[in]   service engine id                       service engine id
149  *
150  * @return                      DM_OK                                                   success
151  *                                      DM_ERRORS                                       fail
152  *
153  * @par Errors:
154  *
155  * @pre None.
156  * @post
157  * @see
158  * @remarks None.
159  *
160  * @par Sample Code:
161  * @code
162  * @endcode
163  */
164 DM_ERROR set_engine_status_idle(ENGINE_ID service_engine_id);
165
166 /**
167  * @par Description: API to set_end_engine_status_idle
168  *
169  *
170  * @par Purpose:
171  * @par Typical use case:
172  * @par Method of function operation:
173  * @par Important notes:
174  * @param[in]   service engine id                       service engine id
175  *
176  * @return                      DM_OK                                                   success
177  *                                      DM_ERRORS                                       fail
178  *
179  * @par Errors:
180  *
181  * @pre None.
182  * @post
183  * @see
184  * @remarks None.
185  *
186  * @par Sample Code:
187  * @code
188  * @endcode
189  */
190 DM_ERROR set_end_engine_status_idle();
191
192 /**
193  * @par Description: API to dm_common_start
194  *
195  *
196  * @par Purpose:
197  * @par Typical use case:
198  * @par Method of function operation:
199  * @par Important notes:
200  * @param[in]   Event_Contents                          Event_Contents
201  *
202  * @return                      DM_OK                                                   success
203  *                                      DM_ERRORS                                       fail
204  *
205  * @par Errors:
206  *
207  * @pre None.
208  * @post
209  * @see
210  * @remarks None.
211  *
212  * @par Sample Code:
213  * @code
214  * @endcode
215  */
216 DM_ERROR dm_common_start(Event_Contents * pEvent_data);
217
218 /**
219  * @par Description: API to dm common operation (called by task)
220  *
221  *
222  * @par Purpose:
223  * @par Typical use case:
224  * @par Method of function operation:
225  * @par Important notes:
226  * @param[in]   Event_Contents                          Event_Contents
227  *
228  * @return                      DM_OK                                                   success
229  *                                      DM_ERRORS                                       fail
230  *
231  * @par Errors:
232  *
233  * @pre None.
234  * @post
235  * @see
236  * @remarks None.
237  *
238  * @par Sample Code:
239  * @code
240  * @endcode
241  */
242 DM_ERROR dm_common_operation(Event_Contents * pEvent_data);
243
244 /**
245  * @par Description: API to genericAelrt_operation
246  *
247  *
248  * @par Purpose:
249  * @par Typical use case:
250  * @par Method of function operation:
251  * @par Important notes:
252  *      @param[in]      session                                                 session
253  * @param[in]   isFinish                                                        isFinish
254  * @param[in]   service engine id                       service engine id
255  *
256  * @return                      DM_OK                                                   success
257  *                                      DM_ERRORS                                       fail
258  *
259  * @par Errors:
260  *
261  * @pre None.
262  * @post
263  * @see
264  * @remarks None.
265  *
266  * @par Sample Code:
267  * @code
268  * @endcode
269  */
270 DM_ERROR genericalert_operation(void **session, int *isFinish, ENGINE_ID service_engine_id);
271
272 #endif                          /* DM_COMMON_ENGINE_H_ */