diff options
author | Kevin Ferrare <kevin@rockbox.org> | 2005-11-18 02:07:02 +0000 |
---|---|---|
committer | Kevin Ferrare <kevin@rockbox.org> | 2005-11-18 02:07:02 +0000 |
commit | 8719f0913a0f2d8a90e9ecbc7c0e5336369af6be (patch) | |
tree | b336928b98e48a15d0d1c176105fa21ac557b7c9 /apps/gui/yesno.h | |
parent | ec0a8a749bbc3aa25bf4c136352725bd9d2532b5 (diff) | |
download | rockbox-8719f0913a0f2d8a90e9ecbc7c0e5336369af6be.tar.gz rockbox-8719f0913a0f2d8a90e9ecbc7c0e5336369af6be.zip |
generic multi-screen support for yes/no screens (like the one when reseting settings or when firmware has changed)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7951 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/yesno.h')
-rw-r--r-- | apps/gui/yesno.h | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/apps/gui/yesno.h b/apps/gui/yesno.h new file mode 100644 index 0000000000..ac6500daf8 --- /dev/null +++ b/apps/gui/yesno.h | |||
@@ -0,0 +1,91 @@ | |||
1 | #ifndef _GUI_YESNO_H_ | ||
2 | #define _GUI_YESNO_H_ | ||
3 | |||
4 | #include "screen_access.h" | ||
5 | #include "textarea.h" | ||
6 | |||
7 | #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ | ||
8 | (CONFIG_KEYPAD == IRIVER_H300_PAD) | ||
9 | #define YESNO_OK BUTTON_SELECT | ||
10 | #define YESNO_RC_OK BUTTON_RC_MENU | ||
11 | |||
12 | #elif CONFIG_KEYPAD == RECORDER_PAD | ||
13 | #define YESNO_OK BUTTON_PLAY | ||
14 | #define YESNO_RC_OK BUTTON_RC_PLAY | ||
15 | |||
16 | #elif CONFIG_KEYPAD == PLAYER_PAD | ||
17 | #define YESNO_OK BUTTON_PLAY | ||
18 | #define YESNO_RC_OK BUTTON_RC_PLAY | ||
19 | |||
20 | #elif CONFIG_KEYPAD == ONDIO_PAD | ||
21 | #define YESNO_OK BUTTON_RIGHT | ||
22 | |||
23 | #elif CONFIG_KEYPAD == GMINI100_PAD | ||
24 | #define YESNO_OK BUTTON_PLAY | ||
25 | |||
26 | #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD) | ||
27 | #define YESNO_OK BUTTON_RIGHT | ||
28 | #endif | ||
29 | enum yesno_res | ||
30 | { | ||
31 | YESNO_YES, | ||
32 | YESNO_NO, | ||
33 | YESNO_USB | ||
34 | }; | ||
35 | |||
36 | struct gui_yesno | ||
37 | { | ||
38 | struct text_message * main_message; | ||
39 | struct text_message * result_message[2]; | ||
40 | |||
41 | struct screen * display; | ||
42 | }; | ||
43 | |||
44 | /* | ||
45 | * Initializes the yesno asker | ||
46 | * - yn : the yesno structure | ||
47 | * - main_message : the question the user has to answer | ||
48 | * - yes_message : message displayed if answer is 'yes' | ||
49 | * - no_message : message displayed if answer is 'no' | ||
50 | */ | ||
51 | extern void gui_yesno_init(struct gui_yesno * yn, | ||
52 | struct text_message * main_message, | ||
53 | struct text_message * yes_message, | ||
54 | struct text_message * no_message); | ||
55 | |||
56 | /* | ||
57 | * Attach the yesno to a screen | ||
58 | * - yn : the yesno structure | ||
59 | * - display : the screen to attach | ||
60 | */ | ||
61 | extern void gui_yesno_set_display(struct gui_yesno * yn, | ||
62 | struct screen * display); | ||
63 | |||
64 | /* | ||
65 | * Draws the yesno | ||
66 | * - yn : the yesno structure | ||
67 | */ | ||
68 | extern void gui_yesno_draw(struct gui_yesno * yn); | ||
69 | |||
70 | /* | ||
71 | * Draws the yesno result | ||
72 | * - yn : the yesno structure | ||
73 | * - result : the result tha must be displayed : | ||
74 | * YESNO_NO if no | ||
75 | * YESNO_YES if yes | ||
76 | */ | ||
77 | extern bool gui_yesno_draw_result(struct gui_yesno * yn, enum yesno_res result); | ||
78 | |||
79 | /* | ||
80 | * Runs the yesno asker : | ||
81 | * it will display the 'main_message' question, and wait for user keypress | ||
82 | * PLAY means yes, other keys means no | ||
83 | * - main_message : the question the user has to answer | ||
84 | * - yes_message : message displayed if answer is 'yes' | ||
85 | * - no_message : message displayed if answer is 'no' | ||
86 | */ | ||
87 | extern enum yesno_res gui_syncyesno_run( | ||
88 | struct text_message * main_message, | ||
89 | struct text_message * yes_message, | ||
90 | struct text_message * no_message); | ||
91 | #endif /* _GUI_YESNO_H_ */ | ||