/** * @file PswGen/GUI/gui.h * @brief GUI for the PswGen application * @author Enar Vaikene * * Copyright (c) 2011-2019 Enar Vaikene * * This file is part of the eVaf C++ cross-platform application development framework. * * This file can be used under the terms of the GNU General Public License * version 3.0 as published by the Free Software Foundation and appearing in * the file LICENSE included in the packaging of this file. Please review the * the following information to ensure the GNU General Public License version * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. * * Alternatively, this file may be used in accordance with the Commercial License * Agreement provided with the Software. */ #ifndef __PSWGEN_GUI_GUI_H #define __PSWGEN_GUI_GUI_H #include "version.h" #include #include #include class QLineEdit; class QSpinBox; class QPushButton; class QCheckBox; namespace eVaf { namespace PswGen { struct iGenerator; struct iStorage; namespace GUI { /** * Graphical User Interface for the PswGen application. * * This module adds a GUI window to the pswGen application using the SdiWindow module. */ class Module : public Plugins::iPlugin { Q_OBJECT Q_INTERFACES(eVaf::Plugins::iPlugin) Q_PLUGIN_METADATA(IID VER_MODULE_NAME_STR) public: Module(); virtual ~Module(); virtual bool init(const QString & args); virtual void done(); virtual bool isReady() const { return mReady; } private slots: /// Master password or name changed void textChanged(QString const &); /// 'Generate' button clicked void generateClicked(); /// 'Copy' button clicked void copyClicked(); private: // Members static int const DefaultPasswordLength; /// Flag indicating that the module is ready bool mReady; /// The iGenerator interface eVaf::PswGen::iGenerator * mGenerator; /// The iStorage interface (can be null) eVaf::PswGen::iStorage * mStorage; /// Widgets on the screen QLineEdit * wMasterPassword; QLineEdit * wName; QLineEdit * wSuffix; QSpinBox * wLength; QCheckBox * wAlNum; QLineEdit * wPassword; QPushButton * wGenerate; QPushButton * wCopy; }; } // namespace eVaf::PswGen::GUI } // namespace eVaf::PswGen } // namespace eVaf #endif // gui.h