Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
interface_tree_model.h
Go to the documentation of this file.
1
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
62
66class InterfaceTreeModel : public QAbstractTableModel
67{
68 Q_OBJECT
69
70public:
75 InterfaceTreeModel(QObject *parent);
76
81
87 int rowCount(const QModelIndex &parent = QModelIndex()) const;
88
94 int columnCount(const QModelIndex &parent = QModelIndex()) const;
95
102 QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const;
103
111 QVariant headerData(int section, Qt::Orientation orientation, int role) const;
112
117 void updateStatistic(unsigned int row);
118
119#ifdef HAVE_LIBPCAP
124 void setCache(if_stat_cache_t *stat_cache);
125
129 void stopStatistic();
130#endif
131
136 QString interfaceError();
137
142 QItemSelection selectedDevices();
143
149 bool updateSelectedDevices(QItemSelection sourceSelection);
150
158 QVariant getColumnContent(int idx, int col, int role = Qt::DisplayRole);
159
160#ifdef HAVE_PCAP_REMOTE
166 bool isRemote(int idx);
167#endif
168
170 static const QString DefaultNumericValue;
171
172public slots:
177
178private:
184 QVariant toolTipForInterface(int idx) const;
185
187 QMap<QString, PointList> points;
188
190 QMap<QString, bool> active;
191
192#ifdef HAVE_LIBPCAP
194 if_stat_cache_t *stat_cache_;
195#endif // HAVE_LIBPCAP
196};
197
198#endif // INTERFACE_TREE_MODEL_H
A table model representing the system's available capture interfaces.
Definition interface_tree_model.h:67
bool updateSelectedDevices(QItemSelection sourceSelection)
Updates the internal state of selected devices based on a UI selection.
Definition interface_tree_model.cpp:502
~InterfaceTreeModel()
Destroys the InterfaceTreeModel.
Definition interface_tree_model.cpp:52
QString interfaceError()
Retrieves any current interface-related error messages.
Definition interface_tree_model.cpp:62
int columnCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of columns in the table model.
Definition interface_tree_model.cpp:106
QVariant headerData(int section, Qt::Orientation orientation, int role) const
Retrieves the header data for a specific section and role.
Definition interface_tree_model.cpp:269
void interfaceListChanged()
Slot triggered when the global list of available interfaces changes.
Definition interface_tree_model.cpp:349
int rowCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of rows (interfaces) under a given parent.
Definition interface_tree_model.cpp:96
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Retrieves data from the model for a given index and role.
Definition interface_tree_model.cpp:112
void updateStatistic(unsigned int row)
Triggers an update of the statistics (like sparklines) for a specific row.
Definition interface_tree_model.cpp:426
static const QString DefaultNumericValue
Definition interface_tree_model.h:170
QItemSelection selectedDevices()
Retrieves the currently selected devices as an item selection.
Definition interface_tree_model.cpp:481
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:329
InterfaceTreeColumns
Column indices for the interface tree model shared across interface-related views.
Definition interface_tree_model.h:42
@ IFTREE_COL_ACTIVE
Definition interface_tree_model.h:54
@ IFTREE_COL_TYPE
Definition interface_tree_model.h:53
@ IFTREE_COL_COMMENT
Definition interface_tree_model.h:49
@ IFTREE_COL_DLT
Definition interface_tree_model.h:51
@ IFTREE_COL_EXTCAP
Definition interface_tree_model.h:43
@ IFTREE_COL_NAME
Definition interface_tree_model.h:48
@ IFTREE_COL_EXTCAP_PATH
Definition interface_tree_model.h:44
@ IFTREE_COL_BUFFERLEN
Definition interface_tree_model.h:56
@ IFTREE_COL_STATS
Definition interface_tree_model.h:50
@ IFTREE_COL_SNAPLEN
Definition interface_tree_model.h:55
@ IFTREE_COL_HIDDEN
Definition interface_tree_model.h:45
@ IFTREE_COL_PROMISCUOUSMODE
Definition interface_tree_model.h:52
@ IFTREE_COL_MAX
Definition interface_tree_model.h:60
@ IFTREE_COL_DESCRIPTION
Definition interface_tree_model.h:47
@ IFTREE_COL_CAPTURE_FILTER
Definition interface_tree_model.h:58
@ IFTREE_COL_PIPE_PATH
Definition interface_tree_model.h:59
@ IFTREE_COL_MONITOR_MODE
Definition interface_tree_model.h:57
@ IFTREE_COL_DISPLAY_NAME
Definition interface_tree_model.h:46