Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
expert_info_proxy_model.h
1 /* expert_info_model.h
2  * Data model for Expert Info tap data.
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10 
11 #ifndef EXPERT_INFO_PROXY_MODEL_H
12 #define EXPERT_INFO_PROXY_MODEL_H
13 
14 #include <config.h>
15 
16 #include <QSortFilterProxyModel>
17 
18 class ExpertPacketItem;
19 
20 class ExpertInfoProxyModel : public QSortFilterProxyModel
21 {
22  Q_OBJECT
23 
24 public:
25  ExpertInfoProxyModel(QObject *parent = 0);
26 
27  enum SeverityMode { Group, Packet };
28  enum ExpertProxyColumn {
29  colProxySeverity = 0,
30  colProxySummary,
31  colProxyGroup,
32  colProxyProtocol,
33  colProxyCount,
34  colProxyLast
35  };
36 
37  QVariant data(const QModelIndex &index, int role) const;
38  QVariant headerData(int section, Qt::Orientation orientation,
39  int role = Qt::DisplayRole) const;
40  int columnCount(const QModelIndex &parent = QModelIndex()) const;
41 
42  virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
43 
44  //GUI helpers
45  void setSeverityMode(enum SeverityMode);
46  void setSeverityFilter(int severity, bool hide);
47  void setSummaryFilter(const QString &filter);
48 
49 protected:
50  bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const;
51  bool filterAcceptItem(ExpertPacketItem& item) const;
52 
53  enum SeverityMode severityMode_;
54  QList<int> hidden_severities_;
55 
56  QString textFilter_;
57 
58 };
59 
60 #endif // EXPERT_INFO_PROXY_MODEL_H
61 
62 /*
63  * Editor modelines
64  *
65  * Local Variables:
66  * c-basic-offset: 4
67  * tab-width: 8
68  * indent-tabs-mode: nil
69  * End:
70  *
71  * ex: set shiftwidth=4 tabstop=8 expandtab:
72  * :indentSize=4:tabSize=8:noTabs=true:
73  */
Definition: expert_info_model.h:25
Definition: expert_info_proxy_model.h:20