3 * oFono - Open Source Telephony
5 * Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 enum stk_agent_result {
26 STK_AGENT_RESULT_BACK,
27 STK_AGENT_RESULT_TERMINATE,
28 STK_AGENT_RESULT_TIMEOUT,
29 STK_AGENT_RESULT_BUSY,
32 struct stk_menu_item {
40 struct stk_icon_id icon;
41 struct stk_menu_item *items;
47 typedef void (*stk_agent_display_text_cb)(enum stk_agent_result result,
50 typedef void (*stk_agent_selection_cb)(enum stk_agent_result result,
51 uint8_t id, void *user_data);
53 typedef void (*stk_agent_confirmation_cb)(enum stk_agent_result result,
57 typedef void (*stk_agent_string_cb)(enum stk_agent_result result,
58 char *string, void *user_data);
60 typedef void (*stk_agent_tone_cb)(enum stk_agent_result result,
63 typedef void (*stk_agent_display_action_cb)(enum stk_agent_result result,
66 struct stk_agent *stk_agent_new(const char *path, const char *sender,
67 ofono_bool_t remove_on_terminate);
69 void stk_agent_free(struct stk_agent *agent);
71 void stk_agent_set_removed_notify(struct stk_agent *agent,
72 ofono_destroy_func removed_cb,
75 ofono_bool_t stk_agent_matches(struct stk_agent *agent,
76 const char *path, const char *sender);
78 void stk_agent_request_cancel(struct stk_agent *agent);
80 int stk_agent_request_selection(struct stk_agent *agent,
81 const struct stk_menu *menu,
82 stk_agent_selection_cb cb,
83 void *user_data, ofono_destroy_func destroy,
86 int stk_agent_display_text(struct stk_agent *agent, const char *text,
87 const struct stk_icon_id *icon,
89 stk_agent_display_text_cb cb,
90 void *user_data, ofono_destroy_func destroy,
93 int stk_agent_request_confirmation(struct stk_agent *agent, const char *text,
94 const struct stk_icon_id *icon,
95 stk_agent_confirmation_cb cb,
97 ofono_destroy_func destroy,
100 int stk_agent_request_digit(struct stk_agent *agent, const char *text,
101 const struct stk_icon_id *icon,
102 stk_agent_string_cb cb, void *user_data,
103 ofono_destroy_func destroy, int timeout);
105 int stk_agent_request_key(struct stk_agent *agent, const char *text,
106 const struct stk_icon_id *icon,
107 ofono_bool_t unicode_charset,
108 stk_agent_string_cb cb, void *user_data,
109 ofono_destroy_func destroy, int timeout);
111 int stk_agent_request_digits(struct stk_agent *agent, const char *text,
112 const struct stk_icon_id *icon,
113 const char *default_text, int min, int max,
114 ofono_bool_t hidden, stk_agent_string_cb cb,
115 void *user_data, ofono_destroy_func destroy,
118 int stk_agent_request_input(struct stk_agent *agent, const char *text,
119 const struct stk_icon_id *icon,
120 const char *default_text,
121 ofono_bool_t unicode_charset, int min, int max,
122 ofono_bool_t hidden, stk_agent_string_cb cb,
123 void *user_data, ofono_destroy_func destroy,
126 int stk_agent_confirm_call(struct stk_agent *agent, const char *text,
127 const struct stk_icon_id *icon,
128 stk_agent_confirmation_cb cb, void *user_data,
129 ofono_destroy_func destroy, int timeout);
131 int stk_agent_play_tone(struct stk_agent *agent, const char *text,
132 const struct stk_icon_id *icon, ofono_bool_t vibrate,
133 const char *tone, stk_agent_tone_cb cb, void *user_data,
134 ofono_destroy_func destroy, int timeout);
136 int stk_agent_loop_tone(struct stk_agent *agent, const char *text,
137 const struct stk_icon_id *icon, ofono_bool_t vibrate,
138 const char *tone, stk_agent_tone_cb cb, void *user_data,
139 ofono_destroy_func destroy, int timeout);
141 void append_menu_items_variant(DBusMessageIter *iter,
142 const struct stk_menu_item *items);
144 int stk_agent_display_action_info(struct stk_agent *agent, const char *text,
145 const struct stk_icon_id *icon);
147 int stk_agent_confirm_launch_browser(struct stk_agent *agent, const char *text,
148 unsigned char icon_id, const char *url,
149 stk_agent_confirmation_cb cb,
151 ofono_destroy_func destroy,
154 int stk_agent_display_action(struct stk_agent *agent, const char *text,
155 const struct stk_icon_id *icon,
156 stk_agent_display_action_cb cb,
158 ofono_destroy_func destroy);
160 int stk_agent_confirm_open_channel(struct stk_agent *agent, const char *text,
161 const struct stk_icon_id *icon,
162 stk_agent_confirmation_cb cb,
164 ofono_destroy_func destroy,