KDELibs4Support

klibloader.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1999 Torben Weis <[email protected]>
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 KLIBLOADER_H
19 #define KLIBLOADER_H
20 
21 #include "kdelibs4support_export.h"
22 
23 #include "kglobal.h"
24 
25 #include <QObject>
26 #include <QStringList>
27 #include <QHash>
28 #include <QLibrary>
29 #include <QtPlugin>
30 
31 #include "kpluginfactory.h"
32 #include "kpluginloader.h"
33 #include "klibrary.h"
34 
35 #ifndef KDELIBS4SUPPORT_NO_DEPRECATED
36 
37 class KDELIBS4SUPPORT_DEPRECATED_EXPORT K_EXPORT_COMPONENT_FACTORY_is_deprecated_use_KPluginFactory
38 {
39 };
40 
41 #define K_EXPORT_COMPONENT_FACTORY( libname, factory ) \
42  K_EXPORT_COMPONENT_FACTORY_is_deprecated_use_KPluginFactory dummy;
43 
53 class KDELIBS4SUPPORT_DEPRECATED_EXPORT KLibLoader : public QObject //krazy:exclude=dpointer (private class is kept as a global static)
54 {
55  friend class KLibLoaderPrivate;
56 
57  Q_OBJECT
58 public:
64  KPluginFactory *factory(const QString &libname, QLibrary::LoadHints loadHint = {});
65 
73  KLibrary *library(const QString &libname, QLibrary::LoadHints loadHint = {});
74 
84  QString lastErrorMessage() const;
85 
89  void unloadLibrary(const QString &libname);
90 
102  static KDELIBS4SUPPORT_DEPRECATED KLibLoader *self();
103 
109  static KDELIBS4SUPPORT_DEPRECATED QString findLibrary(const QString &libname, const KComponentData &cData = KGlobal::mainComponent());
110 
111 private:
112  ~KLibLoader();
113 
114  KLibLoader();
115 };
116 
117 #endif
118 #endif
KLibrary searches for libraries in the same way that KPluginLoader searches for plugins.
Definition: klibrary.h:37
typedef LoadHints
const KComponentData & mainComponent()
Returns the global component data.
Definition: kglobal.cpp:109
Per component data.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jul 3 2020 22:57:53 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.