summaryrefslogtreecommitdiffstats
path: root/src/manager-lib/deinstallationtask.h
blob: 63e6613b79dea99d7ff8031eaf3e4496c56c6a26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (C) 2021 The Qt Company Ltd.
// Copyright (C) 2019 Luxoft Sweden AB
// Copyright (C) 2018 Pelagicore AG
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#pragma once

#include <QtAppManManager/asynchronoustask.h>

QT_BEGIN_NAMESPACE_AM

class Package;
class InstallationLocation;

class DeinstallationTask : public AsynchronousTask
{
    Q_OBJECT

public:
    DeinstallationTask(const QString &packageId, const QString &installationPath, const QString &documentPath,
                       bool forceDeinstallation, bool keepDocuments, QObject *parent = nullptr);

    bool cancel() override;

protected:
    void execute() override;

private:
    QString m_installationPath;
    QString m_documentPath;
    bool m_keepDocuments;
    bool m_canBeCanceled = true;
    bool m_canceled = false;
};

QT_END_NAMESPACE_AM