Merge #11997: [tests] util_tests.cpp: actually check ignored args
[bitcoinplatinum.git] / src / qt / askpassphrasedialog.h
blob7ec8bf0a15846395b6f21cf7760b31748f9341c0
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.
5 #ifndef BITCOIN_QT_ASKPASSPHRASEDIALOG_H
6 #define BITCOIN_QT_ASKPASSPHRASEDIALOG_H
8 #include <QDialog>
10 class WalletModel;
12 namespace Ui {
13 class AskPassphraseDialog;
16 /** Multifunctional dialog to ask for passphrases. Used for encryption, unlocking, and changing the passphrase.
18 class AskPassphraseDialog : public QDialog
20 Q_OBJECT
22 public:
23 enum Mode {
24 Encrypt, /**< Ask passphrase twice and encrypt */
25 Unlock, /**< Ask passphrase and unlock */
26 ChangePass, /**< Ask old passphrase + new passphrase twice */
27 Decrypt /**< Ask passphrase and decrypt wallet */
30 explicit AskPassphraseDialog(Mode mode, QWidget *parent);
31 ~AskPassphraseDialog();
33 void accept();
35 void setModel(WalletModel *model);
37 private:
38 Ui::AskPassphraseDialog *ui;
39 Mode mode;
40 WalletModel *model;
41 bool fCapsLock;
43 private Q_SLOTS:
44 void textChanged();
45 void secureClearPassFields();
46 void toggleShowPassword(bool);
48 protected:
49 bool event(QEvent *event);
50 bool eventFilter(QObject *object, QEvent *event);
53 #endif // BITCOIN_QT_ASKPASSPHRASEDIALOG_H