| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
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
17#include "cfile.h"
18
19#include <QStyledItemDelegate>
20#include <QSet>
21#include <QList>
22#include <ui/qt/models/decode_as_model.h>
23
24 typedef struct _packet_proto_data_t {
25 const char* proto_name;
26 const char* table_ui_name;
27 uint8_t curr_layer_num;
28} packet_proto_data_t;
29
30 class DecodeAsDelegate : public QStyledItemDelegate
31{
32 public:
33 DecodeAsDelegate(QObject *parent = 0, capture_file *cf = NULL);
34
35 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
36 const QModelIndex &index) const override;
37 void destroyEditor(QWidget *editor, const QModelIndex &index) const override;
38 void setEditorData(QWidget *editor, const QModelIndex &index) const override;
39 void setModelData(QWidget *editor, QAbstractItemModel *model,
40 const QModelIndex &index) const override;
41
42#if 0
43 void updateEditorGeometry(QWidget *editor,
44 const QStyleOptionViewItem &option, const QModelIndex &index) const;
45#endif
46
47 private:
48 DecodeAsItem *indexToField(const QModelIndex &index) const;
49 void collectDAProtocols(QSet<QString>& all_protocols, QList<QString>& current_list) const;
50 void cachePacketProtocols();
51 bool isSelectorCombo(DecodeAsItem* item) const;
52
53 static void decodeAddProtocol(const char *table_name, const char *proto_name, void *value, void *user_data);
54
55 capture_file *cap_file_;
56 QList<packet_proto_data_t> packet_proto_list_;
57};
58#endif // DECODE_AS_DELEGATE_H
cfile.h
DecodeAsDelegate
Definition decode_as_delegate.h:31
DecodeAsItem
Definition decode_as_model.h:27
decode_as_model.h
_capture_file
Definition cfile.h:67
_packet_proto_data_t
Definition decode_as_delegate.h:24