KPackage 5.109.0
packagestructure.h
1/*
2 SPDX-FileCopyrightText: 2011 Aaron Seigo <aseigo@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KPACKAGE_PACKAGESTRUCTURE_H
8#define KPACKAGE_PACKAGESTRUCTURE_H
9
10#include <QStringList>
11
12#include <KPluginFactory>
13
14#include <kpackage/package.h>
15#include <kpackage/package_export.h>
16
17namespace KPackage
18{
19class PackageStructurePrivate;
20
41class KPACKAGE_EXPORT PackageStructure : public QObject
42{
43 Q_OBJECT
44
45public:
46 explicit PackageStructure(QObject *parent = nullptr, const QVariantList &args = QVariantList());
47
48 ~PackageStructure() override;
49
61 virtual void initPackage(Package *package);
62
67 virtual void pathChanged(Package *package);
68
80 virtual KJob *install(Package *package, const QString &archivePath, const QString &packageRoot);
81
96 virtual KJob *update(Package *package, const QString &archivePath, const QString &packageRoot);
97
107 virtual KJob *uninstall(Package *package, const QString &packageRoot);
108
109private:
110 PackageStructurePrivate *d;
111};
112
113} // KPackage namespace
114
119#define K_EXPORT_KPACKAGE_PACKAGE_WITH_JSON(classname, jsonFile) K_PLUGIN_FACTORY_WITH_JSON(factory, jsonFile, registerPlugin<classname>();)
120
121#endif
This class is used to define the filesystem structure of a package type.
Definition packagestructure.h:42
virtual KJob * uninstall(Package *package, const QString &packageRoot)
Uninstalls a package matching this package structure.
virtual void initPackage(Package *package)
Called when a the PackageStructure should initialize a Package with the initial structure.
virtual KJob * install(Package *package, const QString &archivePath, const QString &packageRoot)
Installs a package matching this package structure.
virtual void pathChanged(Package *package)
Called whenever the path changes so that subclasses may take package specific actions.
virtual KJob * update(Package *package, const QString &archivePath, const QString &packageRoot)
Updates a package matching this package structure.
object representing an installed package
Definition package.h:67