Warning: That file was not part of the compilation database. It may have many parsing errors.
1 | /* This file is part of the KDE libraries |
---|---|
2 | Copyright (C) 2007 Bernhard Loos <nhuh.put@web.de.org> |
3 | |
4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public |
6 | License version 2 as published by the Free Software Foundation. |
7 | |
8 | This library is distributed in the hope that it will be useful, |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11 | Library General Public License for more details. |
12 | |
13 | You should have received a copy of the GNU Library General Public License |
14 | along with this library; see the file COPYING.LIB. If not, write to |
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
16 | Boston, MA 02110-1301, USA. |
17 | */ |
18 | #ifndef KLIBRARY_H |
19 | #define KLIBRARY_H |
20 | |
21 | #include <kdecore_export.h> |
22 | |
23 | #include <kglobal.h> |
24 | |
25 | #include <QtCore/QLibrary> |
26 | |
27 | class KLibraryPrivate; |
28 | |
29 | class KPluginFactory; |
30 | |
31 | /** |
32 | * \class KLibrary klibrary.h <KLibrary> |
33 | * |
34 | * Thin wrapper around QLibrary; you should rarely use this directly, see KPluginLoader for higher-level loading of plugins. |
35 | * KLibrary adds kde3-factory and kde4-factory support to QLibrary (for the deprecated KLibLoader) |
36 | * KLibrary also searches libs in the kde search paths. |
37 | */ |
38 | class KDECORE_EXPORT KLibrary : public QLibrary |
39 | { |
40 | Q_OBJECT |
41 | Q_PROPERTY(QString fileName READ fileName WRITE setFileName) |
42 | public: |
43 | typedef void (*void_function_ptr) (); |
44 | |
45 | explicit KLibrary(QObject *parent = 0); |
46 | explicit KLibrary(const QString &name, const KComponentData &cData = KGlobal::mainComponent(), QObject *parent = 0); |
47 | KLibrary(const QString &name, int verNum, const KComponentData &cData = KGlobal::mainComponent(), QObject *parent = 0); |
48 | |
49 | virtual ~KLibrary(); |
50 | |
51 | /** |
52 | * Returns the factory of the library. |
53 | * @param factoryname The postfix to the init_ symbol used to create the |
54 | * factory object. It corresponds to the first parameter to |
55 | * K_EXPORT_COMPONENT_FACTORY. |
56 | * @return The factory of the library if there is any, otherwise 0 |
57 | * @deprecated use KPluginLoader::factory |
58 | */ |
59 | KDE_DEPRECATED KPluginFactory* factory( const char* factoryname = 0 ); |
60 | |
61 | /** |
62 | * Looks up a symbol from the library. This is a very low level |
63 | * function that you usually don't want to use. |
64 | * @param name the name of the symbol to look up |
65 | * @return the address of the symbol, or 0 if it does not exist |
66 | */ |
67 | void *resolveSymbol(const char *name); |
68 | |
69 | /** |
70 | * Looks up a symbol from the library. This is a very low level |
71 | * function that you usually don't want to use. |
72 | * @param name the name of the symbol to look up |
73 | * @return the address of the symbol, or 0 if it does not exist |
74 | */ |
75 | void_function_ptr resolveFunction(const char *name); |
76 | |
77 | void setFileName(const QString &name, const KComponentData &data = KGlobal::mainComponent()); |
78 | |
79 | bool unload() { return false; } //this is only temporary. i will remove it as soon as I have removed all dangerous users of it |
80 | private: |
81 | KLibraryPrivate *d_ptr; |
82 | }; |
83 | |
84 | #endif |
85 |
Warning: That file was not part of the compilation database. It may have many parsing errors.