KUnifiedPush

nextpushprovider.h
1/*
2 SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
3 SPDX-License-Identifier: LGPL-2.0-or-later
4*/
5
6#ifndef KUNIFIEDPUSH_NEXTPUSHPROVIDER_H
7#define KUNIFIEDPUSH_NEXTPUSHPROVIDER_H
8
9#include "abstractpushprovider.h"
10#include "serversenteventsstream.h"
11
12#include <QPointer>
13#include <QUrl>
14
15class QNetworkRequest;
16class QNetworkReply;
17
18namespace KUnifiedPush {
19
20/** NextPush push provider implementation.
21 * @see https://github.com/UP-NextPush/
22 */
24{
25public:
26 explicit NextPushProvider(QObject *parent = nullptr);
28
29 bool loadSettings(const QSettings &settings) override;
30 void connectToProvider() override;
31 void disconnectFromProvider() override;
32 void registerClient(const Client &client) override;
33 void unregisterClient(const Client &client) override;
34
35 static constexpr const char Id[] = "NextPush";
36private:
37 void waitForMessage();
38 QNetworkRequest prepareRequest(const char *restCmd, const QString &restArg = {}) const;
39
40 QUrl m_url;
41 QString m_userName;
42 QString m_appPassword;
43 QString m_deviceId;
44
45 QPointer<QNetworkReply> m_sseReply;
46 ServerSentEventsStream m_sseStream;
47};
48
49}
50
51#endif // KUNIFIEDPUSH_NEXTPUSHPROVIDER_H
Base class for push provider protocol implementations.
Information about a registered client.
Definition client.h:19
NextPush push provider implementation.
void registerClient(const Client &client) override
Register a new client with the provider.
void disconnectFromProvider() override
Disconnect and existing connection to the push provider.
void unregisterClient(const Client &client) override
Unregister a client from the provider.
void connectToProvider() override
Attempt to establish a connection to the push provider.
bool loadSettings(const QSettings &settings) override
Load connection settings.
Sever-sent Events (SSE) stream.
Client-side integration with UnifiedPush.
Definition connector.h:16
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 11:57:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.