KUnifiedPush

ntfypushprovider.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_NTFYPUSHPROVIDER_H
7#define KUNIFIEDPUSH_NTFYPUSHPROVIDER_H
8
9#include "abstractpushprovider.h"
10#include "serversenteventsstream.h"
11
12#include <QPointer>
13#include <QUrl>
14
15class QNetworkReply;
16
17namespace KUnifiedPush {
18
19/** Ntfy push provider. */
21{
23public:
24 explicit NtfyPushProvider(QObject *parent = nullptr);
26
27 bool loadSettings(const QSettings &settings) override;
28 void connectToProvider() override;
29 void disconnectFromProvider() override;
30 void registerClient(const Client &client) override;
31 void unregisterClient(const Client &client) override;
32
33 static constexpr const char Id[] = "Ntfy";
34private:
35 void doConnectToProvider();
36 void storeState();
37
38 QUrl m_url;
39 QStringList m_topics;
40 QString m_lastMessageId;
41
42 QPointer<QNetworkReply> m_sseReply;
43 ServerSentEventsStream m_sseStream;
44};
45
46}
47
48#endif // KUNIFIEDPUSH_NTFYPUSHPROVIDER_H
Base class for push provider protocol implementations.
Information about a registered client.
Definition client.h:19
void registerClient(const Client &client) override
Register a new client with the provider.
bool loadSettings(const QSettings &settings) override
Load connection settings.
void connectToProvider() override
Attempt to establish a connection to the push provider.
void unregisterClient(const Client &client) override
Unregister a client from the provider.
void disconnectFromProvider() override
Disconnect and existing connection to the push provider.
Sever-sent Events (SSE) stream.
Client-side integration with UnifiedPush.
Definition connector.h:16
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:21:15 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.