1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * |
|
5 * This program is free software: you can redistribute it and/or modify |
|
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
|
8 * |
|
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU Lesser General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: Class implement extended wrapper for ECom framework |
|
19 * |
|
20 */ |
|
21 |
|
22 #ifndef XQPLUGINLOADER_H |
|
23 #define XQPLUGINLOADER_H |
|
24 |
|
25 #include <QtGlobal> |
|
26 #include <QObject> |
|
27 #include <QList> |
|
28 #include <QString> |
|
29 |
|
30 class XQPluginInfo; |
|
31 class XQPluginLoaderPrivate; |
|
32 |
|
33 #ifdef BUILD_XQPLUGINS_DLL |
|
34 #define DLL_EXPORT Q_DECL_EXPORT |
|
35 #else |
|
36 #define DLL_EXPORT Q_DECL_IMPORT |
|
37 #endif |
|
38 |
|
39 class DLL_EXPORT XQPluginLoader : public QObject |
|
40 { |
|
41 public: |
|
42 |
|
43 XQPluginLoader(QObject* parent = 0); |
|
44 |
|
45 XQPluginLoader(int uid, QObject* parent = 0); |
|
46 |
|
47 virtual ~XQPluginLoader(); |
|
48 |
|
49 static bool listImplementations(const QString &interfaceName, |
|
50 QList<XQPluginInfo > &impls); |
|
51 |
|
52 int uid()const; |
|
53 |
|
54 QObject* instance(); |
|
55 |
|
56 bool isLoaded() const; |
|
57 |
|
58 bool load(); |
|
59 |
|
60 bool unload(); |
|
61 |
|
62 void setUid ( int uid ); |
|
63 |
|
64 QString errorString () const; |
|
65 |
|
66 private: |
|
67 /** |
|
68 * Private extended plugin loader implementation. |
|
69 * Own |
|
70 */ |
|
71 XQPluginLoaderPrivate* d; |
|
72 |
|
73 /** |
|
74 * Flag that inform about loading state |
|
75 */ |
|
76 bool did_load; |
|
77 |
|
78 Q_DISABLE_COPY(XQPluginLoader) |
|
79 }; |
|
80 |
|
81 #endif |
|