1 | /* |
2 | SPDX-FileCopyrightText: 2023 Volker Krause <vkrause@kde.org> |
3 | SPDX-License-Identifier: LGPL-2.0-or-later |
4 | */ |
5 | |
6 | #ifndef KNOTIFICATIONPERMISSION_H |
7 | #define KNOTIFICATIONPERMISSION_H |
8 | |
9 | #include <knotifications_export.h> |
10 | |
11 | #include <qnamespace.h> |
12 | |
13 | #include <functional> |
14 | |
15 | /** Check or request permissions to show notifications on platforms where |
16 | * that is necessary. |
17 | * |
18 | * @since 6.0 |
19 | */ |
20 | namespace KNotificationPermission |
21 | { |
22 | |
23 | /** Check if the current application has permissions to show notifications. */ |
24 | KNOTIFICATIONS_EXPORT Qt::PermissionStatus checkPermission(); |
25 | |
26 | /** Request notification permissions. */ |
27 | KNOTIFICATIONS_EXPORT void requestPermission(QObject *context, const std::function<void(Qt::PermissionStatus)> &callback); |
28 | |
29 | } |
30 | |
31 | #endif |
32 | |