| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
decode_as_delegate.h
Go to the documentation of this file.
1
11
12#ifndef DECODE_AS_DELEGATE_H
13#define DECODE_AS_DELEGATE_H
14
15#include <config.h>
16
17#include <epan/cfile.h>
18
19#include <QStyledItemDelegate>
20#include <QSet>
21#include <QList>
22#include <ui/qt/models/decode_as_model.h>
23
27 typedef struct _packet_proto_data_t {
28 const char *proto_name;
29 const char *table_ui_name;
30 uint8_t curr_layer_num;
31} packet_proto_data_t;
32
33
37 class DecodeAsDelegate : public QStyledItemDelegate
38{
39 public:
46 DecodeAsDelegate(QObject *parent = 0, capture_file *cf = NULL);
47
60 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
61 const QModelIndex &index) const override;
62
72 void destroyEditor(QWidget *editor, const QModelIndex &index) const override;
73
83 void setEditorData(QWidget *editor, const QModelIndex &index) const override;
84
95 void setModelData(QWidget *editor, QAbstractItemModel *model,
96 const QModelIndex &index) const override;
97
98#if 0
99 void updateEditorGeometry(QWidget *editor,
100 const QStyleOptionViewItem &option, const QModelIndex &index) const;
101#endif
102
103 private:
110 DecodeAsItem *indexToField(const QModelIndex &index) const;
111
119 void collectDAProtocols(QSet<QString> &all_protocols,
120 QList<QString> &current_list) const;
121
125 void cachePacketProtocols();
126
133 bool isSelectorCombo(DecodeAsItem *item) const;
134
135
145 static void decodeAddProtocol(const char *table_name, const char *proto_name,
146 void *value, void *user_data);
147
148 capture_file *cap_file_;
149 QList<packet_proto_data_t> packet_proto_list_;
150};
151#endif // DECODE_AS_DELEGATE_H
cfile.h
capture_file
struct _capture_file capture_file
Represents a capture file and its associated metadata.
DecodeAsDelegate::createEditor
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Create an editor widget for the cell at index.
Definition decode_as_delegate.cpp:140
DecodeAsDelegate::setEditorData
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Populate the editor with the current model data.
Definition decode_as_delegate.cpp:317
DecodeAsDelegate::DecodeAsDelegate
DecodeAsDelegate(QObject *parent=0, capture_file *cf=NULL)
Construct a DecodeAsDelegate.
Definition decode_as_delegate.cpp:23
DecodeAsDelegate::setModelData
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Write the editor's current value back to the model.
Definition decode_as_delegate.cpp:347
DecodeAsDelegate::destroyEditor
void destroyEditor(QWidget *editor, const QModelIndex &index) const override
Destroy the editor widget created by createEditor().
Definition decode_as_delegate.cpp:306
DecodeAsItem
Represents a single "Decode As" mapping entry in the UI.
Definition decode_as_model.h:30
packet_proto_data_t
struct _packet_proto_data_t packet_proto_data_t
Per-layer protocol data collected from the currently selected packet.
decode_as_model.h
_packet_proto_data_t
Per-layer protocol data collected from the currently selected packet.
Definition decode_as_delegate.h:27
_packet_proto_data_t::curr_layer_num
uint8_t curr_layer_num
Definition decode_as_delegate.h:30
_packet_proto_data_t::proto_name
const char * proto_name
Definition decode_as_delegate.h:28
_packet_proto_data_t::table_ui_name
const char * table_ui_name
Definition decode_as_delegate.h:29