summaryrefslogtreecommitdiff
path: root/src/manager-lib/amnamespace.h
blob: e51a4c4c8535cddfc4fc4f10f7dd022b5c66f23c (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// 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 <QObject>
#include <QtAppManCommon/global.h>

QT_BEGIN_NAMESPACE_AM

// a namespace with Q_NAMESPACE would be better suited, but this leads to weird issues with the
// enums when used as Q_PROPERTY types and accessed from QML
class Am : public QObject
{
    Q_OBJECT
    Q_CLASSINFO("AM-QmlType", "QtApplicationManager.SystemUI/Am 2.0 UNCREATABLE")

public:
    // we cannot use QProcess enums directly, since some supported platforms might
    // not have QProcess available at all.
    // keep these enums in sync with those in containerinterface.h
    enum ExitStatus {
        NormalExit,
        CrashExit,
        ForcedExit
    };
    Q_ENUM(ExitStatus)

    enum RunState {
        NotRunning,
        StartingUp,
        Running,
        ShuttingDown,
    };
    Q_ENUM(RunState)

    enum ProcessError {
        FailedToStart, //### file not found, resource error
        Crashed,
        Timedout,
        ReadError,
        WriteError,
        UnknownError
    };
    Q_ENUM(ProcessError)
};

QT_END_NAMESPACE_AM