diff -r cfcbf08528c4 -r 2b40d63a9c3d qtecomplugins/xqplugins/inc/xqpluginloaderprivate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtecomplugins/xqplugins/inc/xqpluginloaderprivate.h Fri Apr 16 15:51:22 2010 +0300 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License as published by +* the Free Software Foundation, version 2.1 of the License. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public License +* along with this program. If not, +* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". +* +* Description: Private plugin loader implementation +* +*/ + +#ifndef QPLUGINLOADER2PRIVATE_H +#define QPLUGINLOADER2PRIVATE_H + +#include +#include +#include +#include +#include +#include + +//Incudes +#include +#include + +//Forward class declaration +class XQPluginInfo; + +//Class declaration +class XQPluginLoaderPrivate +{ +public: + int pHnd; + + QString fileName; + const int uid; + bool loadPlugin(); + bool unload(); + void release(); + + static XQPluginLoaderPrivate *findOrCreate(const QString &fileName, const QString &version = QString()); + static XQPluginLoaderPrivate *findOrCreate(int, const QString &version = QString()); + + QString errorString; + QLibrary::LoadHints loadHints; + + bool isPlugin(QSettings *settings = 0); + + QObject* instance(); + + /** + * Function retrive plugin description information from ECom framework + * @param infoArr - plugins description array + * ( definition from ECom framework ) + * @param interfaceName - reqursted plugin interface name + * @param impls - list of plugin descrpions. plugins implement requested + * interface + */ + static void listImplementationsL( + RImplInfoPtrArray& infoArr, + const QString &interfaceName, + QList &impls); + +private: + XQPluginLoaderPrivate( int uid, const QString &version= QString() ); + ~XQPluginLoaderPrivate(); + + void loadL(); + static void findOrCreateL( XQPluginLoaderPrivate*& pluginLoader, const QString &fileName, const QString &version ); + void setFileName(const QString& fileName); + QObject* pluginInstance; + + QAtomicInt loaderRefCount; + QAtomicInt loaderUnloadCount; + +}; + +#endif // QPLUGINLOADER2PRIVATE_H