1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKLABSPLATFORMSTANDARDPATHS_P_H
5#define QQUICKLABSPLATFORMSTANDARDPATHS_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qobject.h>
19#include <QtCore/qstandardpaths.h>
20#include <QtCore/qurl.h>
21#include <QtQml/qqml.h>
22#include <QtCore/private/qglobal_p.h>
23
24#if QT_DEPRECATED_SINCE(6, 4)
25
26QT_BEGIN_NAMESPACE
27
28class QQmlEngine;
29class QJSEngine;
30
31class QQuickLabsPlatformStandardPaths : public QObject
32{
33 Q_OBJECT
34 QML_SINGLETON
35 QML_NAMED_ELEMENT(StandardPaths)
36 QML_EXTENDED_NAMESPACE(QStandardPaths)
37
38public:
39 explicit QQuickLabsPlatformStandardPaths(QObject *parent = nullptr);
40
41 static QObject *create(QQmlEngine *engine, QJSEngine *scriptEngine);
42
43 Q_INVOKABLE static QString displayName(QStandardPaths::StandardLocation type);
44 Q_INVOKABLE static QUrl findExecutable(const QString &executableName, const QStringList &paths = QStringList());
45 Q_INVOKABLE static QUrl locate(QStandardPaths::StandardLocation type, const QString &fileName, QStandardPaths::LocateOptions options = QStandardPaths::LocateFile);
46 Q_INVOKABLE static QList<QUrl> locateAll(QStandardPaths::StandardLocation type, const QString &fileName, QStandardPaths::LocateOptions options = QStandardPaths::LocateFile);
47 Q_INVOKABLE static void setTestModeEnabled(bool testMode);
48 Q_INVOKABLE static QList<QUrl> standardLocations(QStandardPaths::StandardLocation type);
49 Q_INVOKABLE static QUrl writableLocation(QStandardPaths::StandardLocation type);
50
51private:
52 Q_DISABLE_COPY(QQuickLabsPlatformStandardPaths)
53};
54
55QT_END_NAMESPACE
56
57QML_DECLARE_TYPE(QQuickLabsPlatformStandardPaths)
58Q_DECLARE_METATYPE(QStandardPaths::StandardLocation)
59Q_DECLARE_METATYPE(QStandardPaths::LocateOptions)
60
61#endif // QT_DEPRECATED_SINCE(6, 4)
62
63#endif // QQUICKLABSPLATFORMSTANDARDPATHS_P_H
64

source code of qtdeclarative/src/labs/platform/qquicklabsplatformstandardpaths_p.h