eVaf
module.h
Go to the documentation of this file.
1 
20 #ifndef __PSWGEN_GENERATOR_MODULE_H
21 # define __PSWGEN_GENERATOR_MODULE_H
22 
23 #include "igenerator.h"
24 #include "version.h"
25 
26 #include <Plugins/iPlugin>
27 
28 #include <QObject>
29 #include <QString>
30 
31 namespace eVaf {
32 namespace PswGen {
33 
35 namespace Generator {
36 
38 namespace Internal {
39  class GeneratorImpl;
40 } // namespace eVaf::PswGen::Generator::Internal
41 
45 class Module : public Plugins::iPlugin
46 {
47  Q_OBJECT
48  Q_INTERFACES(eVaf::Plugins::iPlugin)
49  Q_PLUGIN_METADATA(IID VER_MODULE_NAME_STR)
50 
51 public:
52 
53  Module();
54 
55  virtual ~Module();
56 
57  virtual bool init(QString const & args);
58 
59  virtual void done();
60 
61  virtual bool isReady() const { return true; }
62 
63 
64 private: // Members
65 
67  Internal::GeneratorImpl * mGenerator;
68 
69 };
70 
71 
72 namespace Internal {
73 
80 class GeneratorImpl : public QObject, public iGenerator
81 {
82  Q_OBJECT
83  Q_INTERFACES(eVaf::PswGen::iGenerator)
84 
85 public:
86 
87  GeneratorImpl();
88 
89  virtual ~GeneratorImpl();
90 
91  virtual QString generatePassword(QString const & name, QString const & masterPassword, int length, uint flags = 0) const;
92 
93  virtual int maxLength() const { return 24; }
94 
95 };
96 
97 } // namespace eVaf::PswGen::Generator::Internal
98 
99 
100 } // namespace eVaf::PswGen::Generator
101 } // namespace eVaf::PswGen
102 } // namespace eVaf
103 
104 #endif // module.h
Interface for password generator modules.
bool COMMON_EXPORT init()
eVaf common library initialized
Module implementing the iGenerator interface.
Definition: module.h:45
#define VER_MODULE_NAME_STR
Module/library name (shall end with \0)
Definition: version.h:38
iGenerator interface implementation.
Definition: module.h:80
Global eVaf namespace.
Definition: engine.h:37
Password generator interface.
Definition: igenerator.h:34
Common interface for all the eVaf modules.
Definition: iplugin.h:38
Version information for eVaf modules.