3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef OMA_DM_ALERT_API_H_
19 #define OMA_DM_ALERT_API_H_
23 #endif /* __cplusplus */
26 #include "oma_dm_api_common.h"
29 * @file oma_dm_alert_api.h
30 * @brief Support to use framework event module for agent
38 * @brief Structure of sync_agent_dm_alert_option_s
40 typedef struct _ui_alert_option {
41 char *min_t; /**< minimum time */
42 char *max_t; /**< maximum time */
44 /**< default data value */
45 char *maxlen; /**< maximum length */
46 char *input_type; /**< input type */
47 char *echo_type; /**< echo type */
48 } sync_agent_dm_alert_option_s;
51 * API to Init alert ui config event API.
52 * @remarks This function is use to init alert ui config.
58 sync_agent_dm_mo_error_e err = SYNC_AGENT_DM_MO_SUCCESS;
60 err_code = sync_agent_dm_alert_init();
61 if(err != SYNC_AGENT_DM_MO_SUCCESS) {
70 * @return SYNC_AGENT_DM_MO_SUCCESS on success, SYNC_AGENT_DM_MO_FAIL on error
72 * @pre This function should be called if need to init alert ui config.
81 sync_agent_dm_error_e sync_agent_dm_alert_init();
84 * API to Deinit alert ui config event API.
85 * @remarks This function is use to deinit alert ui config.
91 sync_agent_dm_mo_error_e err = SYNC_AGENT_DM_MO_SUCCESS;
93 err_code = sync_agent_dm_alert_init();
94 if(err != SYNC_AGENT_DM_MO_SUCCESS) {
103 * @return SYNC_AGENT_DM_MO_SUCCESS on success, SYNC_AGENT_DM_MO_FAIL on error
105 * @pre This function should be called if need to deinit alert ui config.
114 sync_agent_dm_error_e sync_agent_dm_alert_deinit();
116 /*sync_agent_dm_error_e sync_agent_dm_alert_display(int response_type);*/
119 * API to Confirmation alert event API.
120 * @remarks This function is use confirmation user interaction alert ui.
126 sync_agent_dm_mo_error_e err = SYNC_AGENT_DM_MO_SUCCESS;
127 int response_type = 1; //success
129 err_code = sync_agent_dm_alert_confirmation(response_type);
130 if(err != SYNC_AGENT_DM_MO_SUCCESS) {
137 * @param[in] response_type response value
139 * @return SYNC_AGENT_DM_MO_SUCCESS on success, SYNC_AGENT_DM_MO_FAIL on error
141 * @pre This function should be called if need to confirmation user interaction alert ui.
150 sync_agent_dm_error_e sync_agent_dm_alert_confirmation(int response_type);
153 * API to Inputtext alert event API.
154 * @remarks This function is use inputtext user interaction alert ui.
160 sync_agent_dm_mo_error_e err = SYNC_AGENT_DM_MO_SUCCESS;
161 int response_type = 1; //success
162 char *text = strdup("xxxx"); //input data by ui
164 err_code = sync_agent_dm_alert_inputtext(response_type, text);
165 if(err != SYNC_AGENT_DM_MO_SUCCESS) {
172 * @param[in] response_type response value
173 * @param[in] text input text by user
175 * @return SYNC_AGENT_DM_MO_SUCCESS on success, SYNC_AGENT_DM_MO_FAIL on error
177 * @pre This function should be called if need to confirmation user interaction alert ui.
186 sync_agent_dm_error_e sync_agent_dm_alert_inputtext(int response_type, char *text);
189 * API to Single choice alert event API
190 * @remarks This function is use single choice user interaction alert ui
196 sync_agent_dm_mo_error_e err = SYNC_AGENT_DM_MO_SUCCESS;
197 int response_type = 1; //success
198 int selected_count = 1; // 1
199 char *selected_number = strdup("1");
201 err_code = sync_agent_dm_alert_single_choice(response_type, text);
202 if(err != SYNC_AGENT_DM_MO_SUCCESS) {
209 * @param[in] response_type response value
210 * @param[in] selected_count absolute "1"
211 * @param[in] selected_number clicked number by user
213 * @return SYNC_AGENT_DM_MO_SUCCESS on success, SYNC_AGENT_DM_MO_FAIL on error
215 * @pre This function should be called if need to single choice user interaction alert ui
224 sync_agent_dm_error_e sync_agent_dm_alert_single_choice(int response_type, int selected_count, char *selected_number);
227 * API to Multiple choice alert event API
228 * @remarks This function is use multiple choice user interaction alert ui
234 sync_agent_dm_mo_error_e err = SYNC_AGENT_DM_MO_SUCCESS;
235 int response_type = 1; //success
236 char *selected_number1 = strdup("1"); //input data by ui
237 char *selected_number2 = strdup("1"); //input data by ui
238 // int selected_count = 0;
240 GList * out_data_list = NULL;
241 out_data_list = g_list_append(out_data_list, selected_number1);
242 out_data_list = g_list_append(out_data_list, selected_number2);
244 // selected_count = g_list_length(out_data_list);
246 // err_code = sync_agent_dm_alert_multiple_choice(response_type, selected_count, out_data_list);
247 err_code = sync_agent_dm_alert_multiple_choice(response_type, out_data_list);
248 if(err != SYNC_AGENT_DM_MO_SUCCESS) {
255 * @param[in] response_type response value
256 * @param[in] out_data_list clicked numbers by user
258 * @return SYNC_AGENT_DM_MO_SUCCESS on success, SYNC_AGENT_DM_MO_FAIL on error
260 * @pre This function should be called if need to multiple choice user interaction alert ui
269 sync_agent_dm_error_e sync_agent_dm_alert_multiple_choice(int response_type, GList * out_data_list);
277 #endif /* __cplusplus */
278 #endif /* OMA_DM_ALERT_API_H_ */