X-Git-Url: https://vaikene.ee/gitweb/gitweb.cgi?a=blobdiff_plain;f=src%2Flibs%2FPlugins%2Fipluginfactory.h;fp=src%2Flibs%2FPlugins%2Fipluginfactory.h;h=637aa6b9b5124ab571c78da45d317b5de9ef0764;hb=f26e65c1e66cf02eae9aa209acac743e3b04b4f4;hp=0000000000000000000000000000000000000000;hpb=814d12e0a340ae11fa4a22077b37316aa41716d7;p=evaf diff --git a/src/libs/Plugins/ipluginfactory.h b/src/libs/Plugins/ipluginfactory.h new file mode 100644 index 0000000..637aa6b --- /dev/null +++ b/src/libs/Plugins/ipluginfactory.h @@ -0,0 +1,73 @@ +/** + * @file Plugins/ipluginfactory.h + * @brief Common plugin factory interface for all the eVaf modules + * @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 __PLUGINS_IPLUGINFACTORY_H +#define __PLUGINS_IPLUGINFACTORY_H + +#include "libplugins.h" + +#include +#include + +namespace eVaf { +namespace Plugins { + +/** + * Common plugin factory interface for eVaf modules. + * @code#include + * + * The iPluginFactory interface is implemented by modules that export more than one + * iPlugin interface. + * + * Modules that implement only one iPlugin interface, use the iPlugin interface object + * directly. + */ +class PLUGINS_EXPORT iPluginFactory : public QObject +{ + Q_OBJECT + +public: + + /// Empty constructor + iPluginFactory() : QObject() {} + + /// Empty virtual destructor + virtual ~iPluginFactory() {} + + /** + * Creates the requested iPlugin interface object + * @param name Name of the interface + * @return The requested iPlugin interface object or 0 if failed + * + * This function creates the requested iPlugin interface object. Modules can implement more than + * one iPlugin interface objects and use names to identify them. + * + * If the requested interface object cannot be created, this function returns 0. + * + * The module implementing the iPluginFactory interface is responsible for destroying all the + * created iPlugin interface objects. + */ + virtual QObject * create(const QString & name) = 0; + +}; + +} // namespace eVaf::Plugins +} // namespace eVaf + +#endif // ipluginfactory.h