]>
vaikene.ee Git - evaf/blob - src/apps/PswGen/Generator/module.h
2 * @file PswGen/Generator/module.h
3 * @brief Implementation of the iGenerator interface
6 * Copyright (c) 2011 Enar Vaikene
8 * This file is part of the eVaf C++ cross-platform application development framework.
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.
16 * Alternatively, this file may be used in accordance with the Commercial License
17 * Agreement provided with the Software.
20 #ifndef __PSWGEN_GENERATOR_MODULE_H
21 # define __PSWGEN_GENERATOR_MODULE_H
23 #include "igenerator.h"
25 #include <Plugins/iPlugin>
33 /// Module that generates strong passwords using cryptographic methods
36 /// Internal implementation of the Generator module
39 } // namespace eVaf::PswGen::Generator::Internal
42 * Module implementing the iGenerator interface.
44 class Module
: public Plugins::iPlugin
47 Q_INTERFACES(eVaf::Plugins::iPlugin
)
55 virtual bool init(QString
const & args
);
59 virtual bool isReady() const { return true; }
64 /// iGenerator interface instance
65 Internal::GeneratorImpl
* mGenerator
;
73 * iGenerator interface implementation.
75 * Implements the iGenerator interface using MD5 cryptographic hashes.
78 class GeneratorImpl
: public QObject
, public iGenerator
81 Q_INTERFACES(eVaf::PswGen::iGenerator
)
87 virtual ~GeneratorImpl();
89 virtual QString
generatePassword(QString
const & name
, QString
const & masterPassword
, int length
, uint flags
= 0) const;
91 virtual int maxLength() const { return 24; }
95 } // namespace eVaf::PswGen::Generator::Internal
98 } // namespace eVaf::PswGen::Generator
99 } // namespace eVaf::PswGen