/** * @file PswGen/CLI/cli.h * @brief Command line interface for the PswGen application * @author Enar Vaikene * * Copyright (c) 2011 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_CLI_CLI_H # define __PSWGEN_CLI_CLI_H #include "version.h" #include #include #include class QEvent; namespace eVaf { namespace PswGen { struct iGenerator; struct iStorage; /** * Command line interface for the PswGen application. * * This module adds command line interface to the PswGen application. */ namespace CLI { /** * Command line interface for the PswGen application. */ 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(QString const & args); virtual void done(); virtual bool isReady() const { return mReady; } virtual bool event(QEvent *); 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; /// Ready event uint mEvReady; private: // Methods QString readPassword(); void generatePassword(); }; } // namespace eVaf::PswGen::CLI } // namespace eVaf::PswGen } // namespace eVaf #endif // cli.h