/**
- * @file PswGen/Generator/generator.h
+ * @file PswGen/Generator/module.h
* @brief Implementation of the iGenerator interface
* @author Enar Vaikene
*
* Agreement provided with the Software.
*/
-#ifndef __PSWGEN_GENERATOR_GENERATOR_H
-# define __PSWGEN_GENERATOR_GENERATOR_H
+#ifndef __PSWGEN_GENERATOR_MODULE_H
+# define __PSWGEN_GENERATOR_MODULE_H
#include "igenerator.h"
#include <Plugins/iPlugin>
#include <QObject>
+#include <QString>
namespace eVaf {
namespace PswGen {
/// Internal implementation of the Generator module
namespace Internal {
+ class GeneratorImpl;
+} // namespace eVaf::PswGen::Generator::Internal
/**
- * iGenerator interface implementation.
- *
- * Implements the iGenerator interface using MD5 cryptographic hashes.
+ * Module implementing the iGenerator interface.
*/
-
-class GeneratorImpl : public iGenerator
+class Module : public Plugins::iPlugin
{
Q_OBJECT
public:
- GeneratorImpl();
+ Module();
- virtual ~GeneratorImpl();
+ virtual ~Module();
- bool init();
+ virtual bool init(QString const & args);
- void done();
+ virtual void done();
- virtual QString generatePassword(char const * const name, char const * const masterPassword, int length = iGenerator::DEFAULT_LENGTH, uint flags = 0);
+ virtual bool isReady() const { return true; }
- virtual int maxLength() const { return 24; }
+
+private: // Members
+
+ /// iGenerator interface instance
+ Internal::GeneratorImpl * mGenerator;
};
-} // namespace eVaf::PswGen::Generator::Internal
+
+namespace Internal {
/**
- * Module implementing the iGenerator interface.
+ * iGenerator interface implementation.
+ *
+ * Implements the iGenerator interface using MD5 cryptographic hashes.
*/
-class Module : public Plugins::iPlugin
+
+class GeneratorImpl : public iGenerator
{
Q_OBJECT
public:
- Module();
-
- virtual ~Module();
-
- virtual bool init(const QString & args);
-
- virtual void done();
-
- virtual bool isReady() const { return mReady; }
-
+ GeneratorImpl();
-private: // Members
+ virtual ~GeneratorImpl();
- /// Flag indicating that the module is ready
- bool mReady;
+ virtual QString generatePassword(QString const & name, QString const & masterPassword, int length, uint flags = 0) const;
- /// iGenerator interface instance
- Internal::GeneratorImpl * mGenerator;
+ virtual int maxLength() const { return 24; }
};
+} // namespace eVaf::PswGen::Generator::Internal
+
} // namespace eVaf::PswGen::Generator
} // namespace eVaf::PswGen
} // namespace eVaf
-#endif // generator.h
+#endif // module.h