2 * Definitions for alert box routines with toolkit-independent APIs but
3 * toolkit-dependent implementations.
5 * $Id: simple_dialog.h,v 1.11 2004/02/12 22:24:27 guy Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #endif /* __cplusplus */
35 INFO: tells the user something they should know, but not requiring
36 any action; the only button should be "OK".
38 WARN: tells the user about a problem; the only button should be "OK"
40 CONFIRMATION: asks the user for confirmation; there should be more than
43 ERROR: tells the user about a serious problem; the only button should be
45 #define ESD_TYPE_INFO 0x00
46 #define ESD_TYPE_WARN 0x01
47 #define ESD_TYPE_CONFIRMATION 0x02
48 #define ESD_TYPE_ERROR 0x03
50 /* Which buttons to display. */
51 #define ESD_BTN_OK 0x01
52 #define ESD_BTN_CANCEL 0x02
53 #define ESD_BTN_YES 0x04
54 #define ESD_BTN_NO 0x08
55 #define ESD_BTN_CLEAR 0x10
57 #define ESD_BTNS_OK_CANCEL (ESD_BTN_OK|ESD_BTN_CANCEL)
58 #define ESD_BTNS_YES_NO (ESD_BTN_YES|ESD_BTN_NO)
59 #define ESD_BTNS_YES_NO_CANCEL (ESD_BTN_YES|ESD_BTN_NO|ESD_BTN_CANCEL)
61 /* show a simple dialog */
63 extern gpointer simple_dialog(gint type, gint btn_mask, gchar *msg_format, ...)
64 __attribute__((format (printf, 3, 4)));
66 extern gpointer simple_dialog(gint type, gint btn_mask, gchar *msg_format, ...);
69 /* callback function type */
70 typedef void (* simple_dialog_cb_t) (gpointer dialog, gint btn, gpointer data);
72 /* set the callback function, which has to be called when a button was pressed */
73 extern void simple_dialog_set_cb(gpointer dialog, simple_dialog_cb_t callback_fct, gpointer data);
75 extern char *simple_dialog_primary_start(void);
76 extern char *simple_dialog_primary_end(void);
80 #endif /* __cplusplus */
82 #endif /* __DIALOG_H__ */