columnPoSReward
[novacoin.git] / src / qt / mintingtablemodel.h
1 #ifndef MINTINGTABLEMODEL_H
2 #define MINTINGTABLEMODEL_H
3
4
5 #include <QAbstractTableModel>
6 #include <QStringList>
7
8 class CWallet;
9 class MintingTablePriv;
10 class KernelRecord;
11 class WalletModel;
12
13 class MintingTableModel : public QAbstractTableModel
14 {
15     Q_OBJECT
16 public:
17     explicit MintingTableModel(CWallet * wallet, WalletModel *parent = 0);
18     ~MintingTableModel();
19
20     enum ColumnIndex {
21         TxHash = 0,
22         Address = 1,
23         Age = 2,
24         Balance = 3,
25         CoinDay = 4,
26         MintProbability = 5,
27         MintReward = 6
28     };
29
30
31     int rowCount(const QModelIndex &parent) const;
32     int columnCount(const QModelIndex &parent) const;
33     QVariant data(const QModelIndex &index, int role) const;
34     QVariant headerData(int section, Qt::Orientation orientation, int role) const;
35     QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const;
36
37     void setMintingInterval(int interval);
38
39 private:
40     CWallet* wallet;
41     WalletModel *walletModel;
42     QStringList columns;
43     int mintingInterval;
44     MintingTablePriv *priv;
45
46     QString lookupAddress(const std::string &address, bool tooltip) const;
47
48     double getDayToMint(KernelRecord *wtx) const;
49     QString formatDayToMint(KernelRecord *wtx) const;
50     QString formatTxAddress(const KernelRecord *wtx, bool tooltip) const;
51     QString formatTxHash(const KernelRecord *wtx) const;
52     QString formatTxAge(const KernelRecord *wtx) const;
53     QString formatTxBalance(const KernelRecord *wtx) const;
54     QString formatTxCoinDay(const KernelRecord *wtx) const;
55     QString formatTxPoSReward(KernelRecord *wtx) const;
56 private slots:
57     void update();
58
59     friend class MintingTablePriv;
60 };
61
62 #endif // MINTINGTABLEMODEL_H