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