KDELibs4Support

klibrary.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2007 Bernhard Loos <[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 KLIBRARY_H
19 #define KLIBRARY_H
20 
21 #include <kdelibs4support_export.h>
22 
23 #include <QLibrary>
24 
25 class KLibraryPrivate;
26 
27 class KPluginFactory;
28 
37 class KDELIBS4SUPPORT_DEPRECATED_EXPORT KLibrary : public QLibrary
38 {
39  Q_OBJECT
40  Q_PROPERTY(QString fileName READ fileName WRITE setFileName)
41 public:
45  typedef void (*void_function_ptr)();
46 
47  KDELIBS4SUPPORT_DEPRECATED explicit KLibrary(QObject *parent = nullptr);
48  KDELIBS4SUPPORT_DEPRECATED explicit KLibrary(const QString &name, QObject *parent = nullptr);
49  KLibrary(const QString &name, int verNum, QObject *parent = nullptr);
50 
51  virtual ~KLibrary();
52 
56  KDELIBS4SUPPORT_DEPRECATED KPluginFactory *factory(const char *factoryname = nullptr)
57  {
58  // there is nothing sensible we can do: kdelibs 4 plugins depended on
59  // support from Qt that no longer exists
60  Q_UNUSED(factoryname) return nullptr;
61  }
62 
66  KDELIBS4SUPPORT_DEPRECATED void_function_ptr resolveFunction(const char *name)
67  {
68  return resolve(name);
69  }
70 
71  void setFileName(const QString &name);
72 
73  bool unload()
74  {
75  return false;
76  }
77 private:
78  KLibraryPrivate *d_ptr;
79 };
80 
81 #endif
bool unload()
void_function_ptr resolveFunction(const char *name)
Definition: klibrary.h:66
KLibrary searches for libraries in the same way that KPluginLoader searches for plugins.
Definition: klibrary.h:37
KPluginFactory * factory(const char *factoryname=nullptr)
Definition: klibrary.h:56
Q_PROPERTY(...)
void setFileName(const QString &fileName)
QFunctionPointer resolve(const char *symbol)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 2 2020 22:57:26 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.