X-Git-Url: https://vaikene.ee/gitweb/pswgen11.html?a=blobdiff_plain;ds=sidebyside;f=src%2Fapps%2FPswGen%2FGenerator%2Figenerator.h;h=3d1db68b0228640e33993707831a737f4dd21e8e;hb=5dbab6f7a87661995e93ed6b632ae711434f20c0;hp=d5122f21b9068b39465ab52343140fe8244f9f10;hpb=473db85d79d6d89b7b8fe617346efa3e94c66cd9;p=evaf
diff --git a/src/apps/PswGen/Generator/igenerator.h b/src/apps/PswGen/Generator/igenerator.h
index d5122f2..3d1db68 100644
--- a/src/apps/PswGen/Generator/igenerator.h
+++ b/src/apps/PswGen/Generator/igenerator.h
@@ -20,9 +20,8 @@
#ifndef __PSWGEN_GENERATOR_IGENERATOR_H
# define __PSWGEN_GENERATOR_IGENERATOR_H
-#include "lib.h"
-
#include
+#include
namespace eVaf {
namespace PswGen {
@@ -32,17 +31,8 @@ namespace PswGen {
*
* This interface is used to generate strong passwords.
*/
-class PSWGEN_GENERATOR_EXPORT iGenerator : public QObject
+struct iGenerator
{
- Q_OBJECT
-
-public:
-
- /// Interface constructor
- iGenerator() {}
-
- /// Empty virtual destructor
- virtual ~iGenerator() {}
/**
* Flags for the password generator.
@@ -51,18 +41,11 @@ public:
ALPHANUMERIC = 0x01 ///< Generated password contains only alphanumeric characters
};
- /**
- * Default length of the generated password
- */
- enum {
- DEFAULT_LENGTH = 16
- };
-
/**
* Generates a strong password
* @param name Name of the password
* @param masterPassword Master password
- * @param length Length of the password
+ * @param length Length of the password (if zero, then uses the max length)
* @param flags Flags for the generator
* @return Generated password
*
@@ -75,7 +58,7 @@ public:
*
* Optional flags can be used to fine-tune the generator.
*/
- virtual QString generatePassword(char const * const name, char const * const masterPassword, int length = DEFAULT_LENGTH, uint flags = 0) = 0;
+ virtual QString generatePassword(QString const & name, QString const & masterPassword, int length, uint flags = 0) const = 0;
/**
* Returns the maximum length of generated passwords
@@ -91,4 +74,6 @@ public:
} // namespace eVaf::PswGen
} // namespace eVaf
+Q_DECLARE_INTERFACE(eVaf::PswGen::iGenerator, "eVaf.PswGen.iGenerator/1.0")
+
#endif // igenerator.h