Wireshark  4.3.0
The Wireshark network protocol analyzer
simple_dialog.h
Go to the documentation of this file.
1 
13 #ifndef __SIMPLE_DIALOG_UI_H__
14 #define __SIMPLE_DIALOG_UI_H__
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif /* __cplusplus */
19 
27 typedef enum {
36 
38 #define ESD_BTN_NONE 0x00
40 #define ESD_BTN_OK 0x01
42 #define ESD_BTN_CANCEL 0x02
44 #define ESD_BTN_YES 0x04
46 #define ESD_BTN_NO 0x08
48 #define ESD_BTN_CLEAR 0x10
50 #define ESD_BTN_SAVE 0x20
52 #define ESD_BTN_DONT_SAVE 0x40
54 #define ESD_BTN_QUIT_DONT_SAVE 0x80
55 
57 #define ESD_BTNS_OK_CANCEL (ESD_BTN_OK|ESD_BTN_CANCEL)
59 #define ESD_BTNS_YES_NO (ESD_BTN_YES|ESD_BTN_NO)
61 #define ESD_BTNS_YES_NO_CANCEL (ESD_BTN_YES|ESD_BTN_NO|ESD_BTN_CANCEL)
63 #define ESD_BTNS_SAVE_DONTSAVE (ESD_BTN_SAVE|ESD_BTN_DONT_SAVE)
64 #define ESD_BTNS_SAVE_DONTSAVE_CANCEL (ESD_BTN_DONT_SAVE|ESD_BTN_CANCEL|ESD_BTN_SAVE)
66 #define ESD_BTNS_SAVE_QUIT_DONTSAVE_CANCEL (ESD_BTN_QUIT_DONT_SAVE|ESD_BTN_CANCEL|ESD_BTN_SAVE)
68 #define ESD_BTNS_QUIT_DONTSAVE_CANCEL (ESD_BTN_QUIT_DONT_SAVE|ESD_BTN_CANCEL)
69 
78 /*
79  * XXX This is a bit clunky. We typically pass in:
80  * - simple_dialog_primary_start
81  * - The primary message
82  * - simple_dialog_primary_end
83  * - Optionally, the secondary message.
84  *
85  * In the Qt UI we use primary_start and _end to split the primary and
86  * secondary messages. They are then added to a QMessageBox via setText and
87  * setInformativeText respectively. No formatting is applied.
88  *
89  * Callers are responsible for wrapping the primary message and formatting
90  * the message text.
91  *
92  * Explicitly passing in separate primary and secondary messages would let us
93  * get rid of primary_start and primary_end and reduce the amount of
94  * gymnastics we have to do in the Qt UI.
95  */
96 extern gpointer simple_dialog(ESD_TYPE_E type, gint btn_mask,
97  const gchar *msg_format, ...)
98  G_GNUC_PRINTF(3, 4);
99 
100 extern gpointer simple_dialog_async(ESD_TYPE_E type, gint btn_mask,
101  const gchar *msg_format, ...)
102  G_GNUC_PRINTF(3, 4);
103 
107 extern const char *simple_dialog_primary_start(void);
111 extern const char *simple_dialog_primary_end(void);
112 
119 extern char *simple_dialog_format_message(const char *msg);
120 
121 /*
122  * Alert box, with optional "don't show this message again" variable
123  * and checkbox, and optional secondary text.
124  */
125 extern void simple_message_box(ESD_TYPE_E type, gboolean *notagain,
126  const char *secondary_msg,
127  const char *msg_format, ...) G_GNUC_PRINTF(4, 5);
128 
129 /*
130  * Error alert box, taking a format and a va_list argument.
131  */
132 extern void vsimple_error_message_box(const char *msg_format, va_list ap);
133 
134 /*
135  * Error alert box, taking a format and a list of arguments.
136  */
137 extern void simple_error_message_box(const char *msg_format, ...) G_GNUC_PRINTF(1, 2);
138 
139 /*
140  * Warning alert box, taking a format and a va_list argument.
141  */
142 extern void vsimple_warning_message_box(const char *msg_format, va_list ap);
143 
144 #ifdef __cplusplus
145 }
146 #endif /* __cplusplus */
147 
148 #endif /* __SIMPLE_DIALOG_UI_H__ */
gpointer gpointer const char * simple_dialog_primary_start(void)
Definition: simple_dialog.cpp:78
ESD_TYPE_E
Definition: simple_dialog.h:27
@ ESD_TYPE_CONFIRMATION
Definition: simple_dialog.h:31
@ ESD_TYPE_STOP
Definition: simple_dialog.h:34
@ ESD_TYPE_WARN
Definition: simple_dialog.h:30
@ ESD_TYPE_INFO
Definition: simple_dialog.h:28
@ ESD_TYPE_ERROR
Definition: simple_dialog.h:33
const char * simple_dialog_primary_end(void)
Definition: simple_dialog.cpp:83
gpointer simple_dialog(ESD_TYPE_E type, gint btn_mask, const gchar *msg_format,...) G_GNUC_PRINTF(3
char * simple_dialog_format_message(const char *msg)
Definition: simple_dialog.cpp:88