[OpenDocString] kdeconnect-kde (cpp)
dbusinterfaces.cpp
QString DaemonDbusInterface::activatedService()
{
    static const QString service = QStringLiteral("org.kde.kdeconnect");

#ifndef SAILFISHOS
    auto reply = QDBusConnection::sessionBus().interface()->startService(service);
    if (!reply.isValid()) {
        qWarning() << "error activating kdeconnectd:" << reply.error();
    }
#endif

    return service;
}
This creates a new kdeconnect service and returns it.
DaemonDbusInterface::DaemonDbusInterface(QObject *parent)
    : OrgKdeKdeconnectDaemonInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect"), QDBusConnection::sessionBus(), parent)
{
    connect(this, &OrgKdeKdeconnectDaemonInterface::pairingRequestsChanged, this, &DaemonDbusInterface::pairingRequestsChangedProxy);
    connect(this, &OrgKdeKdeconnectDaemonInterface::customDevicesChanged, this, &DaemonDbusInterface::customDevicesChangedProxy);
}
This constructor builds a daemon object in the DBus environment and adds signal/slot connections to it. The signal/slot connections are bound to the pairing requests and custom devices changed proxies.
DaemonDbusInterface::~DaemonDbusInterface()
{
}
This implements the interface to manage daemon dbus objects.
DeviceDbusInterface::DeviceDbusInterface(const QString &id, QObject *parent)
    : OrgKdeKdeconnectDeviceInterface(DaemonDbusInterface::activatedService(),
                                      QStringLiteral("/modules/kdeconnect/devices/") + id,
                                      QDBusConnection::sessionBus(),
                                      parent)
    , m_id(id)
{
    connect(this, &OrgKdeKdeconnectDeviceInterface::trustedChanged, this, &DeviceDbusInterface::trustedChangedProxy);
    connect(this, &OrgKdeKdeconnectDeviceInterface::reachableChanged, this, &DeviceDbusInterface::reachableChangedProxy);
    connect(this, &OrgKdeKdeconnectDeviceInterface::nameChanged, this, &DeviceDbusInterface::nameChangedProxy);
    connect(this, &OrgKdeKdeconnectDeviceInterface::hasPairingRequestsChanged, this, &DeviceDbusInterface::hasPairingRequestsChangedProxy);
}
This constructs a device object from an id, and a parent object. It takes the id of the device and its parent object, and creates connections to the trustedChanged and reachableChanged events, and the hasPairingRequestsChanged method.
DeviceDbusInterface::~DeviceDbusInterface()
{
}
This implements the interface to manage device drivers using Dbus.
QString DeviceDbusInterface::id() const
{
    return m_id;
}
Returns the id stored in the internal list.
void DeviceDbusInterface::pluginCall(const QString &plugin, const QString &method)
{
    QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.kdeconnect"),
                                                      QStringLiteral("/modules/kdeconnect/devices/") + id() + QStringLiteral("/") + plugin,
                                                      QStringLiteral("org.kde.kdeconnect.device.") + plugin,
                                                      method);
    QDBusConnection::sessionBus().asyncCall(msg);
}
This sends a plugin call to the plugin method.
BatteryDbusInterface::BatteryDbusInterface(const QString &id, QObject *parent)
    : OrgKdeKdeconnectDeviceBatteryInterface(DaemonDbusInterface::activatedService(),
                                             QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/battery"),
                                             QDBusConnection::sessionBus(),
                                             parent)
{
    connect(this, &OrgKdeKdeconnectDeviceBatteryInterface::refreshed, this, &BatteryDbusInterface::refreshedProxy);
}
Constructs a battery device object in the DBus interface. The battery object is a QObject of the type 'OrgKdeConnectDeviceBatteryInterface'. The battery object is a QObject of the type 'QString' and is connected to the refreshedProxy object by calling the connect method. The parent object is used to manage the connections between the daemon and the battery proxy.
BatteryDbusInterface::~BatteryDbusInterface() = default;
This removes the BatteryDbusInterface object from the list of supported interfaces.
ConnectivityReportDbusInterface::ConnectivityReportDbusInterface(const QString &id, QObject *parent)
    : OrgKdeKdeconnectDeviceConnectivity_reportInterface(DaemonDbusInterface::activatedService(),
                                                         QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/connectivity_report"),
                                                         QDBusConnection::sessionBus(),
                                                         parent)
{
    connect(this, &OrgKdeKdeconnectDeviceConnectivity_reportInterface::refreshed, this, &ConnectivityReportDbusInterface::refreshedProxy);
}
This constructor builds a ConnectivityReport object from an id, and a parent object. It takes the id and parent QObject, which is the parent object of the plugin.
ConnectivityReportDbusInterface::~ConnectivityReportDbusInterface() = default;
This removes the default connectivity report DBus interface from the list of connections.
DeviceNotificationsDbusInterface::DeviceNotificationsDbusInterface(const QString &id, QObject *parent)
    : OrgKdeKdeconnectDeviceNotificationsInterface(DaemonDbusInterface::activatedService(),
                                                   QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/notifications"),
                                                   QDBusConnection::sessionBus(),
                                                   parent)
{
}
Constructs a device notifications interface object. It takes the id and parent object, and creates it using the activated service.
DeviceNotificationsDbusInterface::~DeviceNotificationsDbusInterface()
{
}
This removes the notification interfaces from the device notifications dbus.
NotificationDbusInterface::NotificationDbusInterface(const QString &deviceId, const QString ¬ificationId, QObject *parent)
    : OrgKdeKdeconnectDeviceNotificationsNotificationInterface(DaemonDbusInterface::activatedService(),
                                                               QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/notifications/")
                                                                   + notificationId,
                                                               QDBusConnection::sessionBus(),
                                                               parent)
    , id(notificationId)
{
}
Constructs a notification object in the DBus interface.
NotificationDbusInterface::~NotificationDbusInterface()
{
}
This removes the notification interface from the database.
DeviceConversationsDbusInterface::DeviceConversationsDbusInterface(const QString &deviceId, QObject *parent)
    : OrgKdeKdeconnectDeviceConversationsInterface(DaemonDbusInterface::activatedService(),
                                                   QStringLiteral("/modules/kdeconnect/devices/") + deviceId,
                                                   QDBusConnection::sessionBus(),
                                                   parent)
{
}
Constructs a new device conversations object.
DeviceConversationsDbusInterface::~DeviceConversationsDbusInterface()
{
}
This implements the interface to manage device conversations in the Dbus device controller.
SftpDbusInterface::SftpDbusInterface(const QString &id, QObject *parent)
    : OrgKdeKdeconnectDeviceSftpInterface(DaemonDbusInterface::activatedService(),
                                          QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/sftp"),
                                          QDBusConnection::sessionBus(),
                                          parent)
{
}
Constructs a new ftp device object.
SftpDbusInterface::~SftpDbusInterface()
{
}
This implements the disable feature of disconnecting the dbus interface.
MprisDbusInterface::MprisDbusInterface(const QString &id, QObject *parent)
    : OrgKdeKdeconnectDeviceMprisremoteInterface(DaemonDbusInterface::activatedService(),
                                                 QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/mprisremote"),
                                                 QDBusConnection::sessionBus(),
                                                 parent)
{
    connect(this, &OrgKdeKdeconnectDeviceMprisremoteInterface::propertiesChanged, this, &MprisDbusInterface::propertiesChangedProxy);
}
Constructs a new mprisremote interface object. The id parameter is the id of the device, the parent object is the parent object, the object is connected to the propertiesChangedProxy signal.
MprisDbusInterface::~MprisDbusInterface()
{
}
This implements the interface to implement Dbus operations.
RemoteControlDbusInterface::RemoteControlDbusInterface(const QString &id, QObject *parent)
    : OrgKdeKdeconnectDeviceRemotecontrolInterface(DaemonDbusInterface::activatedService(),
                                                   QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/remotecontrol"),
                                                   QDBusConnection::sessionBus(),
                                                   parent)
{
}
Constructs a remote control interface object. The object is created in the DBus context and the parent object is set to the parent object.
RemoteControlDbusInterface::~RemoteControlDbusInterface()
{
}
This removes the interface from the list of interfaces.
LockDeviceDbusInterface::LockDeviceDbusInterface(const QString &id, QObject *parent)
    : OrgKdeKdeconnectDeviceLockdeviceInterface(DaemonDbusInterface::activatedService(),
                                                QStringLiteral("/modules/kdeconnect/devices/") + id + QStringLiteral("/lockdevice"),
                                                QDBusConnection::sessionBus(),
                                                parent)
{
    connect(this, &OrgKdeKdeconnectDeviceLockdeviceInterface::lockedChanged, this, &LockDeviceDbusInterface::lockedChangedProxy);
    Q_ASSERT(isValid());
}
This constructor builds a lockdevice object from an id, and connects to the lockedChangedProxy signal.
LockDeviceDbusInterface::~LockDeviceDbusInterface()
{
}
This locks the device for the purpose of being synchronized.
FindMyPhoneDeviceDbusInterface::FindMyPhoneDeviceDbusInterface(const QString &deviceId, QObject *parent)
    : OrgKdeKdeconnectDeviceFindmyphoneInterface(DaemonDbusInterface::activatedService(),
                                                 QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/findmyphone"),
                                                 QDBusConnection::sessionBus(),
                                                 parent)
{
}
This constructs a QObject of the type OrgKdeKdeconnectDeviceFindmyphoneInterface, and adds it to the given deviceId.
FindMyPhoneDeviceDbusInterface::~FindMyPhoneDeviceDbusInterface()
{
}
This implements the findMyPhoneDeviceDbusInterface method.
RemoteCommandsDbusInterface::RemoteCommandsDbusInterface(const QString &deviceId, QObject *parent)
    : OrgKdeKdeconnectDeviceRemotecommandsInterface(DaemonDbusInterface::activatedService(),
                                                    QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/remotecommands"),
                                                    QDBusConnection::sessionBus(),
                                                    parent)
{
}
Constructs a remote commands dbus interface.
RemoteCommandsDbusInterface::~RemoteCommandsDbusInterface() = default;
This removes the default implementation of the RemoteCommandsDbusInterface class from the list of supported connections.
RemoteKeyboardDbusInterface::RemoteKeyboardDbusInterface(const QString &deviceId, QObject *parent)
    : OrgKdeKdeconnectDeviceRemotekeyboardInterface(DaemonDbusInterface::activatedService(),
                                                    QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/remotekeyboard"),
                                                    QDBusConnection::sessionBus(),
                                                    parent)
{
    connect(this, &OrgKdeKdeconnectDeviceRemotekeyboardInterface::remoteStateChanged, this, &RemoteKeyboardDbusInterface::remoteStateChanged);
}
Constructs a new remote keyboard object in the DBus.
RemoteKeyboardDbusInterface::~RemoteKeyboardDbusInterface() = default;
Drops the remote keyboard interface on the dbus.
SmsDbusInterface::SmsDbusInterface(const QString &deviceId, QObject *parent)
    : OrgKdeKdeconnectDeviceSmsInterface(DaemonDbusInterface::activatedService(),
                                         QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/sms"),
                                         QDBusConnection::sessionBus(),
                                         parent)
{
}
Constructs an instance of the sms device type.
SmsDbusInterface::~SmsDbusInterface() = default;
This removes the SmsDbusInterface object from the list of supported interfaces.
ShareDbusInterface::ShareDbusInterface(const QString &deviceId, QObject *parent)
    : OrgKdeKdeconnectDeviceShareInterface(DaemonDbusInterface::activatedService(),
                                           QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/share"),
                                           QDBusConnection::sessionBus(),
                                           parent)
{
}
This share the device with the given deviceId using the DbusInterface. It takes the deviceId and the parent object, and creates a KdeKdeconnectDeviceShareInterface object. It takes the deviceId and parent QObject, which is a pointer to a QObject object.
ShareDbusInterface::~ShareDbusInterface() = default;
This removes the shareDbusInterface reference from the internal list of connections and sets the default behavior to none.
PhotoDbusInterface::PhotoDbusInterface(const QString& deviceId, QObject* parent):
    OrgKdeKdeconnectDevicePhotoInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/")  + deviceId + QStringLiteral("/photo"), QDBusConnection::sessionBus(), parent)
{
}
This creates a photo object in the DBus.
PhotoDbusInterface::~PhotoDbusInterface() = default;
This removes the default photoDbusInterface object from the database.
RemoteSystemVolumeDbusInterface::RemoteSystemVolumeDbusInterface(const QString& deviceId, QObject* parent):
    OrgKdeKdeconnectDeviceRemotesystemvolumeInterface(DaemonDbusInterface::activatedService(), QStringLiteral("/modules/kdeconnect/devices/")  + deviceId + QStringLiteral("/remotesystemvolume"), QDBusConnection::sessionBus(), parent)
{
}
Constructs a remote system volume interface by creating it with the given deviceId and parent object.
BigscreenDbusInterface::BigscreenDbusInterface(const QString &deviceId, QObject *parent)
    : OrgKdeKdeconnectDeviceBigscreenInterface(DaemonDbusInterface::activatedService(),
                                               QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/bigscreen"),
                                               QDBusConnection::sessionBus(),
                                               parent)
{
}
Constructs a new instance of the BigscreenDbusInterface class. The device id is the id of the device and the bigscreen path is the relative path to the device file, and the parent object is the parent object.
BigscreenDbusInterface::~BigscreenDbusInterface()
{
}
This implements the interface to be used by the BigscreenDbus daemon.
VirtualmonitorDbusInterface::VirtualmonitorDbusInterface(const QString &deviceId, QObject *parent)
    : OrgKdeKdeconnectDeviceVirtualmonitorInterface(DaemonDbusInterface::activatedService(),
                                                    QStringLiteral("/modules/kdeconnect/devices/") + deviceId + QStringLiteral("/virtualmonitor"),
                                                    QDBusConnection::sessionBus(),
                                                    parent)
{
}
Constructs a new instance of the Virtualmonitor class.
VirtualmonitorDbusInterface::~VirtualmonitorDbusInterface()
{
}
This removes the virtual monitor object from the dbus.