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
10 #ifndef SEQUENCE_DIAGRAM_H
11 #define SEQUENCE_DIAGRAM_H
15 #include <epan/address.h>
19 #include <ui/qt/widgets/qcustomplot.h>
21 struct _seq_analysis_info
;
22 struct _seq_analysis_item
;
24 // Some of this is probably unnecessary
29 WSCPSeqData(double key
, _seq_analysis_item
*value
);
31 struct _seq_analysis_item
*value
;
34 typedef QMultiMap
<double, WSCPSeqData
> WSCPSeqDataMap
;
36 class SequenceDiagram
: public QCPAbstractPlottable
40 explicit SequenceDiagram(QCPAxis
*keyAxis
, QCPAxis
*valueAxis
, QCPAxis
*commentAxis
);
41 virtual ~SequenceDiagram();
44 // Next / previous packet.
45 int adjacentPacket(bool next
);
47 double selectedKey() { return selected_key_
; }
50 void setData(struct _seq_analysis_info
*sainfo
);
52 // non-property methods:
53 struct _seq_analysis_item
*itemForPosY(int ypos
);
54 bool inComment(QPoint pos
) const;
55 QString
elidedComment(const QString
&text
) const;
57 // reimplemented virtual methods:
58 virtual void clearData() { data_
->clear(); }
59 virtual double selectTest(const QPointF
&pos
, bool onlySelectable
, QVariant
*details
=0) const Q_DECL_OVERRIDE
;
62 void setSelectedPacket(int selected_packet
);
65 virtual void draw(QCPPainter
*painter
) Q_DECL_OVERRIDE
;
66 virtual void drawLegendIcon(QCPPainter
*painter
, const QRectF
&rect
) const Q_DECL_OVERRIDE
;
67 virtual QCPRange
getKeyRange(bool &validRange
, QCP::SignDomain inSignDomain
=QCP::sdBoth
) const Q_DECL_OVERRIDE
;
68 virtual QCPRange
getValueRange(bool &validRange
, QCP::SignDomain inSignDomain
=QCP::sdBoth
, const QCPRange
&inKeyRange
= QCPRange()) const Q_DECL_OVERRIDE
;
73 QCPAxis
*comment_axis_
;
74 WSCPSeqDataMap
*data_
;
75 struct _seq_analysis_info
*sainfo_
;
76 uint32_t selected_packet_
;
80 #endif // SEQUENCE_DIAGRAM_H