1 /* voip_calls_info_model.h
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
16 #include "ui/voip_calls.h"
17 #include <ui/qt/utils/variant_pointer.h>
19 #include <QAbstractTableModel>
20 #include <QSortFilterProxyModel>
22 class VoipCallsInfoModel : public QAbstractTableModel
27 VoipCallsInfoModel(QObject *parent = 0);
28 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
29 QVariant headerData(int section, Qt::Orientation orientation,
30 int role = Qt::DisplayRole) const;
31 int rowCount(const QModelIndex &parent = QModelIndex()) const;
32 int columnCount(const QModelIndex &parent = QModelIndex()) const;
33 void setTimeOfDay(bool timeOfDay);
34 void updateCalls(GQueue *callsinfos);
36 static voip_calls_info_t *indexToCallInfo(const QModelIndex &index);
50 ColumnCount /* not an actual column, but used to find max. cols. */
54 QList<void *> callinfos_;
57 QVariant timeData(nstime_t *abs_ts, nstime_t *rel_ts) const;
60 class VoipCallsInfoSortedModel : public QSortFilterProxyModel
65 VoipCallsInfoSortedModel(QObject *parent = 0);
68 bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const;
71 #endif // VOIP_CALLS_INFO_MODEL_H
79 * indent-tabs-mode: nil
82 * ex: set shiftwidth=4 tabstop=8 expandtab:
83 * :indentSize=4:tabSize=8:noTabs=true: