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