signverifymessagedialog.h raw
1 // Copyright (c) 2011-2021 The Limenka 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 LIMENKA_QT_SIGNVERIFYMESSAGEDIALOG_H
6 #define LIMENKA_QT_SIGNVERIFYMESSAGEDIALOG_H
7
8 #include <QDialog>
9
10 class PlatformStyle;
11 class WalletModel;
12 class QColor;
13 class QEvent;
14 class QLabel;
15
16 namespace Ui {
17 class SignVerifyMessageDialog;
18 }
19
20 class SignVerifyMessageDialog : public QDialog
21 {
22 Q_OBJECT
23
24 public:
25 struct ThemeColors {
26 QColor warning;
27 QColor valid;
28 };
29 explicit SignVerifyMessageDialog(const PlatformStyle *platformStyle, QWidget *parent);
30 ~SignVerifyMessageDialog();
31
32 void setModel(WalletModel *model);
33 void setAddress_SM(const QString &address);
34 void setAddress_VM(const QString &address);
35
36 void showTab_SM(bool fShow);
37 void showTab_VM(bool fShow);
38
39 protected:
40 bool eventFilter(QObject *object, QEvent *event) override;
41 void changeEvent(QEvent* e) override;
42
43 private:
44 Ui::SignVerifyMessageDialog *ui;
45 WalletModel* model{nullptr};
46 const PlatformStyle *platformStyle;
47 void updateThemeColors();
48 void updateStatusLabelColor(QLabel* label);
49
50 // Theme Colors
51 const ThemeColors *m_theme_colors;
52
53 private Q_SLOTS:
54 /* sign message */
55 void on_addressBookButton_SM_clicked();
56 void on_pasteButton_SM_clicked();
57 void on_signMessageButton_SM_clicked();
58 void on_copySignatureButton_SM_clicked();
59 void on_clearButton_SM_clicked();
60 /* verify message */
61 void on_addressBookButton_VM_clicked();
62 void on_verifyMessageButton_VM_clicked();
63 void on_clearButton_VM_clicked();
64 };
65
66 #endif // LIMENKA_QT_SIGNVERIFYMESSAGEDIALOG_H
67