| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
packet_diagram.h
Go to the documentation of this file.
1
9
10#ifndef PACKET_DIAGRAM_H
11#define PACKET_DIAGRAM_H
12
13#include <config.h>
14
15#include <epan/proto.h>
16
17#include <epan/cfile.h>
18
19#include <ui/qt/utils/field_information.h>
20
21#include <QGraphicsView>
22
23 class DiagramLayout;
24
28 class PacketDiagram : public QGraphicsView
29{
30 Q_OBJECT
31 public:
36 PacketDiagram(QWidget *parent = nullptr);
37
41 ~PacketDiagram();
42
47 void setRootNode(proto_node *root_node);
48
52 void clear();
53
54signals:
59 void fieldSelected(FieldInformation *finfo);
60
61 public slots:
66 void setCaptureFile(capture_file *cf);
67
72 void setFont(const QFont &font);
73
78 void selectedFieldChanged(FieldInformation *finfo);
79
84 void selectedFrameChanged(QList<int> frames);
85
86 protected:
92 virtual bool event(QEvent *event) override;
93
98 virtual void contextMenuEvent(QContextMenuEvent *event) override;
99
100 private slots:
104 void connectToMainWindow();
105
109 void sceneSelectionChanged();
110
111 private:
116 void resetScene(bool reset_root = true);
117
122 void addDiagram(proto_node *tl_node);
123
128 void setSelectedField(field_info *fi);
129
134 QImage exportToImage();
135
136#if defined(QT_SVG_LIB) && 0
141 QByteArray exportToSvg();
142#endif
143
148 void showFieldsToggled(bool checked);
149
153 void saveAsTriggered();
154
158 void copyAsRasterTriggered();
159
160#if defined(QT_SVG_LIB) && !defined(Q_OS_MAC) && 0
164 void copyAsSvgTriggered();
165#endif
166
168 DiagramLayout *layout_;
169
171 capture_file *cap_file_;
172
174 proto_node *root_node_;
175
177 field_info *selected_field_;
178
180 int y_pos_;
181};
182
183#endif // PACKET_DIAGRAM_H
cfile.h
capture_file
struct _capture_file capture_file
Represents a capture file and its associated metadata.
DiagramLayout
Definition packet_diagram.cpp:49
FieldInformation
Represents information about a dissected packet field.
Definition field_information.h:26
PacketDiagram::PacketDiagram
PacketDiagram(QWidget *parent=nullptr)
Constructs a new PacketDiagram.
Definition packet_diagram.cpp:345
PacketDiagram::selectedFrameChanged
void selectedFrameChanged(QList< int > frames)
Slot triggered when the selected frame changes.
Definition packet_diagram.cpp:444
PacketDiagram::selectedFieldChanged
void selectedFieldChanged(FieldInformation *finfo)
Slot triggered when the selected field changes.
Definition packet_diagram.cpp:439
PacketDiagram::event
virtual bool event(QEvent *event) override
Core Qt event handler override.
Definition packet_diagram.cpp:454
PacketDiagram::contextMenuEvent
virtual void contextMenuEvent(QContextMenuEvent *event) override
Handles context menu events.
Definition packet_diagram.cpp:467
PacketDiagram::~PacketDiagram
~PacketDiagram()
Destroys the PacketDiagram.
Definition packet_diagram.cpp:370
PacketDiagram::setFont
void setFont(const QFont &font)
Sets the font used for rendering the diagram text.
Definition packet_diagram.cpp:433
PacketDiagram::setCaptureFile
void setCaptureFile(capture_file *cf)
Sets the active capture file.
Definition packet_diagram.cpp:421
PacketDiagram::setRootNode
void setRootNode(proto_node *root_node)
Sets the root protocol node to generate the diagram from.
Definition packet_diagram.cpp:375
PacketDiagram::fieldSelected
void fieldSelected(FieldInformation *finfo)
Signal emitted when a field is selected in the diagram.
PacketDiagram::clear
void clear()
Clears the diagram view.
Definition packet_diagram.cpp:416
field_information.h
proto_node
struct _proto_node proto_node
proto.h
field_info
Definition proto.h:822