File indexing completed on 2024-04-28 16:54:38

0001 /*
0002     SPDX-FileCopyrightText: 2019 Kai Uwe Broulik <kde@privat.broulik.de>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include "notificationmanager_export.h"
0010 
0011 #include <QObject>
0012 #include <QScopedPointer>
0013 #include <QString>
0014 
0015 namespace NotificationManager
0016 {
0017 /**
0018  * @short Information about the notification server
0019  *
0020  * Provides information such as vendor, name, version of the notification server.
0021  *
0022  * @author Kai Uwe Broulik <kde@privat.broulik.de>
0023  **/
0024 class NOTIFICATIONMANAGER_EXPORT ServerInfo : public QObject
0025 {
0026     Q_OBJECT
0027 
0028     Q_PROPERTY(Status status READ status NOTIFY statusChanged)
0029 
0030     Q_PROPERTY(QString vendor READ vendor NOTIFY vendorChanged)
0031 
0032     Q_PROPERTY(QString name READ name NOTIFY nameChanged)
0033 
0034     Q_PROPERTY(QString version READ version NOTIFY versionChanged)
0035 
0036     Q_PROPERTY(QString specVersion READ specVersion NOTIFY specVersionChanged)
0037 
0038 public:
0039     explicit ServerInfo(QObject *parent = nullptr);
0040     ~ServerInfo() override;
0041 
0042     enum class Status {
0043         Unknown = -1,
0044         NotRunning,
0045         Running,
0046     };
0047     Q_ENUM(Status)
0048 
0049     Status status() const;
0050     QString vendor() const;
0051     QString name() const;
0052     QString version() const;
0053     QString specVersion() const;
0054 
0055 Q_SIGNALS:
0056     void statusChanged(Status status);
0057     void vendorChanged(const QString &vendor);
0058     void nameChanged(const QString &name);
0059     void versionChanged(const QString &version);
0060     void specVersionChanged(const QString &specVersion);
0061 
0062 private:
0063     class Private;
0064     QScopedPointer<Private> d;
0065 };
0066 
0067 } // namespace NotificationManager