Wireshark  4.3.0
The Wireshark network protocol analyzer
decode_as_delegate.h
Go to the documentation of this file.
1 
12 #ifndef DECODE_AS_DELEGATE_H
13 #define DECODE_AS_DELEGATE_H
14 
15 #include <config.h>
16 #include <glib.h>
17 
18 #include "cfile.h"
19 
20 #include <QStyledItemDelegate>
21 #include <QSet>
22 #include <QList>
24 
25 typedef struct _packet_proto_data_t {
26  const gchar* proto_name;
27  const gchar* table_ui_name;
28  guint8 curr_layer_num;
30 
31 class DecodeAsDelegate : public QStyledItemDelegate
32 {
33 public:
34  DecodeAsDelegate(QObject *parent = 0, capture_file *cf = NULL);
35 
36  QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
37  const QModelIndex &index) const override;
38  void destroyEditor(QWidget *editor, const QModelIndex &index) const override;
39  void setEditorData(QWidget *editor, const QModelIndex &index) const override;
40  void setModelData(QWidget *editor, QAbstractItemModel *model,
41  const QModelIndex &index) const override;
42 
43 #if 0
44  void updateEditorGeometry(QWidget *editor,
45  const QStyleOptionViewItem &option, const QModelIndex &index) const;
46 #endif
47 
48 private:
49  DecodeAsItem *indexToField(const QModelIndex &index) const;
50  void collectDAProtocols(QSet<QString>& all_protocols, QList<QString>& current_list) const;
51  void cachePacketProtocols();
52  bool isSelectorCombo(DecodeAsItem* item) const;
53 
54  static void decodeAddProtocol(const gchar *table_name, const gchar *proto_name, gpointer value, gpointer user_data);
55 
56  capture_file *cap_file_;
57  QList<packet_proto_data_t> packet_proto_list_;
58 };
59 #endif // DECODE_AS_DELEGATE_H
Definition: decode_as_delegate.h:32
Definition: decode_as_model.h:28
Definition: cfile.h:67
Definition: decode_as_delegate.h:25