]> vaikene.ee Git - evaf/blob - src/apps/PswGen/GUI/gui.h
6f04019a849c0bc8e4c87946a120e21f91c6d5ee
[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 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 <Plugins/iPlugin>
24
25 #include <QObject>
26 #include <QString>
27
28 class QLineEdit;
29 class QSpinBox;
30 class QPushButton;
31
32 namespace eVaf {
33 namespace PswGen {
34 class iGenerator;
35 namespace GUI {
36
37 /**
38 * Graphical User Interface for the PswGen application.
39 *
40 * This module adds a GUI window to the pswGen application using the SdiWindow module.
41 */
42 class Module : public Plugins::iPlugin
43 {
44 Q_OBJECT
45
46 public:
47
48 Module();
49
50 virtual ~Module();
51
52 virtual bool init(const QString & args);
53
54 virtual void done();
55
56 virtual bool isReady() const { return mReady; }
57
58
59 private slots:
60
61 /// Master password or name changed
62 void textChanged(QString const &);
63
64 /// 'Generate' button clicked
65 void generateClicked();
66
67 /// 'Copy' button clicked
68 void copyClicked();
69
70
71 private: // Members
72
73 static int const DefaultPasswordLength;
74
75 /// Flag indicating that the module is ready
76 bool mReady;
77
78 /// The iGenerator interface
79 eVaf::PswGen::iGenerator * mGenerator;
80
81 /// Widgets on the screen
82 QLineEdit * wName;
83 QLineEdit * wMasterPassword;
84 QSpinBox * wLength;
85 QLineEdit * wPassword;
86 QPushButton * wGenerate;
87 QPushButton * wCopy;
88
89 };
90
91 } // namespace eVaf::PswGen::GUI
92 } // namespace eVaf::PswGen
93 } // namespace eVaf
94
95 #endif // gui.h