2013-07-04 18:17:22 +01:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2013 Albert Vaca <albertvaka@gmail.com>
|
2013-07-04 18:17:22 +01:00
|
|
|
*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2013-07-04 18:17:22 +01:00
|
|
|
*/
|
|
|
|
|
2013-08-13 04:14:46 +01:00
|
|
|
#ifndef PINGPLUGIN_H
|
|
|
|
#define PINGPLUGIN_H
|
2013-07-04 18:17:22 +01:00
|
|
|
|
2013-08-13 04:07:32 +01:00
|
|
|
#include <QObject>
|
2013-07-04 18:17:22 +01:00
|
|
|
|
2014-06-14 15:34:00 +01:00
|
|
|
#include <core/kdeconnectplugin.h>
|
2013-07-04 18:17:22 +01:00
|
|
|
|
2018-03-04 19:48:51 +00:00
|
|
|
#define PACKET_TYPE_PING QStringLiteral("kdeconnect.ping")
|
2014-09-21 23:45:41 +01:00
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
class Q_DECL_EXPORT PingPlugin : public KdeConnectPlugin
|
2013-07-04 18:17:22 +01:00
|
|
|
{
|
2013-08-12 15:09:52 +01:00
|
|
|
Q_OBJECT
|
2014-06-27 17:21:40 +01:00
|
|
|
Q_CLASSINFO("D-Bus Interface", "org.kde.kdeconnect.device.ping")
|
2013-07-04 18:17:22 +01:00
|
|
|
|
|
|
|
public:
|
2022-09-10 22:23:52 +01:00
|
|
|
explicit PingPlugin(QObject *parent, const QVariantList &args);
|
2016-06-20 08:05:02 +01:00
|
|
|
~PingPlugin() override;
|
2014-09-21 23:45:41 +01:00
|
|
|
|
2014-06-27 17:21:40 +01:00
|
|
|
Q_SCRIPTABLE void sendPing();
|
2022-09-10 22:23:52 +01:00
|
|
|
Q_SCRIPTABLE void sendPing(const QString &customMessage);
|
2014-06-27 17:21:40 +01:00
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
bool receivePacket(const NetworkPacket &np) override;
|
|
|
|
void connected() override
|
|
|
|
{
|
|
|
|
}
|
2013-07-04 18:17:22 +01:00
|
|
|
|
2016-12-30 15:38:12 +00:00
|
|
|
QString dbusPath() const override;
|
2013-07-04 18:17:22 +01:00
|
|
|
};
|
|
|
|
|
2013-07-24 17:42:33 +01:00
|
|
|
#endif
|