Kerberos: add kerberos_inject_longterm_key() helper function
[wireshark-sm.git] / ui / qt / interface_toolbar.h
blobfc20c197b603e6a541fb2847d99e0ed13109fd09
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 INTERFACE_TOOLBAR_H
11 #define INTERFACE_TOOLBAR_H
13 #include "ui/iface_toolbar.h"
14 #include "funnel_text_dialog.h"
15 #include "interface_toolbar_reader.h"
17 #include <QFrame>
18 #include <QList>
19 #include <QMap>
20 #include <QString>
23 namespace Ui {
24 class InterfaceToolbar;
27 struct interface_values
29 QThread *reader_thread;
30 int out_fd;
31 QMap<int, QByteArray> value;
32 QMap<int, bool> value_changed;
33 QMap<int, QList<QByteArray> > list;
34 QMap<int, FunnelTextDialog *> log_dialog;
35 QMap<int, QString> log_text;
36 QMap<int, bool> widget_disabled;
39 class InterfaceToolbar : public QFrame
41 Q_OBJECT
43 public:
44 explicit InterfaceToolbar(QWidget *parent = 0, const iface_toolbar *toolbar = NULL);
45 ~InterfaceToolbar();
47 void startCapture(GArray *ifaces);
48 void stopCapture();
49 bool hasInterface(QString ifname);
51 public slots:
52 void interfaceListChanged();
53 void controlReceived(QString ifname, int num, int command, QByteArray message);
55 signals:
56 void closeReader();
58 private slots:
59 void startReaderThread(QString ifname, void *control_in);
60 void updateWidgets();
62 void onControlButtonClicked();
63 void onLogButtonClicked();
64 void onHelpButtonClicked();
65 void onRestoreButtonClicked();
66 void onCheckBoxChanged(int state);
67 void onComboBoxChanged(int idx);
68 void onLineEditChanged();
70 void closeLog();
72 void on_interfacesComboBox_currentTextChanged(const QString &ifname);
74 private:
75 void initializeControls(const iface_toolbar *toolbar);
76 void setDefaultValue(int num, const QByteArray &value);
77 void sendChangedValues(QString ifname);
78 QWidget *createCheckbox(iface_toolbar_control *control);
79 QWidget *createButton(iface_toolbar_control *control);
80 QWidget *createSelector(iface_toolbar_control *control);
81 QWidget *createString(iface_toolbar_control *control);
82 void controlSend(QString ifname, int num, int type, const QByteArray &payload);
83 void setWidgetValue(QWidget *widget, int type, QByteArray payload);
84 void setInterfaceValue(QString ifname, QWidget *widget, int num, int type, QByteArray payload);
86 Ui::InterfaceToolbar *ui;
87 QMap<QString, struct interface_values> interface_;
88 QMap<int, QByteArray> default_value_;
89 QMap<int, QList<QByteArray> > default_list_;
90 QMap<int, QWidget *> control_widget_;
91 QMap<int, QWidget *> label_widget_;
92 QString help_link_;
93 bool use_spacer_;
96 #endif // INTERFACE_TOOLBAR_H