Wireshark  4.3.0
The Wireshark network protocol analyzer
voip_calls_info_model.h
Go to the documentation of this file.
1 
10 #ifndef VOIP_CALLS_INFO_MODEL_H
11 #define VOIP_CALLS_INFO_MODEL_H
12 
13 #include <config.h>
14 #include <glib.h>
15 
16 #include "ui/voip_calls.h"
18 
19 #include <QAbstractTableModel>
20 #include <QSortFilterProxyModel>
21 
22 class VoipCallsInfoModel : public QAbstractTableModel
23 {
24  Q_OBJECT
25 
26 public:
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  bool timeOfDay() const;
35  void updateCalls(GQueue *callsinfos);
36  void removeAllCalls();
37 
38  static voip_calls_info_t *indexToCallInfo(const QModelIndex &index);
39 
40  enum Column
41  {
42  StartTime,
43  StopTime,
44  InitialSpeaker,
45  From,
46  To,
47  Protocol,
48  Duration,
49  Packets,
50  State,
51  Comments,
52  ColumnCount /* not an actual column, but used to find max. cols. */
53  };
54 
55 private:
56  QList<void *> callinfos_;
57  bool mTimeOfDay_;
58 
59  QVariant timeData(nstime_t *abs_ts, nstime_t *rel_ts) const;
60 };
61 
62 class VoipCallsInfoSortedModel : public QSortFilterProxyModel
63 {
64 public:
65  VoipCallsInfoSortedModel(QObject *parent = 0);
66 
67 protected:
68  bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const;
69 };
70 
71 #endif // VOIP_CALLS_INFO_MODEL_H
Definition: voip_calls_info_model.h:23
Definition: voip_calls_info_model.h:63
Definition: voip_calls.h:144
Definition: nstime.h:26