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 CAPTURE_INFO_DIALOG_H
11 #define CAPTURE_INFO_DIALOG_H
13 #include "geometry_state_dialog.h"
15 #include <QAbstractTableModel>
16 #include <QElapsedTimer>
19 struct _capture_session
;
22 class CaptureInfoDialog
;
25 class CaptureInfoModel
: public QAbstractTableModel
30 explicit CaptureInfoModel(struct _capture_info
*cap_info
, QObject
* parent
= Q_NULLPTR
);
31 virtual ~CaptureInfoModel() {}
34 virtual int rowCount(const QModelIndex
&parent
= QModelIndex()) const;
35 virtual int columnCount(const QModelIndex
&parent
= QModelIndex()) const;
36 virtual QVariant
data(const QModelIndex
&index
, int role
= Qt::DisplayRole
) const;
37 // virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
40 struct _capture_info
*cap_info_
;
42 // The SparkLineDelegate expects to plot ints. The delta between packet
43 // counts in two intervals should fit in an int, even if the totals don't.
44 QMap
<int, uint64_t> last_count_
;
45 QMap
<int, QList
<int> > points_
;
47 QList
<int> other_points_
;
50 class CaptureInfoDialog
: public GeometryStateDialog
55 explicit CaptureInfoDialog(struct _capture_info
*cap_info
, struct _capture_session
*cap_session
, QWidget
*parent
= 0);
57 void updateInfo(void);
67 Ui::CaptureInfoDialog
*ui
;
68 struct _capture_info
*cap_info_
;
69 struct _capture_session
*cap_session_
;
70 CaptureInfoModel
*ci_model_
;
71 QElapsedTimer duration_
;
74 #endif // CAPTURE_INFO_DIALOG_H