X-Git-Url: https://vaikene.ee/gitweb/pswgen11.html?a=blobdiff_plain;ds=sidebyside;f=src%2Fapps%2FPswGen%2FGenerator%2Figenerator.h;h=f33104913ac6cd7ba3c2e3f008bed3b2b4b289f6;hb=refs%2Fheads%2Fmaster;hp=d5122f21b9068b39465ab52343140fe8244f9f10;hpb=473db85d79d6d89b7b8fe617346efa3e94c66cd9;p=evaf
diff --git a/src/apps/PswGen/Generator/igenerator.h b/src/apps/PswGen/Generator/igenerator.h
index d5122f2..f331049 100644
--- a/src/apps/PswGen/Generator/igenerator.h
+++ b/src/apps/PswGen/Generator/igenerator.h
@@ -3,7 +3,7 @@
* @brief Interface for password generator modules
* @author Enar Vaikene
*
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2019 Enar Vaikene
*
* This file is part of the eVaf C++ cross-platform application development framework.
*
@@ -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.
@@ -52,17 +42,15 @@ public:
};
/**
- * Default length of the generated password
+ * Empty virtual destructor
*/
- enum {
- DEFAULT_LENGTH = 16
- };
+ virtual ~iGenerator() {}
/**
* 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 +63,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 +79,6 @@ public:
} // namespace eVaf::PswGen
} // namespace eVaf
+Q_DECLARE_INTERFACE(eVaf::PswGen::iGenerator, "eVaf.PswGen.iGenerator/1.0")
+
#endif // igenerator.h