Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
interface_toolbar.h
Go to the documentation of this file.
1
9
10#ifndef INTERFACE_TOOLBAR_H
11#define INTERFACE_TOOLBAR_H
12
13#include <wireshark.h>
14
15#include "ui/iface_toolbar.h"
16#include "funnel_text_dialog.h"
17#include "capture_event.h"
18
19#include <QFrame>
20#include <QList>
21#include <QMap>
22#include <QString>
23
24
25namespace Ui {
26class InterfaceToolbar;
27}
28
33{
35 GAsyncQueue *control_out_queue;
36
38 QMap<int, QByteArray> value;
39
41 QMap<int, bool> value_changed;
42
44 QMap<int, QList<QByteArray> > list;
45
47 QMap<int, FunnelTextDialog *> log_dialog;
48
50 QMap<int, QString> log_text;
51
53 QMap<int, bool> widget_disabled;
54};
55
59class InterfaceToolbar : public QFrame
60{
61 Q_OBJECT
62
63public:
69 explicit InterfaceToolbar(QWidget *parent = 0, const iface_toolbar *toolbar = NULL);
70
75
80 void startCapture(GArray *ifaces);
81
85 void stopCapture();
86
92 bool hasInterface(QString ifname) const;
93
94public slots:
99
107 void controlReceived(QString ifname, int num, int command, QByteArray message);
108
114
115signals:
120
121private slots:
123 void connectInterfaceListManager();
124
128 void updateWidgets();
129
133 void onControlButtonClicked();
134
138 void onLogButtonClicked();
139
143 void onHelpButtonClicked();
144
148 void onRestoreButtonClicked();
149
154 void onCheckBoxChanged(int state);
155
160 void onComboBoxChanged(int idx);
161
165 void onLineEditChanged();
166
170 void closeLog();
171
176 void on_interfacesComboBox_currentTextChanged(const QString &ifname);
177
178private:
183 void initializeControls(const iface_toolbar *toolbar);
184
190 void setDefaultValue(int num, const QByteArray &value);
191
196 void sendChangedValues(QString ifname);
197
203 QWidget *createCheckbox(iface_toolbar_control *control);
204
210 QWidget *createButton(iface_toolbar_control *control);
211
217 QWidget *createSelector(iface_toolbar_control *control);
218
224 QWidget *createString(iface_toolbar_control *control);
225
233 void controlSend(QString ifname, int num, int type, const QByteArray &payload);
234
241 void setWidgetValue(QWidget *widget, int type, QByteArray payload);
242
251 void setInterfaceValue(QString ifname, QWidget *widget, int num, int type, QByteArray payload);
252
254 Ui::InterfaceToolbar *ui;
255
257 QMap<QString, struct interface_values> interface_;
258
260 QMap<int, QByteArray> default_value_;
261
263 QMap<int, QList<QByteArray> > default_list_;
264
266 QMap<int, QWidget *> control_widget_;
267
269 QMap<int, QWidget *> label_widget_;
270
272 QString help_link_;
273
275 bool use_spacer_;
276};
277
278#endif // INTERFACE_TOOLBAR_H
Represents an event occurring during a capture or file operation.
Definition capture_event.h:24
InterfaceToolbar(QWidget *parent=0, const iface_toolbar *toolbar=NULL)
Constructs a new InterfaceToolbar.
Definition interface_toolbar.cpp:76
~InterfaceToolbar()
Destroys the InterfaceToolbar.
Definition interface_toolbar.cpp:123
void stopCapture()
Stops the capture and disables active controls.
Definition interface_toolbar.cpp:834
bool hasInterface(QString ifname) const
Checks if this toolbar is managing a specific interface.
Definition interface_toolbar.cpp:925
void captureEventHandler(CaptureEvent ev)
Slot triggered when the current CaptureFile has an Event.
Definition interface_toolbar.cpp:754
void closeReader()
Signal emitted to request the reader threads to close.
void controlReceived(QString ifname, int num, int command, QByteArray message)
Slot triggered when a control message is received from an interface.
Definition interface_toolbar.cpp:565
void startCapture(GArray *ifaces)
Initializes and starts the capture controls for the given interfaces.
Definition interface_toolbar.cpp:787
void interfaceListChanged()
Slot triggered when the global list of interfaces changes.
Definition interface_toolbar.cpp:975
struct _iface_toolbar iface_toolbar
Describes an interface toolbar and the set of controls it exposes.
struct _iface_toolbar_control iface_toolbar_control
Describes a single control widget within an interface toolbar.
Holds state and values for a specific capture interface's toolbar.
Definition interface_toolbar.h:33
QMap< int, QList< QByteArray > > list
Definition interface_toolbar.h:44
GAsyncQueue * control_out_queue
Definition interface_toolbar.h:35
QMap< int, bool > value_changed
Definition interface_toolbar.h:41
QMap< int, FunnelTextDialog * > log_dialog
Definition interface_toolbar.h:47
QMap< int, QByteArray > value
Definition interface_toolbar.h:38
QMap< int, QString > log_text
Definition interface_toolbar.h:50
QMap< int, bool > widget_disabled
Definition interface_toolbar.h:53