Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / ui / iface_toolbar.h
blobed3f695a05758b022aac01e749cf68b0e7131d5e
1 /** @file
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
10 #ifndef __IFACE_TOOLBAR_H__
11 #define __IFACE_TOOLBAR_H__
13 #include <stdbool.h>
15 #include <glib.h>
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
21 typedef enum {
22 INTERFACE_TYPE_UNKNOWN,
23 INTERFACE_TYPE_BOOLEAN,
24 INTERFACE_TYPE_BUTTON,
25 INTERFACE_TYPE_SELECTOR,
26 INTERFACE_TYPE_STRING
27 } iface_toolbar_ctrl_type;
29 typedef enum {
30 INTERFACE_ROLE_UNKNOWN,
31 INTERFACE_ROLE_CONTROL,
32 INTERFACE_ROLE_HELP,
33 INTERFACE_ROLE_LOGGER,
34 INTERFACE_ROLE_RESTORE
35 } iface_toolbar_ctrl_role;
37 typedef struct _iface_toolbar_value {
38 int num;
39 char *value;
40 char *display;
41 bool is_default;
42 } iface_toolbar_value;
44 typedef struct _iface_toolbar_control {
45 int num;
46 iface_toolbar_ctrl_type ctrl_type;
47 iface_toolbar_ctrl_role ctrl_role;
48 char *display;
49 char *validation;
50 bool is_required;
51 char *tooltip;
52 char *placeholder;
53 union {
54 bool boolean;
55 char *string;
56 } default_value;
57 GList *values;
58 } iface_toolbar_control;
60 typedef struct _iface_toolbar {
61 char *menu_title;
62 char *help;
63 GList *ifnames;
64 GList *controls;
65 } iface_toolbar;
67 typedef void (*iface_toolbar_add_cb_t)(const iface_toolbar *);
68 typedef void (*iface_toolbar_remove_cb_t)(const char *);
70 void iface_toolbar_add(const iface_toolbar *toolbar);
72 void iface_toolbar_remove(const char *menu_title);
74 bool iface_toolbar_use(void);
76 void iface_toolbar_register_cb(iface_toolbar_add_cb_t, iface_toolbar_remove_cb_t);
78 #ifdef __cplusplus
80 #endif /* __cplusplus */
82 #endif /* __IFACE_TOOLBAR_H__ */