Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
interface_tree_model.h
Go to the documentation of this file.
1
11
12#ifndef INTERFACE_TREE_MODEL_H
13#define INTERFACE_TREE_MODEL_H
14
15#include <config.h>
16#include <wireshark.h>
17
18#ifdef HAVE_LIBPCAP
19#include "ui/capture.h"
20#include "ui/capture_globals.h"
21#endif
22
23#include <QAbstractTableModel>
24#include <QList>
25#include <QMap>
26#include <QItemSelection>
27
28typedef QList<int> PointList;
29
31
64
68class InterfaceTreeModel : public QAbstractTableModel
69{
70 Q_OBJECT
71
72public:
77 InterfaceTreeModel(QObject *parent);
78
83
89 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
90
96 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
97
104 QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const override;
105
113 QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
114
123 void setStatistics(InterfaceStatistics *statistics);
124
129 QString interfaceError();
130
135 QItemSelection selectedDevices();
136
142 bool updateSelectedDevices(QItemSelection sourceSelection);
143
151 QVariant getColumnContent(int idx, int col, int role = Qt::DisplayRole);
152
153#ifdef HAVE_PCAP_REMOTE
159 bool isRemote(int idx);
160#endif
161
163 static const QString DefaultNumericValue;
164
165public slots:
170
171private slots:
179 void connectInterfaceListManager();
180
182 void onStatisticsUpdated();
183
185 void onActivityChanged();
186
187private:
193 QVariant toolTipForInterface(int idx) const;
194
196 InterfaceStatistics *interface_stats_;
197};
198
199#endif // INTERFACE_TREE_MODEL_H
GUI-thread facade that owns the interface-statistics sampler and is the single source of truth for pe...
Definition interface_statistics.h:50
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Retrieves the header data for a specific section and role.
Definition interface_tree_model.cpp:283
void setStatistics(InterfaceStatistics *statistics)
Sets the statistics provider supplying sparkline/activity data.
Definition interface_tree_model.cpp:421
bool updateSelectedDevices(QItemSelection sourceSelection)
Updates the internal state of selected devices based on a UI selection.
Definition interface_tree_model.cpp:477
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns in the table model.
Definition interface_tree_model.cpp:115
~InterfaceTreeModel()
Destroys the InterfaceTreeModel.
Definition interface_tree_model.cpp:59
InterfaceTreeModel(QObject *parent)
Constructs a new InterfaceTreeModel.
Definition interface_tree_model.cpp:46
QString interfaceError()
Retrieves any current interface-related error messages.
Definition interface_tree_model.cpp:71
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Retrieves data from the model for a given index and role.
Definition interface_tree_model.cpp:121
void interfaceListChanged()
Slot triggered when the global list of available interfaces changes.
Definition interface_tree_model.cpp:363
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows (interfaces) under a given parent.
Definition interface_tree_model.cpp:105
static const QString DefaultNumericValue
Definition interface_tree_model.h:163
QItemSelection selectedDevices()
Retrieves the currently selected devices as an item selection.
Definition interface_tree_model.cpp:456
QVariant getColumnContent(int idx, int col, int role=Qt::DisplayRole)
Gets the content for a specific column and row directly.
Definition interface_tree_model.cpp:343
InterfaceTreeColumns
Column indices for the interface tree model shared across interface-related views.
Definition interface_tree_model.h:44
@ IFTREE_COL_ACTIVE
Definition interface_tree_model.h:56
@ IFTREE_COL_TYPE
Definition interface_tree_model.h:55
@ IFTREE_COL_COMMENT
Definition interface_tree_model.h:51
@ IFTREE_COL_DLT
Definition interface_tree_model.h:53
@ IFTREE_COL_EXTCAP
Definition interface_tree_model.h:45
@ IFTREE_COL_NAME
Definition interface_tree_model.h:50
@ IFTREE_COL_EXTCAP_PATH
Definition interface_tree_model.h:46
@ IFTREE_COL_BUFFERLEN
Definition interface_tree_model.h:58
@ IFTREE_COL_STATS
Definition interface_tree_model.h:52
@ IFTREE_COL_SNAPLEN
Definition interface_tree_model.h:57
@ IFTREE_COL_HIDDEN
Definition interface_tree_model.h:47
@ IFTREE_COL_PROMISCUOUSMODE
Definition interface_tree_model.h:54
@ IFTREE_COL_MAX
Definition interface_tree_model.h:62
@ IFTREE_COL_DESCRIPTION
Definition interface_tree_model.h:49
@ IFTREE_COL_CAPTURE_FILTER
Definition interface_tree_model.h:60
@ IFTREE_COL_PIPE_PATH
Definition interface_tree_model.h:61
@ IFTREE_COL_MONITOR_MODE
Definition interface_tree_model.h:59
@ IFTREE_COL_DISPLAY_NAME
Definition interface_tree_model.h:48