aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/qqmlsysteminformation_p.h
blob: e01a5c42c689a1f9fc24aa6067c455b07a0c15c2 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef QQMLSYSTEMINFORMATION_P_H
#define QQMLSYSTEMINFORMATION_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include <QtCore/qobject.h>
#include <QtQmlCore/private/qqmlcoreglobal_p.h>
#include <QtQml/qqmlregistration.h>

QT_BEGIN_NAMESPACE
class Q_QMLCORE_EXPORT QQmlSystemInformation : public QObject
{
    Q_OBJECT
    QML_SINGLETON
    QML_NAMED_ELEMENT(SystemInformation)
    QML_ADDED_IN_VERSION(6, 4)

    Q_PROPERTY(int wordSize READ wordSize CONSTANT FINAL)
    Q_PROPERTY(QQmlSystemInformation::Endian byteOrder READ byteOrder CONSTANT FINAL)
    Q_PROPERTY(QString buildCpuArchitecture READ buildCpuArchitecture CONSTANT FINAL)
    Q_PROPERTY(QString currentCpuArchitecture READ currentCpuArchitecture CONSTANT FINAL)
    Q_PROPERTY(QString buildAbi READ buildAbi CONSTANT FINAL)
    Q_PROPERTY(QString kernelType READ kernelType CONSTANT FINAL)
    Q_PROPERTY(QString kernelVersion READ kernelVersion CONSTANT FINAL)
    Q_PROPERTY(QString productType READ productType CONSTANT FINAL)
    Q_PROPERTY(QString productVersion READ productVersion CONSTANT FINAL)
    Q_PROPERTY(QString prettyProductName READ prettyProductName CONSTANT FINAL)
    Q_PROPERTY(QString machineHostName READ machineHostName CONSTANT FINAL)
    Q_PROPERTY(QByteArray machineUniqueId READ machineUniqueId CONSTANT FINAL)
    Q_PROPERTY(QByteArray bootUniqueId READ bootUniqueId CONSTANT FINAL)

public:
    enum class Endian { Big, Little };
    Q_ENUM(Endian)

    explicit QQmlSystemInformation(QObject *parent = nullptr);

    int wordSize() const;
    Endian byteOrder() const;
    QString buildCpuArchitecture() const;
    QString currentCpuArchitecture() const;
    QString buildAbi() const;
    QString kernelType() const;
    QString kernelVersion() const;
    QString productType() const;
    QString productVersion() const;
    QString prettyProductName() const;
    QString machineHostName() const;
    QByteArray machineUniqueId() const;
    QByteArray bootUniqueId() const;
};
QT_END_NAMESPACE

#endif // QQMLSYSTEMINFORMATION_P_H