update epan/dissectors/pidl/drsuapi/drsuapi.idl from samba
[wireshark-sm.git] / ui / qt / models / related_packet_delegate.h
blob6825011910b92a82dde7eca153696f4d0734fe6c
1 /** @file
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
10 #ifndef RELATED_PACKET_DELEGATE_H
11 #define RELATED_PACKET_DELEGATE_H
13 #include <config.h>
15 #include "epan/conversation.h"
17 #include <QHash>
18 #include <QStyledItemDelegate>
20 class QPainter;
21 struct conversation;
23 class RelatedPacketDelegate : public QStyledItemDelegate
25 Q_OBJECT
26 public:
27 RelatedPacketDelegate(QWidget *parent = 0);
28 void clear();
29 void setCurrentFrame(uint32_t current_frame);
30 void setConversation(struct conversation *conv);
32 public slots:
33 void addRelatedFrame(int frame_num, ft_framenum_type_t framenum_type = FT_FRAMENUM_NONE);
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;
41 private:
42 QHash<int, ft_framenum_type_t> related_frames_;
43 struct conversation *conv_;
44 uint32_t current_frame_;
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;
51 #endif // RELATED_PACKET_DELEGATE_H