1 /* export_objects_model.h
2 * Data model for Export Objects.
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
11 #ifndef EXPORT_OBJECTS_MODEL_H
12 #define EXPORT_OBJECTS_MODEL_H
17 #include <epan/export_object.h>
19 #include <QAbstractTableModel>
20 #include <QSortFilterProxyModel>
23 typedef struct export_object_list_gui_t {
24 class ExportObjectModel *model;
25 } export_object_list_gui_t;
27 class ExportObjectModel : public QAbstractTableModel
32 ExportObjectModel(register_eo_t* eo, QObject *parent);
34 enum ExportObjectColumn {
43 void addObjectEntry(export_object_entry_t *entry);
44 export_object_entry_t *objectEntry(int row);
47 bool saveEntry(QModelIndex &index, QString filename);
48 bool saveAllEntries(QString path);
50 const char* getTapListenerName();
52 tap_packet_cb getTapPacketFunc();
53 static void resetTap(void *tapdata);
56 QVariant data(const QModelIndex &index, int role) const;
57 QVariant headerData(int section, Qt::Orientation orientation,
58 int role = Qt::DisplayRole) const;
59 int rowCount(const QModelIndex &parent = QModelIndex()) const;
60 int columnCount(const QModelIndex &parent = QModelIndex()) const;
63 QList<QVariant> objects_;
65 export_object_list_t export_object_list_;
66 export_object_list_gui_t eo_gui_data_;
70 class ExportObjectProxyModel : public QSortFilterProxyModel
75 explicit ExportObjectProxyModel(QObject * parent = Q_NULLPTR);
78 bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const;
81 #endif // EXPORT_OBJECTS_MODEL_H