Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
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  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef __IFACE_TOOLBAR_H__
11 #define __IFACE_TOOLBAR_H__
12 
13 #include "config.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif /* __cplusplus */
18 
19 typedef enum {
20  INTERFACE_TYPE_UNKNOWN,
21  INTERFACE_TYPE_BOOLEAN,
22  INTERFACE_TYPE_BUTTON,
23  INTERFACE_TYPE_SELECTOR,
24  INTERFACE_TYPE_STRING
25 } iface_toolbar_ctrl_type;
26 
27 typedef enum {
28  INTERFACE_ROLE_UNKNOWN,
29  INTERFACE_ROLE_CONTROL,
30  INTERFACE_ROLE_HELP,
31  INTERFACE_ROLE_LOGGER,
32  INTERFACE_ROLE_RESTORE
33 } iface_toolbar_ctrl_role;
34 
35 typedef struct _iface_toolbar_value {
36  int num;
37  gchar *value;
38  gchar *display;
39  gboolean is_default;
41 
42 typedef struct _iface_toolbar_control {
43  int num;
44  iface_toolbar_ctrl_type ctrl_type;
45  iface_toolbar_ctrl_role ctrl_role;
46  gchar *display;
47  gchar *validation;
48  gboolean is_required;
49  gchar *tooltip;
50  gchar *placeholder;
51  union {
52  gboolean boolean;
53  gchar *string;
54  } default_value;
55  GList *values;
57 
58 typedef struct _iface_toolbar {
59  gchar *menu_title;
60  gchar *help;
61  GList *ifnames;
62  GList *controls;
64 
65 typedef void (*iface_toolbar_add_cb_t)(const iface_toolbar *);
66 typedef void (*iface_toolbar_remove_cb_t)(const gchar *);
67 
68 void iface_toolbar_add(const iface_toolbar *toolbar);
69 
70 void iface_toolbar_remove(const gchar *menu_title);
71 
72 gboolean iface_toolbar_use(void);
73 
74 void iface_toolbar_register_cb(iface_toolbar_add_cb_t, iface_toolbar_remove_cb_t);
75 
76 #ifdef __cplusplus
77 }
78 #endif /* __cplusplus */
79 
80 #endif /* __IFACE_TOOLBAR_H__ */
81 
82 /*
83  * Editor modelines
84  *
85  * Local Variables:
86  * c-basic-offset: 4
87  * tab-width: 8
88  * indent-tabs-mode: nil
89  * End:
90  *
91  * ex: set shiftwidth=4 tabstop=8 expandtab:
92  * :indentSize=4:tabSize=8:noTabs=true:
93  */
Definition: iface_toolbar.h:42
Definition: iface_toolbar.h:35
Definition: iface_toolbar.h:58