Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
interface_sort_filter_model.h
Go to the documentation of this file.
1
12#ifndef INTERFACE_SORT_FILTER_MODEL_H
13#define INTERFACE_SORT_FILTER_MODEL_H
14
15#include <config.h>
16
18
19#include <QSortFilterProxyModel>
20
21class InterfaceSortFilterModel : public QSortFilterProxyModel
22{
23 Q_OBJECT
24public:
25 InterfaceSortFilterModel(QObject *parent);
26
27 void setStoreOnChange(bool storeOnChange);
28 void resetAllFilter();
29
30 void setFilterHidden(bool filter);
31 bool filterHidden() const;
32 int interfacesHidden();
33 void toggleFilterHidden();
34
35 void setSortByActivity(bool sort);
36 bool sortByActivity() const;
37
38#ifdef HAVE_PCAP_REMOTE
39 void setRemoteDisplay(bool remoteDisplay);
40 bool remoteDisplay();
41 void toggleRemoteDisplay();
42 bool remoteInterfacesExist();
43#endif
44
45 void setInterfaceTypeVisible(int ifType, bool visible);
46 bool isInterfaceTypeShown(int ifType) const;
47 void setFilterByType(bool filter, bool invert = false);
48 bool filterByType() const;
49 void toggleTypeVisibility(int ifType);
50
51 QList<int> typesDisplayed();
52
53 void setColumns(QList<InterfaceTreeColumns> columns);
54 int mapSourceToColumn(InterfaceTreeColumns mdlIndex);
55
56 QModelIndex mapToSource(const QModelIndex &proxyIndex) const;
57 QModelIndex mapFromSource(const QModelIndex &sourceIndex) const;
58
59 QString interfaceError();
60
61protected:
62 bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;
63 bool filterAcceptsColumn(int source_column, const QModelIndex & source_parent) const;
64 bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const;
65
66private:
67 bool _filterHidden;
68 bool _filterTypes;
69 bool _invertTypeFilter;
70 bool _storeOnChange;
71 bool _sortByActivity;
72
73#ifdef HAVE_PCAP_REMOTE
74 bool _remoteDisplay;
75#endif
76
77 QList<int> displayHiddenTypes;
78
79 QList<InterfaceTreeColumns> _columns;
80
81private slots:
82 void resetPreferenceData();
83};
84
85#endif // INTERFACE_SORT_FILTER_MODEL_H
Definition interface_sort_filter_model.h:22