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:
125 void updateWidgets();
126
130 void onControlButtonClicked();
131
135 void onLogButtonClicked();
136
140 void onHelpButtonClicked();
141
145 void onRestoreButtonClicked();
146
151 void onCheckBoxChanged(int state);
152
157 void onComboBoxChanged(int idx);
158
162 void onLineEditChanged();
163
167 void closeLog();
168
173 void on_interfacesComboBox_currentTextChanged(const QString &ifname);
174
175private:
180 void initializeControls(const iface_toolbar *toolbar);
181
187 void setDefaultValue(int num, const QByteArray &value);
188
193 void sendChangedValues(QString ifname);
194
200 QWidget *createCheckbox(iface_toolbar_control *control);
201
207 QWidget *createButton(iface_toolbar_control *control);
208
214 QWidget *createSelector(iface_toolbar_control *control);
215
221 QWidget *createString(iface_toolbar_control *control);
222
230 void controlSend(QString ifname, int num, int type, const QByteArray &payload);
231
238 void setWidgetValue(QWidget *widget, int type, QByteArray payload);
239
248 void setInterfaceValue(QString ifname, QWidget *widget, int num, int type, QByteArray payload);
249
251 Ui::InterfaceToolbar *ui;
252
254 QMap<QString, struct interface_values> interface_;
255
257 QMap<int, QByteArray> default_value_;
258
260 QMap<int, QList<QByteArray> > default_list_;
261
263 QMap<int, QWidget *> control_widget_;
264
266 QMap<int, QWidget *> label_widget_;
267
269 QString help_link_;
270
272 bool use_spacer_;
273};
274
275#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:110
void stopCapture()
Stops the capture and disables active controls.
Definition interface_toolbar.cpp:821
bool hasInterface(QString ifname) const
Checks if this toolbar is managing a specific interface.
Definition interface_toolbar.cpp:912
void captureEventHandler(CaptureEvent ev)
Slot triggered when the current CaptureFile has an Event.
Definition interface_toolbar.cpp:741
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:552
void startCapture(GArray *ifaces)
Initializes and starts the capture controls for the given interfaces.
Definition interface_toolbar.cpp:774
void interfaceListChanged()
Slot triggered when the global list of interfaces changes.
Definition interface_toolbar.cpp:962
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