Fabcoin Core  0.16.2
P2P Digital Currency
bantablemodel.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2017 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef FABCOIN_QT_BANTABLEMODEL_H
6 #define FABCOIN_QT_BANTABLEMODEL_H
7 
8 #include <net.h>
9 
10 #include <QAbstractTableModel>
11 #include <QStringList>
12 
13 class ClientModel;
14 class BanTablePriv;
15 
16 struct CCombinedBan {
19 };
20 
22 {
23 public:
24  BannedNodeLessThan(int nColumn, Qt::SortOrder fOrder) :
25  column(nColumn), order(fOrder) {}
26  bool operator()(const CCombinedBan& left, const CCombinedBan& right) const;
27 
28 private:
29  int column;
30  Qt::SortOrder order;
31 };
32 
37 class BanTableModel : public QAbstractTableModel
38 {
39  Q_OBJECT
40 
41 public:
42  explicit BanTableModel(ClientModel *parent = 0);
43  ~BanTableModel();
44  void startAutoRefresh();
45  void stopAutoRefresh();
46 
47  enum ColumnIndex {
48  Address = 0,
49  Bantime = 1
50  };
51 
54  int rowCount(const QModelIndex &parent) const;
55  int columnCount(const QModelIndex &parent) const;
56  QVariant data(const QModelIndex &index, int role) const;
57  QVariant headerData(int section, Qt::Orientation orientation, int role) const;
58  QModelIndex index(int row, int column, const QModelIndex &parent) const;
59  Qt::ItemFlags flags(const QModelIndex &index) const;
60  void sort(int column, Qt::SortOrder order);
61  bool shouldShow();
64 public Q_SLOTS:
65  void refresh();
66 
67 private:
69  QStringList columns;
70  std::unique_ptr<BanTablePriv> priv;
71 };
72 
73 #endif // FABCOIN_QT_BANTABLEMODEL_H
h160 Address
An Ethereum address: 20 bytes.
Definition: Common.h:62
CSubNet subnet
Definition: bantablemodel.h:17
ClientModel * clientModel
Definition: bantablemodel.h:68
QStringList columns
Definition: bantablemodel.h:69
std::unique_ptr< BanTablePriv > priv
Definition: bantablemodel.h:70
Model for Fabcoin network client.
Definition: clientmodel.h:38
BannedNodeLessThan(int nColumn, Qt::SortOrder fOrder)
Definition: bantablemodel.h:24
Qt model providing information about connected peers, similar to the "getpeerinfo" RPC call...
Definition: bantablemodel.h:37
CBanEntry banEntry
Definition: bantablemodel.h:18
Definition: addrdb.h:26
uint8_t const * data
Definition: sha3.h:19
Qt::SortOrder order
Definition: bantablemodel.h:30