]> vaikene.ee Git - evaf/blob - src/apps/PswGen/GUI/gui.h
Warning fixes and copyright update.
[evaf] / src / apps / PswGen / GUI / gui.h
1 /**
2 * @file PswGen/GUI/gui.h
3 * @brief GUI for the PswGen application
4 * @author Enar Vaikene
5 *
6 * Copyright (c) 2011-2019 Enar Vaikene
7 *
8 * This file is part of the eVaf C++ cross-platform application development framework.
9 *
10 * This file can be used under the terms of the GNU General Public License
11 * version 3.0 as published by the Free Software Foundation and appearing in
12 * the file LICENSE included in the packaging of this file. Please review the
13 * the following information to ensure the GNU General Public License version
14 * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
15 *
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
18 */
19
20 #ifndef __PSWGEN_GUI_GUI_H
21 #define __PSWGEN_GUI_GUI_H
22
23 #include "version.h"
24
25 #include <Plugins/iPlugin>
26
27 #include <QObject>
28 #include <QString>
29
30 class QLineEdit;
31 class QSpinBox;
32 class QPushButton;
33 class QCheckBox;
34
35 namespace eVaf {
36 namespace PswGen {
37 struct iGenerator;
38 struct iStorage;
39 namespace GUI {
40
41 /**
42 * Graphical User Interface for the PswGen application.
43 *
44 * This module adds a GUI window to the pswGen application using the SdiWindow module.
45 */
46 class Module : public Plugins::iPlugin
47 {
48 Q_OBJECT
49 Q_INTERFACES(eVaf::Plugins::iPlugin)
50 Q_PLUGIN_METADATA(IID VER_MODULE_NAME_STR)
51
52 public:
53
54 Module();
55
56 virtual ~Module();
57
58 virtual bool init(const QString & args);
59
60 virtual void done();
61
62 virtual bool isReady() const { return mReady; }
63
64
65 private slots:
66
67 /// Master password or name changed
68 void textChanged(QString const &);
69
70 /// 'Generate' button clicked
71 void generateClicked();
72
73 /// 'Copy' button clicked
74 void copyClicked();
75
76
77 private: // Members
78
79 static int const DefaultPasswordLength;
80
81 /// Flag indicating that the module is ready
82 bool mReady;
83
84 /// The iGenerator interface
85 eVaf::PswGen::iGenerator * mGenerator;
86
87 /// The iStorage interface (can be null)
88 eVaf::PswGen::iStorage * mStorage;
89
90 /// Widgets on the screen
91 QLineEdit * wMasterPassword;
92 QLineEdit * wName;
93 QLineEdit * wSuffix;
94 QSpinBox * wLength;
95 QCheckBox * wAlNum;
96 QLineEdit * wPassword;
97 QPushButton * wGenerate;
98 QPushButton * wCopy;
99
100 };
101
102 } // namespace eVaf::PswGen::GUI
103 } // namespace eVaf::PswGen
104 } // namespace eVaf
105
106 #endif // gui.h