]> vaikene.ee Git - evaf/blobdiff - src/apps/PswGen/Generator/module.h
Modified the PswGen application to follow the tutorial.
[evaf] / src / apps / PswGen / Generator / module.h
similarity index 77%
rename from src/apps/PswGen/Generator/generator.h
rename to src/apps/PswGen/Generator/module.h
index 3c3096fcd5a8f8d8ad438416df17bd7ac5789812..a1be474308b283ebf564d29acd66c0dc2692469f 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * @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 {
@@ -34,68 +35,66 @@ namespace Generator {
 
 /// 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