1 /* This file is part of the KDE project
2 Copyright (C) 2007 Will Stephenson <wstephenson@kde.org>
3 Copyright (C) 2007 Daniel Gollub <dgollub@suse.de>
4 Copyright (C) 2008 Tom Patzig <tpatzig@suse.de>
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License version 2 as published by the Free Software Foundation.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
23 #include "bluez-bluetoothinputdevice.h"
29 BluezBluetoothInputDevice::BluezBluetoothInputDevice(const QString
&objectPath
) : BluetoothInputDevice(0), m_objectPath(objectPath
)
31 device
= new QDBusInterface("org.bluez", m_objectPath
,
32 "org.bluez.Input", QDBusConnection::systemBus());
33 #define connectInputDeviceToThis(signal, slot) \
34 device->connection().connect("org.bluez", \
37 signal, this, SLOT(slot))
38 connectInputDeviceToThis("PropertyChanged",slotPropertyChanged(const QString
&,const QDBusVariant
&));
42 BluezBluetoothInputDevice::~BluezBluetoothInputDevice()
47 QString
BluezBluetoothInputDevice::ubi() const
52 QMap
<QString
,QVariant
> BluezBluetoothInputDevice::getProperties() const
54 QDBusReply
< QMap
<QString
,QVariant
> > path
= device
->call("GetProperties");
56 return QMap
<QString
,QVariant
>();
61 void BluezBluetoothInputDevice::disconnect()
63 device
->call("Disconnect");
66 void BluezBluetoothInputDevice::connect()
68 device
->call("Connect");
72 /******************************/
74 QString
BluezBluetoothInputDevice::stringReply(const QString
&method
) const
76 QDBusReply
< QString
> reply
= device
->call(method
);
83 bool BluezBluetoothInputDevice::boolReply(const QString
&method
) const
85 QDBusReply
< bool > reply
= device
->call(method
);
92 /******************************/
94 void BluezBluetoothInputDevice::slotPropertyChanged(const QString
& name
, const QDBusVariant
& value
)
96 emit
propertyChanged(name
,value
.variant());
99 #include "bluez-bluetoothinputdevice.moc"