1 #ifndef SUPERSTAKERITEMWIDGET_H
2 #define SUPERSTAKERITEMWIDGET_H
3 
4 #include <QWidget>
5 
6 class PlatformStyle;
7 class WalletModel;
8 class ClientModel;
9 
10 namespace Ui {
11 class SuperStakerItemWidget;
12 }
13 
14 class SuperStakerItemWidgetPriv;
15 
16 class SuperStakerItemWidget : public QWidget
17 {
18     Q_OBJECT
19 
20 public:
21     enum ItemType
22     {
23         Record = 0,
24         New = 1
25     };
26 
27     enum Buttons{
28         Add = 0,
29         Remove = 1,
30         Config = 2,
31         Delegations = 3,
32         Split = 4,
33         Restore = 5
34     };
35 
36     explicit SuperStakerItemWidget(const PlatformStyle *platformStyle, QWidget *parent = 0, ItemType type = Record);
37     ~SuperStakerItemWidget();
38 
39     void setData(const QString& fee, const QString& staker, const QString& address, const bool& staking_on, const int64_t& balance, const int64_t& stake, const int64_t& weight, const int64_t& delegationsWeight);
40 
41     void setPosition(int position);
42 
43     int position() const;
44 
45     void setModel(WalletModel *_model);
46 
47     void setClientModel(ClientModel *clientModel);
48 
49 Q_SIGNALS:
50     void clicked(int position, int button);
51 
52 private Q_SLOTS:
53     void updateDisplayUnit();
54 
55     void on_buttonAdd_clicked();
56 
57     void on_buttonRemove_clicked();
58 
59     void on_buttonConfig_clicked();
60 
61     void on_buttonDelegations_clicked();
62 
63     void on_buttonSplit_clicked();
64 
65     void on_buttonRestore_clicked();
66 
67 private:
68     void updateLogo();
69     void updateBalance();
70     void updateLabelStaker();
71 
72 private:
73     Ui::SuperStakerItemWidget *ui;
74     const PlatformStyle *m_platfromStyle;
75     ItemType m_type;
76     int m_position;
77     QString m_filename;
78     WalletModel* m_model;
79     ClientModel* m_clientModel;
80     SuperStakerItemWidgetPriv* d;
81 };
82 
83 #endif // SUPERSTAKERITEMWIDGET_H
84