1 | // Copyright (C) 2021 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 QQMLSTANDARDPATHS_P_H |
5 | #define QQMLSTANDARDPATHS_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 <QtQmlCore/private/qqmlcoreglobal_p.h> |
23 | |
24 | QT_BEGIN_NAMESPACE |
25 | |
26 | class QQmlEngine; |
27 | class QJSEngine; |
28 | |
29 | class Q_QMLCORE_PRIVATE_EXPORT QQmlStandardPaths : public QObject |
30 | { |
31 | Q_OBJECT |
32 | QML_SINGLETON |
33 | QML_NAMED_ELEMENT(StandardPaths) |
34 | QML_ADDED_IN_VERSION(6, 2) |
35 | QML_EXTENDED_NAMESPACE(QStandardPaths) |
36 | |
37 | public: |
38 | explicit QQmlStandardPaths(QObject *parent = nullptr); |
39 | |
40 | Q_INVOKABLE QString displayName(QStandardPaths::StandardLocation type) const; |
41 | Q_INVOKABLE QUrl findExecutable(const QString &executableName, const QStringList &paths = QStringList()) const; |
42 | Q_INVOKABLE QUrl locate(QStandardPaths::StandardLocation type, const QString &fileName, |
43 | QStandardPaths::LocateOptions options = QStandardPaths::LocateFile) const; |
44 | Q_INVOKABLE QList<QUrl> locateAll(QStandardPaths::StandardLocation type, const QString &fileName, |
45 | QStandardPaths::LocateOptions options = QStandardPaths::LocateFile) const; |
46 | Q_INVOKABLE QList<QUrl> standardLocations(QStandardPaths::StandardLocation type) const; |
47 | Q_INVOKABLE QUrl writableLocation(QStandardPaths::StandardLocation type) const; |
48 | }; |
49 | |
50 | QT_END_NAMESPACE |
51 | |
52 | #endif // QQMLSTANDARDPATHS_P_H |
53 |