1 | /** |
2 | * This file is part of the KDE project |
3 | * Copyright (C) 2013 Valentin Rusu <kde@rusu.info> |
4 | * |
5 | * This library is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU Library General Public |
7 | * License version 2 as published by the Free Software Foundation. |
8 | * |
9 | * This library is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Library General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU Library General Public License |
15 | * along with this library; see the file COPYING.LIB. If not, write to |
16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 | * Boston, MA 02110-1301, USA. |
18 | */ |
19 | #ifndef KNEWWALLETDIALOG_H |
20 | #define KNEWWALLETDIALOG_H |
21 | |
22 | #include <QWizard> |
23 | |
24 | #include "ui_knewwalletdialogintro.h" |
25 | #include "ui_knewwalletdialoggpg.h" |
26 | #include <boost/shared_ptr.hpp> |
27 | |
28 | namespace GpgME { |
29 | class Key; |
30 | } |
31 | |
32 | namespace KWallet { |
33 | |
34 | class KNewWalletDialogIntro; |
35 | class KNewWalletDialogGpg; |
36 | |
37 | class KNewWalletDialog : public QWizard { |
38 | Q_OBJECT |
39 | public: |
40 | KNewWalletDialog(const QString &appName, const QString &walletName, QWidget* parent = 0); |
41 | |
42 | bool isBlowfish() const; |
43 | int gpgId() const { return _gpgId; } |
44 | GpgME::Key gpgKey() const; |
45 | private: |
46 | KNewWalletDialogIntro *_intro; |
47 | int _introId; |
48 | KNewWalletDialogGpg *_gpg; |
49 | int _gpgId; |
50 | }; |
51 | |
52 | class KNewWalletDialogIntro : public QWizardPage { |
53 | Q_OBJECT |
54 | public: |
55 | KNewWalletDialogIntro(const QString &appName, const QString &walletName, QWidget* parent = 0); |
56 | bool isBlowfish() const; |
57 | virtual int nextId() const; |
58 | protected Q_SLOTS: |
59 | void onBlowfishToggled(bool); |
60 | private: |
61 | Ui_KNewWalletDialogIntro _ui; |
62 | }; |
63 | |
64 | class KNewWalletDialogGpg : public QWizardPage { |
65 | Q_OBJECT |
66 | public: |
67 | KNewWalletDialogGpg(const QString &appName, const QString &walletName, QWidget* parent = 0); |
68 | virtual void initializePage(); |
69 | virtual bool isComplete() const; |
70 | virtual bool validateCurrentPage(); |
71 | protected Q_SLOTS: |
72 | void onItemSelectionChanged(); |
73 | private: |
74 | bool _alreadyInitialized; |
75 | Ui_KNewWalletDialogGpg _ui; |
76 | bool _complete; |
77 | }; |
78 | |
79 | } // namespace |
80 | |
81 | #endif // KNEWWALLETDIALOG_H |
82 | |