Kerberos: add kerberos_inject_longterm_key() helper function
[wireshark-sm.git] / ui / qt / models / dissector_tables_model.h
blob40d63f94fe36b1384cc01be30c0c4fa6d7808825
1 /** @file
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
10 #ifndef DISSECTOR_TABLES_MODEL_H
11 #define DISSECTOR_TABLES_MODEL_H
13 #include <config.h>
15 #include <ui/qt/models/tree_model_helpers.h>
17 #include <QSortFilterProxyModel>
19 class DissectorTablesItem : public ModelHelperTreeItem<DissectorTablesItem>
21 public:
22 DissectorTablesItem(QString tableName, QString dissectorDescription, DissectorTablesItem* parent);
23 virtual ~DissectorTablesItem();
25 QString tableName() const {return tableName_;}
26 QString dissectorDescription() const {return dissectorDescription_;}
28 virtual bool lessThan(DissectorTablesItem &right) const;
30 protected:
31 QString tableName_;
32 QString dissectorDescription_;
35 class DissectorTablesModel : public QAbstractItemModel
37 Q_OBJECT
39 public:
40 explicit DissectorTablesModel(QObject * parent = Q_NULLPTR);
41 virtual ~DissectorTablesModel();
43 enum DissectorTablesColumn {
44 colTableName = 0,
45 colDissectorDescription,
46 colLast
49 QModelIndex index(int row, int column,
50 const QModelIndex & = QModelIndex()) const;
51 QModelIndex parent(const QModelIndex &) const;
52 QVariant data(const QModelIndex &index, int role) const;
54 int rowCount(const QModelIndex &parent = QModelIndex()) const;
55 int columnCount(const QModelIndex &parent = QModelIndex()) const;
57 void populate();
59 private:
60 DissectorTablesItem* root_;
63 class DissectorTablesProxyModel : public QSortFilterProxyModel
65 Q_OBJECT
67 public:
68 explicit DissectorTablesProxyModel(QObject * parent = Q_NULLPTR);
70 virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
72 QVariant headerData(int section, Qt::Orientation orientation,
73 int role = Qt::DisplayRole) const;
75 void adjustHeader(const QModelIndex &currentIndex);
76 void setFilter(const QString& filter);
78 protected:
79 bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const;
80 bool filterAcceptItem(DissectorTablesItem& item) const;
82 private:
84 QString tableName_;
85 QString dissectorDescription_;
86 QString filter_;
89 #endif // DISSECTOR_TABLES_MODEL_H