Wireshark  4.3.0
The Wireshark network protocol analyzer
interface_tree_cache_model.h
Go to the documentation of this file.
1 
12 #ifndef INTERFACE_TREE_CACHE_MODEL_H_
13 #define INTERFACE_TREE_CACHE_MODEL_H_
14 
16 
17 #include <QMap>
18 #include <QAbstractItemModel>
19 #include <QIdentityProxyModel>
20 
21 class InterfaceTreeCacheModel : public QIdentityProxyModel
22 {
23 public:
24  explicit InterfaceTreeCacheModel(QObject *parent);
26 
27  int rowCount(const QModelIndex &parent = QModelIndex()) const;
28  QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const;
29 
30  bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
31  Qt::ItemFlags flags(const QModelIndex &index) const;
32 
33  QVariant getColumnContent(int idx, int col, int role = Qt::DisplayRole);
34 
35 #ifdef HAVE_LIBPCAP
36  QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
37 
38  void reset(int row);
39  void save();
40 
41  void addDevice(const interface_t * newDevice);
42  void deleteDevice(const QModelIndex &index);
43 #endif
44 
45 private:
46  InterfaceTreeModel * sourceModel;
47 
48 #ifdef HAVE_LIBPCAP
49  QList<interface_t> newDevices;
50 
51  void saveNewDevices();
52 #endif
53  QMap<int, QMap<InterfaceTreeColumns, QVariant> *> * storage;
54  QList<InterfaceTreeColumns> editableColumns;
55  QList<InterfaceTreeColumns> checkableColumns;
56 
57 #ifdef HAVE_LIBPCAP
58  const interface_t * lookup(const QModelIndex &index) const;
59 #endif
60 
61  bool changeIsAllowed(InterfaceTreeColumns col) const;
62  bool isAvailableField(const QModelIndex &index) const;
63  bool isAllowedToBeEdited(const QModelIndex &index) const;
64 
65 };
66 #endif /* INTERFACE_TREE_CACHE_MODEL_H_ */
Definition: interface_tree_cache_model.h:22
Definition: interface_tree_model.h:57
Definition: androiddump.c:218