2010-07-28 10:26:06 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* oFono - Open Source Telephony
|
|
|
|
*
|
2011-10-10 20:39:42 +00:00
|
|
|
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
2010-07-28 10:26:06 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-07-29 18:09:14 +00:00
|
|
|
struct stk_agent;
|
|
|
|
|
|
|
|
enum stk_agent_result {
|
|
|
|
STK_AGENT_RESULT_OK,
|
|
|
|
STK_AGENT_RESULT_BACK,
|
|
|
|
STK_AGENT_RESULT_TERMINATE,
|
|
|
|
STK_AGENT_RESULT_TIMEOUT,
|
2010-11-30 13:21:50 +00:00
|
|
|
STK_AGENT_RESULT_BUSY,
|
2010-07-29 18:09:14 +00:00
|
|
|
};
|
|
|
|
|
2010-07-28 10:26:08 +00:00
|
|
|
struct stk_menu_item {
|
|
|
|
char *text;
|
|
|
|
uint8_t icon_id;
|
|
|
|
uint8_t item_id;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct stk_menu {
|
|
|
|
char *title;
|
2010-10-13 13:54:10 +00:00
|
|
|
struct stk_icon_id icon;
|
2010-07-28 10:26:08 +00:00
|
|
|
struct stk_menu_item *items;
|
|
|
|
int default_item;
|
2018-12-28 19:40:34 +00:00
|
|
|
bool soft_key;
|
|
|
|
bool has_help;
|
2010-07-28 10:26:08 +00:00
|
|
|
};
|
|
|
|
|
2010-07-30 04:50:20 +00:00
|
|
|
typedef void (*stk_agent_display_text_cb)(enum stk_agent_result result,
|
|
|
|
void *user_data);
|
2010-07-28 10:26:06 +00:00
|
|
|
|
2010-07-28 10:26:10 +00:00
|
|
|
typedef void (*stk_agent_selection_cb)(enum stk_agent_result result,
|
|
|
|
uint8_t id, void *user_data);
|
|
|
|
|
2010-08-04 04:55:01 +00:00
|
|
|
typedef void (*stk_agent_confirmation_cb)(enum stk_agent_result result,
|
2018-12-28 19:40:34 +00:00
|
|
|
bool confirm,
|
2010-08-04 04:55:01 +00:00
|
|
|
void *user_data);
|
|
|
|
|
|
|
|
typedef void (*stk_agent_string_cb)(enum stk_agent_result result,
|
|
|
|
char *string, void *user_data);
|
|
|
|
|
2010-10-13 13:54:14 +00:00
|
|
|
typedef void (*stk_agent_tone_cb)(enum stk_agent_result result,
|
|
|
|
void *user_data);
|
|
|
|
|
2011-03-30 17:04:10 +00:00
|
|
|
typedef void (*stk_agent_display_action_cb)(enum stk_agent_result result,
|
2011-03-30 10:27:43 +00:00
|
|
|
void *user_data);
|
|
|
|
|
2010-07-28 10:26:06 +00:00
|
|
|
struct stk_agent *stk_agent_new(const char *path, const char *sender,
|
2018-12-28 19:40:34 +00:00
|
|
|
bool remove_on_terminate);
|
2010-07-28 10:26:06 +00:00
|
|
|
|
2010-07-29 18:11:33 +00:00
|
|
|
void stk_agent_free(struct stk_agent *agent);
|
2010-07-28 10:26:06 +00:00
|
|
|
|
2010-07-29 18:29:45 +00:00
|
|
|
void stk_agent_set_removed_notify(struct stk_agent *agent,
|
|
|
|
ofono_destroy_func removed_cb,
|
|
|
|
void *user_data);
|
|
|
|
|
2018-12-28 19:40:34 +00:00
|
|
|
bool stk_agent_matches(struct stk_agent *agent,
|
2010-07-28 10:26:06 +00:00
|
|
|
const char *path, const char *sender);
|
|
|
|
|
|
|
|
void stk_agent_request_cancel(struct stk_agent *agent);
|
2010-07-28 10:26:08 +00:00
|
|
|
|
2010-07-30 01:08:09 +00:00
|
|
|
int stk_agent_request_selection(struct stk_agent *agent,
|
2010-07-30 17:11:41 +00:00
|
|
|
const struct stk_menu *menu,
|
|
|
|
stk_agent_selection_cb cb,
|
|
|
|
void *user_data, ofono_destroy_func destroy,
|
|
|
|
int timeout);
|
2010-07-28 10:26:10 +00:00
|
|
|
|
2010-07-30 01:08:09 +00:00
|
|
|
int stk_agent_display_text(struct stk_agent *agent, const char *text,
|
2010-10-13 13:54:09 +00:00
|
|
|
const struct stk_icon_id *icon,
|
2018-12-28 19:40:34 +00:00
|
|
|
bool urgent,
|
2010-07-30 04:51:23 +00:00
|
|
|
stk_agent_display_text_cb cb,
|
2010-07-30 17:11:41 +00:00
|
|
|
void *user_data, ofono_destroy_func destroy,
|
|
|
|
int timeout);
|
2010-07-28 10:26:11 +00:00
|
|
|
|
2010-10-13 13:54:09 +00:00
|
|
|
int stk_agent_request_confirmation(struct stk_agent *agent, const char *text,
|
|
|
|
const struct stk_icon_id *icon,
|
2010-08-04 04:55:01 +00:00
|
|
|
stk_agent_confirmation_cb cb,
|
|
|
|
void *user_data,
|
|
|
|
ofono_destroy_func destroy,
|
|
|
|
int timeout);
|
|
|
|
|
2010-10-13 13:54:09 +00:00
|
|
|
int stk_agent_request_digit(struct stk_agent *agent, const char *text,
|
|
|
|
const struct stk_icon_id *icon,
|
2010-08-04 04:55:01 +00:00
|
|
|
stk_agent_string_cb cb, void *user_data,
|
|
|
|
ofono_destroy_func destroy, int timeout);
|
|
|
|
|
2012-08-28 13:21:20 +00:00
|
|
|
int stk_agent_request_quick_digit(struct stk_agent *agent, const char *text,
|
|
|
|
const struct stk_icon_id *icon,
|
|
|
|
stk_agent_string_cb cb, void *user_data,
|
|
|
|
ofono_destroy_func destroy,
|
|
|
|
int timeout);
|
|
|
|
|
2010-08-04 04:55:01 +00:00
|
|
|
int stk_agent_request_key(struct stk_agent *agent, const char *text,
|
2010-10-13 13:54:09 +00:00
|
|
|
const struct stk_icon_id *icon,
|
2018-12-28 19:40:34 +00:00
|
|
|
bool unicode_charset,
|
2010-08-04 04:55:01 +00:00
|
|
|
stk_agent_string_cb cb, void *user_data,
|
|
|
|
ofono_destroy_func destroy, int timeout);
|
|
|
|
|
2010-08-04 04:55:03 +00:00
|
|
|
int stk_agent_request_digits(struct stk_agent *agent, const char *text,
|
2010-10-13 13:54:09 +00:00
|
|
|
const struct stk_icon_id *icon,
|
|
|
|
const char *default_text, int min, int max,
|
2018-12-28 19:40:34 +00:00
|
|
|
bool hidden, stk_agent_string_cb cb,
|
2010-10-13 13:54:09 +00:00
|
|
|
void *user_data, ofono_destroy_func destroy,
|
|
|
|
int timeout);
|
2010-08-04 04:55:03 +00:00
|
|
|
|
|
|
|
int stk_agent_request_input(struct stk_agent *agent, const char *text,
|
2010-10-13 13:54:09 +00:00
|
|
|
const struct stk_icon_id *icon,
|
|
|
|
const char *default_text,
|
2018-12-28 19:40:34 +00:00
|
|
|
bool unicode_charset, int min, int max,
|
|
|
|
bool hidden, stk_agent_string_cb cb,
|
2010-08-04 04:55:03 +00:00
|
|
|
void *user_data, ofono_destroy_func destroy,
|
|
|
|
int timeout);
|
|
|
|
|
2010-08-25 15:49:15 +00:00
|
|
|
int stk_agent_confirm_call(struct stk_agent *agent, const char *text,
|
2010-10-13 13:54:09 +00:00
|
|
|
const struct stk_icon_id *icon,
|
|
|
|
stk_agent_confirmation_cb cb, void *user_data,
|
|
|
|
ofono_destroy_func destroy, int timeout);
|
2010-08-25 15:49:15 +00:00
|
|
|
|
2010-10-13 13:54:14 +00:00
|
|
|
int stk_agent_play_tone(struct stk_agent *agent, const char *text,
|
2018-12-28 19:40:34 +00:00
|
|
|
const struct stk_icon_id *icon, bool vibrate,
|
2010-10-13 13:54:14 +00:00
|
|
|
const char *tone, stk_agent_tone_cb cb, void *user_data,
|
|
|
|
ofono_destroy_func destroy, int timeout);
|
|
|
|
|
|
|
|
int stk_agent_loop_tone(struct stk_agent *agent, const char *text,
|
2018-12-28 19:40:34 +00:00
|
|
|
const struct stk_icon_id *icon, bool vibrate,
|
2010-10-13 13:54:14 +00:00
|
|
|
const char *tone, stk_agent_tone_cb cb, void *user_data,
|
|
|
|
ofono_destroy_func destroy, int timeout);
|
|
|
|
|
2010-07-28 10:26:08 +00:00
|
|
|
void append_menu_items_variant(DBusMessageIter *iter,
|
|
|
|
const struct stk_menu_item *items);
|
2010-12-23 04:39:41 +00:00
|
|
|
|
|
|
|
int stk_agent_display_action_info(struct stk_agent *agent, const char *text,
|
|
|
|
const struct stk_icon_id *icon);
|
2011-01-20 12:52:56 +00:00
|
|
|
|
|
|
|
int stk_agent_confirm_launch_browser(struct stk_agent *agent, const char *text,
|
|
|
|
unsigned char icon_id, const char *url,
|
|
|
|
stk_agent_confirmation_cb cb,
|
|
|
|
void *user_data,
|
|
|
|
ofono_destroy_func destroy,
|
|
|
|
int timeout);
|
2011-03-30 10:27:43 +00:00
|
|
|
|
|
|
|
int stk_agent_display_action(struct stk_agent *agent, const char *text,
|
|
|
|
const struct stk_icon_id *icon,
|
2011-03-30 17:04:10 +00:00
|
|
|
stk_agent_display_action_cb cb,
|
2011-03-30 10:27:43 +00:00
|
|
|
void *user_data,
|
|
|
|
ofono_destroy_func destroy);
|
2011-04-08 16:33:26 +00:00
|
|
|
|
|
|
|
int stk_agent_confirm_open_channel(struct stk_agent *agent, const char *text,
|
|
|
|
const struct stk_icon_id *icon,
|
|
|
|
stk_agent_confirmation_cb cb,
|
|
|
|
void *user_data,
|
|
|
|
ofono_destroy_func destroy,
|
|
|
|
int timeout);
|