Initialize Tizen 2.3
[framework/system/oma-dm-agent.git] / include / framework / ui-event-handler / user-interaction / user_interaction.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 SA_USERINTERACTION_H_
19 #define SA_USERINTERACTION_H_
20
21 /*lib*/
22 #include <glib.h>
23
24 /*dm-agent*/
25 #include "common/dm_error.h"
26 #include "serviceadapter/sa_define.h"
27 #include "ipc_common.h"
28
29 typedef struct _uic_option {
30         char *min_t;
31         char *max_t;
32         char *default_data;
33         char *maxlen;
34         char *input_type;
35         char *echo_type;
36 } uic_option;
37
38 typedef struct _uic_res_data {
39         uic_type type;
40         int status;
41         char *input_text;
42         GList *res_multi_data;
43 } uic_res_data;
44
45 typedef struct _uic_data {
46         uic_option *pUic_option;
47         char *display;
48         GList *multi_data;
49         uic_res_data *res_data;
50 } uic_data;
51
52 /**
53  * @par Description: API to free uic data
54  *
55  *
56  * @par Purpose:
57  * @par Typical use case:
58  * @par Method of function operation:
59  * @par Important notes:
60  * @param[in]   uic_data
61  *
62  * @return
63  *
64  *
65  * @par Errors:
66  *
67  * @pre None.
68  * @post
69  * @see
70  * @remarks None.
71  *
72  * @par Sample Code:
73  * @code
74  * @endcode
75  */
76 void free_uic_value(uic_data ** uic_value);
77
78 /**
79  * @par Description: API to free uic res data
80  *
81  *
82  * @par Purpose:
83  * @par Typical use case:
84  * @par Method of function operation:
85  * @par Important notes:
86  * @param[in]   res_data
87  *
88  * @return
89  *
90  *
91  * @par Errors:
92  *
93  * @pre None.
94  * @post
95  * @see
96  * @remarks None.
97  *
98  * @par Sample Code:
99  * @code
100  * @endcode
101  */
102 void free_res_data(uic_res_data * res_data);
103 /**
104  * @par Description: API to execute user interaction option
105  *
106  *
107  * @par Purpose:
108  * @par Typical use case:
109  * @par Method of function operation:
110  * @par Important notes:
111  * @param[in]   data
112  * @param[in]   uic_option
113  *
114  * @return                      DM_OK                           success
115  *                                      DM_ERROR                fail
116  *
117  *
118  * @par Errors:
119  *
120  * @pre None.
121  * @post
122  * @see
123  * @remarks None.
124  *
125  * @par Sample Code:
126  * @code
127  * @endcode
128  */
129 DM_ERROR exec_userinteration_option(char *data, uic_option ** uic_value);
130
131 /**
132  * @par Description: API to display uic
133  *
134  *
135  * @par Purpose:
136  * @par Typical use case:
137  * @par Method of function operation:
138  * @par Important notes:
139  * @param[in]   uic_data
140  *
141  * @return                      DM_OK                           success
142  *                                      DM_ERROR                fail
143  *
144  *
145  * @par Errors:
146  *
147  * @pre None.
148  * @post
149  * @see
150  * @remarks None.
151  *
152  * @par Sample Code:
153  * @code
154  * @endcode
155  */
156 DM_ERROR ui_display(uic_data * uic_value);
157
158 /**
159  * @par Description: API to confirm uic
160  *
161  *
162  * @par Purpose:
163  * @par Typical use case:
164  * @par Method of function operation:
165  * @par Important notes:
166  * @param[in]   uic_data
167  *
168  * @return                      DM_OK                           success
169  *                                      DM_ERROR                fail
170  *
171  *
172  * @par Errors:
173  *
174  * @pre None.
175  * @post
176  * @see
177  * @remarks None.
178  *
179  * @par Sample Code:
180  * @code
181  * @endcode
182  */
183 DM_ERROR ui_confirm_or_reject(uic_data * uic_value);
184
185 /**
186  * @par Description: API to input uic
187  *
188  *
189  * @par Purpose:
190  * @par Typical use case:
191  * @par Method of function operation:
192  * @par Important notes:
193  * @param[in]   uic_data
194  *
195  * @return                      DM_OK                           success
196  *                                      DM_ERROR                fail
197  *
198  *
199  * @par Errors:
200  *
201  * @pre None.
202  * @post
203  * @see
204  * @remarks None.
205  *
206  * @par Sample Code:
207  * @code
208  * @endcode
209  */
210 DM_ERROR ui_text_input(uic_data * uic_value, char **result_data);
211
212 /**
213  * @par Description: API to single choice uic
214  *
215  *
216  * @par Purpose:
217  * @par Typical use case:
218  * @par Method of function operation:
219  * @par Important notes:
220  * @param[in]   uic_data
221  * @param[in]   response item
222  *
223  * @return                      DM_OK                           success
224  *                                      DM_ERROR                fail
225  *
226  *
227  * @par Errors:
228  *
229  * @pre None.
230  * @post
231  * @see
232  * @remarks None.
233  *
234  * @par Sample Code:
235  * @code
236  * @endcode
237  */
238 DM_ERROR ui_single_choice(uic_data * uic_value, GList ** responseItems);
239
240 /**
241  * @par Description: API to multiple choice uic
242  *
243  *
244  * @par Purpose:
245  * @par Typical use case:
246  * @par Method of function operation:
247  * @par Important notes:
248  * @param[in]   uic_data
249  * @param[in]   response item
250  *
251  * @return                      DM_OK                           success
252  *                                      DM_ERROR                fail
253  *
254  *
255  * @par Errors:
256  *
257  * @pre None.
258  * @post
259  * @see
260  * @remarks None.
261  *
262  * @par Sample Code:
263  * @code
264  * @endcode
265  */
266 DM_ERROR ui_multiple_choice(uic_data * uic_value, GList ** responseItems);
267
268 #endif                          /* SA_USERINTERACTION_H_ */