Wireshark  4.3.0
The Wireshark network protocol analyzer
uat_model.h
Go to the documentation of this file.
1 
14 #ifndef UAT_MODEL_H
15 #define UAT_MODEL_H
16 
17 #include <config.h>
18 
19 #include <QAbstractItemModel>
20 #include <QList>
21 #include <QMap>
22 #include <epan/uat-int.h>
23 
24 class UatModel : public QAbstractTableModel
25 {
26 public:
27  UatModel(QObject *parent, uat_t *uat = 0);
28  UatModel(QObject *parent, QString tableName);
29 
30  Qt::ItemFlags flags(const QModelIndex &index) const;
31  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
32  QVariant headerData(int section, Qt::Orientation orientation,
33  int role = Qt::DisplayRole) const;
34  int rowCount(const QModelIndex &parent = QModelIndex()) const;
35  int columnCount(const QModelIndex &parent = QModelIndex()) const;
36 
37  bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
38 
39  bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
40  bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
41 
42  QModelIndex appendEntry(QVariantList row);
43 
44  QModelIndex copyRow(QModelIndex original);
45  bool moveRow(int src_row, int dst_row);
46 
47  bool moveRow(const QModelIndex &sourceParent, int sourceRow, const QModelIndex &destinationParent, int destinationChild);
48 
49  void reloadUat();
50  bool hasErrors() const;
51  void clearAll();
52 
60  bool applyChanges(QString &error);
61 
68  bool revertChanges(QString &error);
69 
70  QModelIndex findRowForColumnContent(QVariant columnContent, int columnToCheckAgainst, int role = Qt::DisplayRole);
71 
72 private:
73  bool checkField(int row, int col, char **error) const;
74  QList<int> checkRow(int row);
75  void loadUat(uat_t * uat = 0);
76 
77  epan_uat *uat_;
78  bool applying_;
79  QList<bool> dirty_records;
80  QList<QMap<int, QString> > record_errors;
81 };
82 #endif // UAT_MODEL_H
Definition: uat_model.h:25
bool revertChanges(QString &error)
Definition: uat_model.cpp:96
bool applyChanges(QString &error)
Definition: uat_model.cpp:71
Definition: uat-int.h:40