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
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"
24 class InterfaceToolbar
;
27 struct interface_values
29 QThread
*reader_thread
;
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
44 explicit InterfaceToolbar(QWidget
*parent
= 0, const iface_toolbar
*toolbar
= NULL
);
47 void startCapture(GArray
*ifaces
);
49 bool hasInterface(QString ifname
);
52 void interfaceListChanged();
53 void controlReceived(QString ifname
, int num
, int command
, QByteArray message
);
59 void startReaderThread(QString ifname
, void *control_in
);
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();
72 void on_interfacesComboBox_currentTextChanged(const QString
&ifname
);
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_
;
96 #endif // INTERFACE_TOOLBAR_H