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