[Diameter] Add a couple of command codes from IANA.
[metze/wireshark/wip.git] / ui / iface_toolbar.h
1 /* iface_toolbar.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #ifndef __IFACE_TOOLBAR_H__
23 #define __IFACE_TOOLBAR_H__
24
25 #include "config.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30
31 typedef enum {
32     INTERFACE_TYPE_UNKNOWN,
33     INTERFACE_TYPE_BOOLEAN,
34     INTERFACE_TYPE_BUTTON,
35     INTERFACE_TYPE_SELECTOR,
36     INTERFACE_TYPE_STRING
37 } iface_toolbar_ctrl_type;
38
39 typedef enum {
40     INTERFACE_ROLE_UNKNOWN,
41     INTERFACE_ROLE_CONTROL,
42     INTERFACE_ROLE_HELP,
43     INTERFACE_ROLE_LOGGER,
44     INTERFACE_ROLE_RESTORE
45 } iface_toolbar_ctrl_role;
46
47 typedef struct _iface_toolbar_value {
48     int num;
49     gchar *value;
50     gchar *display;
51     gboolean is_default;
52 } iface_toolbar_value;
53
54 typedef struct _iface_toolbar_control {
55     int num;
56     iface_toolbar_ctrl_type ctrl_type;
57     iface_toolbar_ctrl_role ctrl_role;
58     gchar *display;
59     gchar *validation;
60     gboolean is_required;
61     gchar *tooltip;
62     gchar *placeholder;
63     union {
64         gboolean boolean;
65         gchar *string;
66     } default_value;
67     GList *values;
68 } iface_toolbar_control;
69
70 typedef struct _iface_toolbar {
71     gchar *menu_title;
72     gchar *help;
73     GList *ifnames;
74     GList *controls;
75 } iface_toolbar;
76
77 typedef void (*iface_toolbar_add_cb_t)(const iface_toolbar *);
78 typedef void (*iface_toolbar_remove_cb_t)(const gchar *);
79
80 void iface_toolbar_add(const iface_toolbar *toolbar);
81
82 void iface_toolbar_remove(const gchar *menu_title);
83
84 gboolean iface_toolbar_use(void);
85
86 void iface_toolbar_register_cb(iface_toolbar_add_cb_t, iface_toolbar_remove_cb_t);
87
88 #ifdef __cplusplus
89 }
90 #endif /* __cplusplus */
91
92 #endif /* __IFACE_TOOLBAR_H__ */
93
94 /*
95  * Editor modelines
96  *
97  * Local Variables:
98  * c-basic-offset: 4
99  * tab-width: 8
100  * indent-tabs-mode: nil
101  * End:
102  *
103  * ex: set shiftwidth=4 tabstop=8 expandtab:
104  * :indentSize=4:tabSize=8:noTabs=true:
105  */