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 | /*! |
16 | * \namespace KNotificationPermission |
17 | * \inmodule KNotifications |
18 | * |
19 | * \brief Check or request permissions to show notifications on platforms where |
20 | * that is necessary. |
21 | * |
22 | * \since 6.0 |
23 | */ |
24 | namespace KNotificationPermission |
25 | { |
26 | |
27 | /*! Check if the current application has permissions to show notifications. */ |
28 | KNOTIFICATIONS_EXPORT Qt::PermissionStatus checkPermission(); |
29 | |
30 | /*! Request notification permissions. */ |
31 | KNOTIFICATIONS_EXPORT void requestPermission(QObject *context, const std::function<void(Qt::PermissionStatus)> &callback); |
32 | |
33 | } |
34 | |
35 | #endif |
36 | |