Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
related_packet_delegate.h
1 /* related_packet_delegate.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef RELATED_PACKET_DELEGATE_H
11 #define RELATED_PACKET_DELEGATE_H
12 
13 #include <config.h>
14 
15 #include "epan/conversation.h"
16 
17 #include <QHash>
18 #include <QStyledItemDelegate>
19 
20 class QPainter;
21 struct conversation;
22 
23 class RelatedPacketDelegate : public QStyledItemDelegate
24 {
25  Q_OBJECT
26 public:
27  RelatedPacketDelegate(QWidget *parent = 0);
28  void clear();
29  void setCurrentFrame(guint32 current_frame) { current_frame_ = current_frame; }
30  void setConversation(struct conversation *conv);
31 
32 public slots:
33  void addRelatedFrame(int frame_num, ft_framenum_type_t framenum_type = FT_FRAMENUM_NONE);
34 
35 protected:
36  void paint(QPainter *painter, const QStyleOptionViewItem &option,
37  const QModelIndex &index) const;
38  QSize sizeHint(const QStyleOptionViewItem &option,
39  const QModelIndex &index) const;
40 
41 private:
42  QHash<int, ft_framenum_type_t> related_frames_;
43  struct conversation *conv_;
44  guint32 current_frame_;
45 
46  void drawArrow(QPainter *painter, const QPoint tail, const QPoint head, int head_size) const;
47  void drawChevrons(QPainter *painter, const QPoint tail, const QPoint head, int head_size) const;
48  void drawCheckMark(QPainter *painter, const QRect bbox) const;
49 signals:
50 
51 
52 };
53 
54 #endif // RELATED_PACKET_DELEGATE_H
55 
56 /*
57  * Editor modelines
58  *
59  * Local Variables:
60  * c-basic-offset: 4
61  * tab-width: 8
62  * indent-tabs-mode: nil
63  * End:
64  *
65  * ex: set shiftwidth=4 tabstop=8 expandtab:
66  * :indentSize=4:tabSize=8:noTabs=true:
67  */
Definition: pcapng.c:148
Definition: conversation.h:89