File indexing completed on 2024-04-14 05:39:27

0001 // SPDX-FileCopyrightText: 2020 Simon Persson <simon.persson@mykolab.com>
0002 //
0003 // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 
0005 #ifndef KUPENGINE_H
0006 #define KUPENGINE_H
0007 
0008 #include <QtGlobal>
0009 
0010 #if QT_VERSION_MAJOR == 5
0011 #include <Plasma/DataEngine>
0012 #else
0013 #include <Plasma5Support/DataEngine>
0014 namespace Plasma = Plasma5Support;
0015 #endif
0016 
0017 #include <QLocalSocket>
0018 
0019 class KupEngine : public Plasma::DataEngine
0020 {
0021     Q_OBJECT
0022 public:
0023     KupEngine(QObject *pParent, const QVariantList &pArgs);
0024     Plasma::Service *serviceForSource (const QString &pSource) override;
0025 
0026 public slots:
0027 //  void refresh();
0028     void processData();
0029     void checkConnection(QLocalSocket::LocalSocketState pState);
0030 
0031 private:
0032     void setPlanData(int i, const QJsonObject &pPlan, const QString &pKey);
0033     void setCommonData(const QJsonObject &pCommonStatus, const QString &pKey);
0034     QLocalSocket *mSocket;
0035     QString mSocketName;
0036 };
0037 
0038 #endif // KUPENGINE_H