]> vaikene.ee Git - evaf/blob - src/apps/PswGen/CLI/cli.h
Warning fixes and copyright update.
[evaf] / src / apps / PswGen / CLI / cli.h
1 /**
2 * @file PswGen/CLI/cli.h
3 * @brief Command line interface 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_CLI_CLI_H
21 # define __PSWGEN_CLI_CLI_H
22
23 #include "version.h"
24
25 #include <Plugins/iPlugin>
26
27 #include <QObject>
28 #include <QString>
29
30 class QEvent;
31
32 namespace eVaf {
33 namespace PswGen {
34 struct iGenerator;
35 struct iStorage;
36
37 /**
38 * Command line interface for the PswGen application.
39 *
40 * This module adds command line interface to the PswGen application.
41 */
42 namespace CLI {
43
44 /**
45 * Command line interface for the PswGen application.
46 */
47 class Module : public Plugins::iPlugin
48 {
49 Q_OBJECT
50 Q_INTERFACES(eVaf::Plugins::iPlugin)
51 Q_PLUGIN_METADATA(IID VER_MODULE_NAME_STR)
52
53 public:
54
55 Module();
56
57 virtual ~Module();
58
59 virtual bool init(QString const & args);
60
61 virtual void done();
62
63 virtual bool isReady() const { return mReady; }
64
65 virtual bool event(QEvent *);
66
67
68 private: // Members
69
70 static int const DefaultPasswordLength;
71
72 /// Flag indicating that the module is ready
73 bool mReady;
74
75 /// The iGenerator interface
76 eVaf::PswGen::iGenerator * mGenerator;
77
78 /// The iStorage interface (can be null)
79 eVaf::PswGen::iStorage * mStorage;
80
81 /// Ready event
82 uint mEvReady;
83
84
85 private: // Methods
86
87 QString readPassword();
88
89 void generatePassword();
90
91 };
92
93 } // namespace eVaf::PswGen::CLI
94 } // namespace eVaf::PswGen
95 } // namespace eVaf
96
97 #endif // cli.h