KUnifiedPush

kcmpushnotifications.h
1/*
2 SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6#ifndef KCMPUSHNOTIFICATIONS_H
7#define KCMPUSHNOTIFICATIONS_H
8
9#include "clientmodel.h"
10
11#include <KQuickConfigModule>
12
13#include <QDBusServiceWatcher>
14#include <QNetworkAccessManager>
15
16#include <memory>
17
19class OrgKdeKunifiedpushManagementInterface;
20
21/** KCM to configure push notifications. */
23{
25 Q_PROPERTY(bool hasDistributor READ hasDistributor NOTIFY distributorChanged)
26 Q_PROPERTY(bool hasKDEDistributor READ hasKDEDistributor NOTIFY distributorChanged)
27 Q_PROPERTY(int distributorStatus READ distributorStatus NOTIFY distributorStatusChanged)
28 Q_PROPERTY(QString pushProviderId READ pushProviderId NOTIFY pushProviderChanged)
29 Q_PROPERTY(ClientModel* clientModel READ clientModel CONSTANT)
30public:
31 explicit KCMPushNotifications(QObject *parent, const KPluginMetaData &data, const QVariantList &args);
33
34 bool hasDistributor() const;
35 bool hasKDEDistributor() const;
36 int distributorStatus() const;
37 QString pushProviderId() const;
38 ClientModel *clientModel() const;
39
40 Q_INVOKABLE QVariantMap pushProviderConfiguration(const QString &pushProviderId) const;
41
42 Q_INVOKABLE void nextcloudAuthenticate(const QUrl &url);
43
44 void save() override;
45
46public Q_SLOTS:
47 void forceUnregister(const QString &token);
48 void setPushProviderConfiguration(const QString &pushProviderId, const QVariantMap &config);
49
51 void distributorChanged();
52 void distributorStatusChanged();
53 void pushProviderChanged();
54
55 void nextcloudAuthenticated(const QString &loginName, const QString &appPassword);
56
57 void saveRequested();
58
59private:
60 OrgKdeKunifiedpushManagementInterface *m_mgmtIface = nullptr;
61 ClientModel *m_clientModel = nullptr;
62 QDBusServiceWatcher m_serviceWatcher;
63
65 std::unique_ptr<NextcloudAuthenticator> m_nextcloudAuthenticator;
66};
67
68#endif // KCMPUSHNOTIFICATIONS_H
Model for all registered push notification client.
Definition clientmodel.h:15
KCM to configure push notifications.
Implementation of https://docs.nextcloud.com/server/latest/developer_manual/client_apis/LoginFlow/ind...
Q_INVOKABLEQ_INVOKABLE
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 12:02:24 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.