KPackage

packageloader.h
1 /*
2  SPDX-FileCopyrightText: 2010 Ryan Rix <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KPACKAGE_LOADER_H
8 #define KPACKAGE_LOADER_H
9 
10 #include <kpackage/package.h>
11 
12 #include <kpackage/package_export.h>
13 
14 namespace KPackage
15 {
16 
17 class PackageLoaderPrivate;
18 
31 class KPACKAGE_EXPORT PackageLoader
32 {
33 public:
44  Package loadPackage(const QString &packageFormat, const QString &packagePath = QString());
45 
55  QList<KPluginMetaData> listPackages(const QString &packageFormat, const QString &packageRoot = QString());
56 
69  QList<KPluginMetaData> findPackages(const QString &packageFormat, const QString &packageRoot = QString(), std::function<bool(const KPluginMetaData &)> filter = std::function<bool(const KPluginMetaData &)>());
70 
77  KPackage::PackageStructure *loadPackageStructure(const QString &packageFormat);
78 
86  void addKnownPackageStructure(const QString &packageFormat, KPackage::PackageStructure *structure);
87 
94  static void setPackageLoader(PackageLoader *loader);
95 
99  static PackageLoader *self();
100 
101 protected:
102 
115  virtual Package internalLoadPackage(const QString &packageFormat);
116 
117  PackageLoader();
118  virtual ~PackageLoader();
119 
120 private:
121  friend class Package;
122  PackageLoaderPrivate *const d;
123  Q_DISABLE_COPY(PackageLoader)
124 };
125 
126 }
127 
128 Q_DECLARE_METATYPE(KPackage::PackageLoader *)
129 
130 #endif
This is an abstract base class which defines an interface to which the package loading logic can comm...
Definition: packageloader.h:31
This class is used to define the filesystem structure of a package type.
object representing an installed package
Definition: package.h:67
Namespace for everything in kpackage.
Definition: package.cpp:34
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Oct 19 2020 22:57:32 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.