diff options
Diffstat (limited to 'apps/gui/list.h')
-rw-r--r-- | apps/gui/list.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/apps/gui/list.h b/apps/gui/list.h index 2de67f5219..253dd9bdbf 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -62,6 +62,14 @@ typedef enum themable_icons list_get_icon(int selected_item, void * data); | |||
62 | * Returns a pointer to a string that contains the text to display | 62 | * Returns a pointer to a string that contains the text to display |
63 | */ | 63 | */ |
64 | typedef char * list_get_name(int selected_item, void * data, char * buffer); | 64 | typedef char * list_get_name(int selected_item, void * data, char * buffer); |
65 | /* | ||
66 | * Voice callback | ||
67 | * - selected_item : an integer that tells the number of the item to speak | ||
68 | * - data : a void pointer to the data you gave to the list when you | ||
69 | * initialized it | ||
70 | * Returns an integer, 0 means success, ignored really... | ||
71 | */ | ||
72 | typedef int list_speak_item(int selected_item, void * data); | ||
65 | #ifdef HAVE_LCD_COLOR | 73 | #ifdef HAVE_LCD_COLOR |
66 | /* | 74 | /* |
67 | * Color callback | 75 | * Color callback |
@@ -97,9 +105,11 @@ struct gui_list | |||
97 | #endif | 105 | #endif |
98 | /* Cache the width of the title string in pixels/characters */ | 106 | /* Cache the width of the title string in pixels/characters */ |
99 | int title_width; | 107 | int title_width; |
108 | long scheduled_talk_tick, last_talked_tick; | ||
100 | 109 | ||
101 | list_get_icon *callback_get_item_icon; | 110 | list_get_icon *callback_get_item_icon; |
102 | list_get_name *callback_get_item_name; | 111 | list_get_name *callback_get_item_name; |
112 | list_speak_item *callback_speak_item; | ||
103 | 113 | ||
104 | struct screen * display; | 114 | struct screen * display; |
105 | /* The data that will be passed to the callback function YOU implement */ | 115 | /* The data that will be passed to the callback function YOU implement */ |
@@ -140,6 +150,14 @@ struct gui_list | |||
140 | #define gui_list_set_icon_callback(gui_list, _callback) \ | 150 | #define gui_list_set_icon_callback(gui_list, _callback) \ |
141 | (gui_list)->callback_get_item_icon=_callback | 151 | (gui_list)->callback_get_item_icon=_callback |
142 | 152 | ||
153 | /* | ||
154 | * Sets the voice callback function | ||
155 | * - gui_list : the list structure | ||
156 | * - _callback : the callback function | ||
157 | */ | ||
158 | #define gui_list_set_voice_callback(gui_list, _callback) \ | ||
159 | (gui_list)->callback_speak_item=_callback | ||
160 | |||
143 | #ifdef HAVE_LCD_COLOR | 161 | #ifdef HAVE_LCD_COLOR |
144 | /* | 162 | /* |
145 | * Sets the color callback function | 163 | * Sets the color callback function |
@@ -200,6 +218,8 @@ extern void gui_synclist_init( | |||
200 | ); | 218 | ); |
201 | extern void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items); | 219 | extern void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items); |
202 | extern void gui_synclist_set_icon_callback(struct gui_synclist * lists, list_get_icon icon_callback); | 220 | extern void gui_synclist_set_icon_callback(struct gui_synclist * lists, list_get_icon icon_callback); |
221 | extern void gui_synclist_set_voice_callback(struct gui_synclist * lists, list_speak_item voice_callback); | ||
222 | extern void gui_synclist_speak_item(struct gui_synclist * lists); | ||
203 | extern int gui_synclist_get_nb_items(struct gui_synclist * lists); | 223 | extern int gui_synclist_get_nb_items(struct gui_synclist * lists); |
204 | 224 | ||
205 | extern int gui_synclist_get_sel_pos(struct gui_synclist * lists); | 225 | extern int gui_synclist_get_sel_pos(struct gui_synclist * lists); |
@@ -266,4 +286,15 @@ void simplelist_addline(int line_number, const char *fmt, ...); | |||
266 | before the list is dislplayed for the first time */ | 286 | before the list is dislplayed for the first time */ |
267 | bool simplelist_show_list(struct simplelist_info *info); | 287 | bool simplelist_show_list(struct simplelist_info *info); |
268 | 288 | ||
289 | /* If the list has a pending postponed scheduled announcement, that | ||
290 | may become due before the next get_action tmieout. This function | ||
291 | adjusts the get_action timeout appropriately. */ | ||
292 | extern int list_do_action_timeout(struct gui_synclist *lists, int timeout); | ||
293 | /* This one combines a get_action call (with timeout overridden by | ||
294 | list_do_action_timeout) with the gui_synclist_do_button call, for | ||
295 | convenience. */ | ||
296 | extern bool list_do_action(int context, int timeout, | ||
297 | struct gui_synclist *lists, int *action, | ||
298 | enum list_wrap wrap); | ||
299 | |||
269 | #endif /* _GUI_LIST_H_ */ | 300 | #endif /* _GUI_LIST_H_ */ |