| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
voip_calls_info_model.h
Go to the documentation of this file.
1
9
10#ifndef VOIP_CALLS_INFO_MODEL_H
11#define VOIP_CALLS_INFO_MODEL_H
12
13#include <config.h>
14
15#include "ui/voip_calls.h"
16#include <ui/qt/utils/variant_pointer.h>
17
18#include <QAbstractTableModel>
19#include <QSortFilterProxyModel>
20
26 class VoipCallsInfoModel : public QAbstractTableModel
27{
28 Q_OBJECT
29
30 public:
35 VoipCallsInfoModel(QObject *parent = 0);
36
43 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
44
52 QVariant headerData(int section, Qt::Orientation orientation,
53 int role = Qt::DisplayRole) const override;
54
60 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
61
67 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
68
73 void setTimeOfDay(bool timeOfDay);
74
79 bool timeOfDay() const;
80
86 void updateCalls(GQueue *callsinfos);
87
91 void removeAllCalls();
92
98 static voip_calls_info_t *indexToCallInfo(const QModelIndex &index);
99
103 enum Column
104 {
105 StartTime,
106 StopTime,
107 InitialSpeaker,
108 From,
109 To,
110 Protocol,
111 Duration,
112 Packets,
113 State,
114 Comments,
115 ColumnCount
116 };
117
118 private:
119 QList<void *> callinfos_;
120 bool mTimeOfDay_;
121
128 QVariant timeData(nstime_t *abs_ts, nstime_t *rel_ts) const;
129};
130
131
136 class VoipCallsInfoSortedModel : public QSortFilterProxyModel
137{
138 public:
143 VoipCallsInfoSortedModel(QObject *parent = 0);
144
145 protected:
153 bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
154};
155
156#endif // VOIP_CALLS_INFO_MODEL_H
VoipCallsInfoModel::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns in the model.
Definition voip_calls_info_model.cpp:152
VoipCallsInfoModel::updateCalls
void updateCalls(GQueue *callsinfos)
Replaces the model's call list with the contents of callsinfos and notifies the view to refresh.
Definition voip_calls_info_model.cpp:190
VoipCallsInfoModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of call records currently held by the model.
Definition voip_calls_info_model.cpp:142
VoipCallsInfoModel::VoipCallsInfoModel
VoipCallsInfoModel(QObject *parent=0)
Constructs the model with an empty call list.
Definition voip_calls_info_model.cpp:18
VoipCallsInfoModel::indexToCallInfo
static voip_calls_info_t * indexToCallInfo(const QModelIndex &index)
Returns the voip_calls_info_t record associated with index.
Definition voip_calls_info_model.cpp:24
VoipCallsInfoModel::setTimeOfDay
void setTimeOfDay(bool timeOfDay)
Controls whether timestamps are shown as time-of-day or relative times.
Definition voip_calls_info_model.cpp:176
VoipCallsInfoModel::removeAllCalls
void removeAllCalls()
Removes all call records from the model and notifies the view.
Definition voip_calls_info_model.cpp:223
VoipCallsInfoModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Returns column header labels for the VoIP calls table.
Definition voip_calls_info_model.cpp:111
VoipCallsInfoModel::timeOfDay
bool timeOfDay() const
Returns whether timestamps are currently shown as time-of-day values.
Definition voip_calls_info_model.cpp:185
VoipCallsInfoModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Returns display or decoration data for the given cell.
Definition voip_calls_info_model.cpp:29
VoipCallsInfoModel::Column
Column
Column indices for the VoIP calls table.
Definition voip_calls_info_model.h:104
VoipCallsInfoModel::To
@ To
Definition voip_calls_info_model.h:109
VoipCallsInfoModel::ColumnCount
@ ColumnCount
Definition voip_calls_info_model.h:115
VoipCallsInfoModel::Comments
@ Comments
Definition voip_calls_info_model.h:114
VoipCallsInfoModel::StopTime
@ StopTime
Definition voip_calls_info_model.h:106
VoipCallsInfoModel::Duration
@ Duration
Definition voip_calls_info_model.h:111
VoipCallsInfoModel::From
@ From
Definition voip_calls_info_model.h:108
VoipCallsInfoModel::StartTime
@ StartTime
Definition voip_calls_info_model.h:105
VoipCallsInfoModel::InitialSpeaker
@ InitialSpeaker
Definition voip_calls_info_model.h:107
VoipCallsInfoModel::Packets
@ Packets
Definition voip_calls_info_model.h:112
VoipCallsInfoModel::Protocol
@ Protocol
Definition voip_calls_info_model.h:110
VoipCallsInfoModel::State
@ State
Definition voip_calls_info_model.h:113
VoipCallsInfoSortedModel::lessThan
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override
Compares two rows for sorting, using type-appropriate comparisons for numeric, duration,...
Definition voip_calls_info_model.cpp:236
VoipCallsInfoSortedModel::VoipCallsInfoSortedModel
VoipCallsInfoSortedModel(QObject *parent=0)
Constructs the sort proxy model.
Definition voip_calls_info_model.cpp:231
nstime_t
Definition nstime.h:26
variant_pointer.h
voip_calls.h
voip_calls_info_t
struct _voip_calls_info voip_calls_info_t
Unified record describing a single detected VoIP call across all supported protocols.