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 VOIP_CALLS_INFO_MODEL_H
11 #define VOIP_CALLS_INFO_MODEL_H
15 #include "ui/voip_calls.h"
16 #include <ui/qt/utils/variant_pointer.h>
18 #include <QAbstractTableModel>
19 #include <QSortFilterProxyModel>
21 class VoipCallsInfoModel
: public QAbstractTableModel
26 VoipCallsInfoModel(QObject
*parent
= 0);
27 QVariant
data(const QModelIndex
&index
, int role
= Qt::DisplayRole
) const;
28 QVariant
headerData(int section
, Qt::Orientation orientation
,
29 int role
= Qt::DisplayRole
) const;
30 int rowCount(const QModelIndex
&parent
= QModelIndex()) const;
31 int columnCount(const QModelIndex
&parent
= QModelIndex()) const;
32 void setTimeOfDay(bool timeOfDay
);
33 bool timeOfDay() const;
34 void updateCalls(GQueue
*callsinfos
);
35 void removeAllCalls();
37 static voip_calls_info_t
*indexToCallInfo(const QModelIndex
&index
);
51 ColumnCount
/* not an actual column, but used to find max. cols. */
55 QList
<void *> callinfos_
;
58 QVariant
timeData(nstime_t
*abs_ts
, nstime_t
*rel_ts
) const;
61 class VoipCallsInfoSortedModel
: public QSortFilterProxyModel
64 VoipCallsInfoSortedModel(QObject
*parent
= 0);
67 bool lessThan(const QModelIndex
&source_left
, const QModelIndex
&source_right
) const;
70 #endif // VOIP_CALLS_INFO_MODEL_H