KUnifiedPush

gotifypushprovider.h
1 /*
2  SPDX-FileCopyrightText: 2022 Volker Krause <[email protected]>
3  SPDX-License-Identifier: LGPL-2.0-or-later
4 */
5 
6 #ifndef KUNIFIEDPUSH_GOTIFYPUSHPROVIDER_H
7 #define KUNIFIEDPUSH_GOTIFYPUSHPROVIDER_H
8 
9 #include "abstractpushprovider.h"
10 
11 #include <QUrl>
12 
13 class QWebSocket;
14 
15 namespace KUnifiedPush {
16 
17 /** Push provider protocol implementation for Gotify. */
19 {
20  Q_OBJECT
21 public:
22  explicit GotifyPushProvider(QObject *parent = nullptr);
23 
24  bool loadSettings(const QSettings &settings) override;
25  void connectToProvider() override;
26  void disconnectFromProvider() override;
27  void registerClient(const Client &client) override;
28  void unregisterClient(const Client &client) override;
29 
30  static constexpr const char Id[] = "Gotify";
31 private:
32  void wsMessageReceived(const QString &msg);
33 
34  QString m_clientToken;
35  QUrl m_url;
36  QWebSocket *m_socket = nullptr;
37 };
38 
39 }
40 
41 #endif // KUNIFIEDPUSH_GOTIFYPUSHPROVIDER_H
Q_OBJECTQ_OBJECT
Client-side integration with UnifiedPush.
Definition: connector.h:16
void disconnectFromProvider() override
Disconnect and existing connection to the push provider.
Base class for push provider protocol implementations.
void registerClient(const Client &client) override
Register a new client with the provider.
void connectToProvider() override
Attempt to establish a connection to the push provider.
void unregisterClient(const Client &client) override
Unregister a client from the provider.
Push provider protocol implementation for Gotify.
bool loadSettings(const QSettings &settings) override
Load connection settings.
Information about a registered client.
Definition: client.h:18
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Dec 11 2023 03:47:52 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.