Wireshark  4.3.0
The Wireshark network protocol analyzer
export_objects_model.h
Go to the documentation of this file.
1 
12 #ifndef EXPORT_OBJECTS_MODEL_H
13 #define EXPORT_OBJECTS_MODEL_H
14 
15 #include <config.h>
16 
17 #include <epan/tap.h>
18 #include <epan/export_object.h>
19 
20 #include <QAbstractTableModel>
21 #include <QSortFilterProxyModel>
22 #include <QList>
23 
24 typedef struct export_object_list_gui_t {
25  class ExportObjectModel *model;
27 
28 class ExportObjectModel : public QAbstractTableModel
29 {
30  Q_OBJECT
31 
32 public:
33  ExportObjectModel(register_eo_t* eo, QObject *parent);
34  virtual ~ExportObjectModel();
35 
36  enum ExportObjectColumn {
37  colPacket = 0,
38  colHostname,
39  colContent,
40  colSize,
41  colFilename,
42  colExportObjectMax
43  };
44 
45  void addObjectEntry(export_object_entry_t *entry);
46  export_object_entry_t *objectEntry(int row);
47  void resetObjects();
48 
49  bool saveEntry(QModelIndex &index, QString filename);
50  void saveAllEntries(QString path);
51 
52  const char* getTapListenerName();
53  void* getTapData();
54  tap_packet_cb getTapPacketFunc();
55  static void resetTap(void *tapdata);
56  void removeTap();
57 
58  QVariant data(const QModelIndex &index, int role) const;
59  QVariant headerData(int section, Qt::Orientation orientation,
60  int role = Qt::DisplayRole) const;
61  int rowCount(const QModelIndex &parent = QModelIndex()) const;
62  int columnCount(const QModelIndex &parent = QModelIndex()) const;
63 
64 private:
65  QList<QVariant> objects_;
66 
67  export_object_list_t export_object_list_;
68  export_object_list_gui_t eo_gui_data_;
69  register_eo_t* eo_;
70 };
71 
72 class ExportObjectProxyModel : public QSortFilterProxyModel
73 {
74 public:
75 
76  explicit ExportObjectProxyModel(QObject * parent = Q_NULLPTR);
77 
78  void setContentFilterString(QString contentFilter);
79  void setTextFilterString(QString textFilter);
80 
81 protected:
82  bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const;
83  bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
84 
85 private:
86  QString contentFilter_;
87  QString textFilter_;
88 
89 };
90 
91 #endif // EXPORT_OBJECTS_MODEL_H
Definition: export_objects_model.h:29
Definition: export_objects_model.h:73
Definition: export_object.h:21
Definition: export_object.h:39
Definition: export_objects_model.h:24
Definition: export_object.c:19