2013-07-03 02:52:44 +01:00
|
|
|
/**
|
2013-06-27 01:13:16 +01:00
|
|
|
* Copyright 2013 Albert Vaca <albertvaka@gmail.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License or (at your option) version 3 or any later version
|
|
|
|
* accepted by the membership of KDE e.V. (or its successor approved
|
|
|
|
* by the membership of KDE e.V.), which shall act as a proxy
|
|
|
|
* defined in Section 14 of version 3 of the license.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2013-08-21 17:25:44 +01:00
|
|
|
#ifndef DBUSINTERFACES_H
|
|
|
|
#define DBUSINTERFACES_H
|
2013-06-27 01:13:16 +01:00
|
|
|
|
2014-06-14 14:22:40 +01:00
|
|
|
#include "interfaces/kdeconnectinterfaces_export.h"
|
2013-08-21 17:25:44 +01:00
|
|
|
|
2014-06-14 14:22:40 +01:00
|
|
|
#include "interfaces/daemoninterface.h"
|
|
|
|
#include "interfaces/deviceinterface.h"
|
|
|
|
#include "interfaces/devicebatteryinterface.h"
|
|
|
|
#include "interfaces/devicesftpinterface.h"
|
2015-09-11 16:51:50 +01:00
|
|
|
#include "interfaces/devicefindmyphoneinterface.h"
|
2014-06-14 14:22:40 +01:00
|
|
|
#include "interfaces/devicenotificationsinterface.h"
|
|
|
|
#include "interfaces/notificationinterface.h"
|
2015-06-18 03:01:01 +01:00
|
|
|
#include "interfaces/mprisremoteinterface.h"
|
2015-07-22 02:19:29 +01:00
|
|
|
#include "interfaces/remotecontrolinterface.h"
|
2015-07-22 02:37:34 +01:00
|
|
|
#include "interfaces/lockdeviceinterface.h"
|
2013-06-27 01:13:16 +01:00
|
|
|
|
2013-07-26 15:21:19 +01:00
|
|
|
/**
|
|
|
|
* Using these "proxy" classes just in case we need to rename the
|
|
|
|
* interface, so we can change the class name in a single place.
|
|
|
|
*/
|
2014-06-14 14:22:40 +01:00
|
|
|
class KDECONNECTINTERFACES_EXPORT DaemonDbusInterface
|
2013-07-26 15:21:19 +01:00
|
|
|
: public OrgKdeKdeconnectDaemonInterface
|
2013-07-24 17:42:33 +01:00
|
|
|
{
|
2013-06-27 01:13:16 +01:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-09-08 09:46:59 +01:00
|
|
|
explicit DaemonDbusInterface(QObject* parent = nullptr);
|
2014-01-16 11:13:17 +00:00
|
|
|
virtual ~DaemonDbusInterface();
|
2015-06-25 20:19:23 +01:00
|
|
|
|
|
|
|
static QString activatedService();
|
2015-09-12 21:12:18 +01:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void deviceAdded(const QString &id);
|
2013-06-27 01:13:16 +01:00
|
|
|
};
|
|
|
|
|
2014-06-14 14:22:40 +01:00
|
|
|
class KDECONNECTINTERFACES_EXPORT DeviceDbusInterface
|
2013-07-26 15:21:19 +01:00
|
|
|
: public OrgKdeKdeconnectDeviceInterface
|
|
|
|
{
|
2013-07-03 02:52:44 +01:00
|
|
|
Q_OBJECT
|
2015-06-18 03:01:01 +01:00
|
|
|
// TODO: Workaround because OrgKdeKdeconnectDeviceInterface is not generating
|
2015-06-13 00:28:36 +01:00
|
|
|
// the signals for the properties
|
|
|
|
Q_PROPERTY(bool isPaired READ isPaired NOTIFY pairingChangedProxy)
|
2015-06-24 19:57:02 +01:00
|
|
|
|
2013-07-03 02:52:44 +01:00
|
|
|
public:
|
2015-09-08 09:46:59 +01:00
|
|
|
explicit DeviceDbusInterface(const QString& deviceId, QObject* parent = nullptr);
|
2014-01-16 11:13:17 +00:00
|
|
|
virtual ~DeviceDbusInterface();
|
2015-06-13 00:28:36 +01:00
|
|
|
|
2015-06-25 03:08:00 +01:00
|
|
|
Q_SCRIPTABLE QString id() const;
|
2015-06-13 00:28:36 +01:00
|
|
|
Q_SCRIPTABLE void pluginCall(const QString &plugin, const QString &method);
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void pairingChangedProxy(bool paired);
|
2015-06-24 19:57:02 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
const QString m_id;
|
2013-07-03 02:52:44 +01:00
|
|
|
};
|
|
|
|
|
2014-06-14 14:22:40 +01:00
|
|
|
class KDECONNECTINTERFACES_EXPORT DeviceBatteryDbusInterface
|
2013-08-21 17:25:44 +01:00
|
|
|
: public OrgKdeKdeconnectDeviceBatteryInterface
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-09-08 09:46:59 +01:00
|
|
|
explicit DeviceBatteryDbusInterface(const QString& deviceId, QObject* parent = nullptr);
|
2014-01-16 11:13:17 +00:00
|
|
|
virtual ~DeviceBatteryDbusInterface();
|
2013-08-21 17:25:44 +01:00
|
|
|
};
|
|
|
|
|
2014-06-14 14:22:40 +01:00
|
|
|
class KDECONNECTINTERFACES_EXPORT DeviceNotificationsDbusInterface
|
2013-08-21 17:25:44 +01:00
|
|
|
: public OrgKdeKdeconnectDeviceNotificationsInterface
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-09-08 09:46:59 +01:00
|
|
|
explicit DeviceNotificationsDbusInterface(const QString& deviceId, QObject* parent = nullptr);
|
2014-01-16 11:13:17 +00:00
|
|
|
virtual ~DeviceNotificationsDbusInterface();
|
2013-08-21 17:25:44 +01:00
|
|
|
};
|
|
|
|
|
2014-06-14 14:22:40 +01:00
|
|
|
class KDECONNECTINTERFACES_EXPORT NotificationDbusInterface
|
2013-08-21 17:25:44 +01:00
|
|
|
: public OrgKdeKdeconnectDeviceNotificationsNotificationInterface
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-09-08 09:46:59 +01:00
|
|
|
NotificationDbusInterface(const QString& deviceId, const QString& notificationId, QObject* parent = nullptr);
|
2014-01-16 11:13:17 +00:00
|
|
|
virtual ~NotificationDbusInterface();
|
2016-04-03 15:48:28 +01:00
|
|
|
|
|
|
|
QString notificationId() { return id; }
|
|
|
|
private:
|
|
|
|
const QString id;
|
2013-08-21 17:25:44 +01:00
|
|
|
};
|
|
|
|
|
2015-09-11 16:51:50 +01:00
|
|
|
|
2014-06-14 14:22:40 +01:00
|
|
|
class KDECONNECTINTERFACES_EXPORT SftpDbusInterface
|
2014-01-06 20:56:51 +00:00
|
|
|
: public OrgKdeKdeconnectDeviceSftpInterface
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-09-08 09:46:59 +01:00
|
|
|
explicit SftpDbusInterface(const QString& deviceId, QObject* parent = nullptr);
|
2014-01-06 20:56:51 +00:00
|
|
|
virtual ~SftpDbusInterface();
|
|
|
|
};
|
|
|
|
|
2015-06-18 03:01:01 +01:00
|
|
|
class KDECONNECTINTERFACES_EXPORT MprisDbusInterface
|
|
|
|
: public OrgKdeKdeconnectDeviceMprisremoteInterface
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
// TODO: Workaround because qdbusxml2cpp is not generating
|
|
|
|
// the signals for the properties
|
|
|
|
Q_PROPERTY(bool isPlaying READ isPlaying NOTIFY propertiesChangedProxy)
|
|
|
|
Q_PROPERTY(int length READ length NOTIFY propertiesChangedProxy)
|
|
|
|
Q_PROPERTY(QString nowPlaying READ nowPlaying NOTIFY propertiesChangedProxy)
|
|
|
|
Q_PROPERTY(QStringList playerList READ playerList NOTIFY propertiesChangedProxy)
|
|
|
|
Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY propertiesChangedProxy)
|
|
|
|
Q_PROPERTY(int position READ position WRITE setPosition NOTIFY propertiesChangedProxy)
|
|
|
|
public:
|
2015-09-08 09:46:59 +01:00
|
|
|
explicit MprisDbusInterface(const QString& deviceId, QObject* parent = nullptr);
|
2015-06-18 03:01:01 +01:00
|
|
|
virtual ~MprisDbusInterface();
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void propertiesChangedProxy();
|
|
|
|
};
|
|
|
|
|
2015-07-22 02:19:29 +01:00
|
|
|
class KDECONNECTINTERFACES_EXPORT RemoteControlDbusInterface
|
|
|
|
: public OrgKdeKdeconnectDeviceRemotecontrolInterface
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-09-08 09:46:59 +01:00
|
|
|
explicit RemoteControlDbusInterface(const QString& deviceId, QObject* parent = nullptr);
|
2015-07-22 02:19:29 +01:00
|
|
|
~RemoteControlDbusInterface() override;
|
|
|
|
};
|
|
|
|
|
2015-07-22 02:37:34 +01:00
|
|
|
class KDECONNECTINTERFACES_EXPORT LockDeviceDbusInterface
|
|
|
|
: public OrgKdeKdeconnectDeviceLockdeviceInterface
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(bool isLocked READ isLocked WRITE setIsLocked NOTIFY lockedChangedProxy)
|
|
|
|
public:
|
2015-09-08 09:46:59 +01:00
|
|
|
explicit LockDeviceDbusInterface(const QString& deviceId, QObject* parent = nullptr);
|
2015-07-22 02:37:34 +01:00
|
|
|
virtual ~LockDeviceDbusInterface();
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void lockedChangedProxy(bool isLocked);
|
|
|
|
};
|
|
|
|
|
2015-09-11 16:51:50 +01:00
|
|
|
class KDECONNECTINTERFACES_EXPORT FindMyPhoneDeviceDbusInterface
|
|
|
|
: public OrgKdeKdeconnectDeviceFindmyphoneInterface
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit FindMyPhoneDeviceDbusInterface(const QString& deviceId, QObject* parent = nullptr);
|
|
|
|
virtual ~FindMyPhoneDeviceDbusInterface();
|
|
|
|
};
|
|
|
|
|
2015-02-24 06:12:45 +00:00
|
|
|
#endif
|