File indexing completed on 2025-02-16 04:23:12

0001 /*
0002     SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
0003     SPDX-License-Identifier: LGPL-2.0-or-later
0004 */
0005 
0006 #ifndef KUNIFIEDPUSH_CLIENT_H
0007 #define KUNIFIEDPUSH_CLIENT_H
0008 
0009 #include <QMetaType>
0010 #include <QString>
0011 
0012 class QSettings;
0013 class OrgUnifiedpushConnector1Interface;
0014 
0015 namespace KUnifiedPush {
0016 
0017 /** Information about a registered client */
0018 class Client
0019 {
0020 public:
0021     void store(QSettings &settings) const;
0022     static Client load(const QString &token, QSettings &settings);
0023 
0024     /** Contains all required information for a client. */
0025     bool isValid() const;
0026 
0027     /** Activate client on D-Bus. */
0028     void activate() const;
0029     /** D-Bus UnifiedPush connector interface. */
0030     OrgUnifiedpushConnector1Interface connector() const;
0031 
0032     QString serviceName;
0033     QString token;
0034     QString remoteId;
0035     QString endpoint;
0036     QString description;
0037 };
0038 
0039 }
0040 
0041 Q_DECLARE_METATYPE(KUnifiedPush::Client)
0042 
0043 #endif // KUNIFIEDPUSH_CLIENT_H