Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qohospermissionshelper_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 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 QOHOSPERMISSIONSHELPER_P_H
5#define QOHOSPERMISSIONSHELPER_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/private/qglobal_p.h>
19#include <QtCore/private/qohoscommon_p.h>
20#include <QtCore/qlist.h>
21#include <QtCore/qobject.h>
22#include <QtCore/qstring.h>
23#include <QtCore/qstringlist.h>
24
26
28{
29public:
30 struct PermissionRequestResult
31 {
32 bool permissionGranted = false;
33 bool dialogShown = false;
34 };
35
36 virtual ~QOhosPermissionsHelper() = default;
37
38 virtual bool isPermissionGranted(const QString &permissionName) const = 0;
39
40 virtual void requestPermissionsFromUserIfNeeded(
41 const QStringList &permissionNames, QObject *resultConsumerContext,
42 QOhosConsumer<QList<PermissionRequestResult>> resultConsumer) = 0;
43
44 virtual void requestPermissionsOnSettingIfNeeded(
45 const QStringList &permissionNames, QObject *resultConsumerContext,
46 QOhosConsumer<QList<bool>> resultConsumer) = 0;
47
48protected:
49 QOhosPermissionsHelper() = default;
50
51private:
52 Q_DISABLE_COPY_MOVE(QOhosPermissionsHelper)
53};
54
55Q_CORE_EXPORT void qt_setQOhosPermissionsHelper(QOhosPermissionsHelper *permissionsHelper);
56
57QT_END_NAMESPACE
58
59#endif
Q_CORE_EXPORT void qt_setQOhosPermissionsHelper(QOhosPermissionsHelper *permissionsHelper)