[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdelibs/frameworks] tier1/solid/src/solid: Support for keyboards and pointers in udev backend
From: Ivan Čukić <ivan.cukic () kde ! org>
Date: 2013-08-29 10:14:08
Message-ID: E1VEzEu-0008C6-7I () scm ! kde ! org
[Download RAW message or body]
Git commit ddb93304e28b8f4c85cf1aefae7c27335f9bf959 by Ivan Čukić.
Committed on 29/08/2013 at 10:12.
Pushed by ivan into branch 'frameworks'.
Support for keyboards and pointers in udev backend
This patch adds the support (to solid and udev backend) for:
- keyboards
- pointer (mice, graphics tablets, touchpads and touch-screens)
REVIEW:111918
M +9 -1 tier1/solid/src/solid/CMakeLists.txt
M +8 -0 tier1/solid/src/solid/backends/fakehw/fakedevice.cpp
A +45 -0 tier1/solid/src/solid/backends/fakehw/fakekeyboard.cpp [License: \
LGPL] A +52 -0 tier1/solid/src/solid/backends/fakehw/fakekeyboard.h \
[License: LGPL] A +61 -0 \
tier1/solid/src/solid/backends/fakehw/fakepointingdevice.cpp [License: LGPL] A \
+50 -0 tier1/solid/src/solid/backends/fakehw/fakepointingdevice.h [License: \
LGPL] M +4 -0 tier1/solid/src/solid/backends/hal/haldevice.cpp
M +6 -0 tier1/solid/src/solid/backends/hal/haldeviceinterface.h
M +17 -0 tier1/solid/src/solid/backends/udev/udevdevice.cpp
A +47 -0 tier1/solid/src/solid/backends/udev/udevkeyboard.cpp [License: \
LGPL] A +53 -0 tier1/solid/src/solid/backends/udev/udevkeyboard.h [License: \
LGPL] M +13 -1 tier1/solid/src/solid/backends/udev/udevmanager.cpp
A +48 -0 tier1/solid/src/solid/backends/udev/udevpointingdevice.cpp \
[License: LGPL] A +51 -0 \
tier1/solid/src/solid/backends/udev/udevpointingdevice.h [License: LGPL] M +6 \
-0 tier1/solid/src/solid/backends/udisks/udisksdeviceinterface.h M +6 -0 \
tier1/solid/src/solid/backends/upower/upowerdeviceinterface.h M +10 -0 \
tier1/solid/src/solid/device.cpp M +4 -0 \
tier1/solid/src/solid/deviceinterface.cpp M +4 -1 \
tier1/solid/src/solid/deviceinterface.h A +26 -0 \
tier1/solid/src/solid/ifaces/keyboard.cpp [License: LGPL] A +63 -0 \
tier1/solid/src/solid/ifaces/keyboard.h [License: LGPL] A +26 -0 \
tier1/solid/src/solid/ifaces/pointingdevice.cpp [License: LGPL] A +60 -0 \
tier1/solid/src/solid/ifaces/pointingdevice.h [License: LGPL] A +48 -0 \
tier1/solid/src/solid/keyboard.cpp [License: LGPL] A +88 -0 \
tier1/solid/src/solid/keyboard.h [License: LGPL] A +36 -0 \
tier1/solid/src/solid/keyboard_p.h [License: LGPL] A +42 -0 \
tier1/solid/src/solid/pointingdevice.cpp [License: LGPL] A +98 -0 \
tier1/solid/src/solid/pointingdevice.h [License: LGPL] A +36 -0 \
tier1/solid/src/solid/pointingdevice_p.h [License: LGPL]
http://commits.kde.org/kdelibs/ddb93304e28b8f4c85cf1aefae7c27335f9bf959
diff --git a/tier1/solid/src/solid/CMakeLists.txt \
b/tier1/solid/src/solid/CMakeLists.txt index 9079e58..19de4af 100644
--- a/tier1/solid/src/solid/CMakeLists.txt
+++ b/tier1/solid/src/solid/CMakeLists.txt
@@ -75,6 +75,8 @@ set(solid_LIB_SRCS
acadapter.cpp
battery.cpp
button.cpp
+ keyboard.cpp
+ pointingdevice.cpp
audiointerface.cpp
dvbinterface.cpp
predicate.cpp
@@ -91,6 +93,8 @@ set(solid_LIB_SRCS
ifaces/battery.cpp
ifaces/block.cpp
ifaces/button.cpp
+ ifaces/keyboard.cpp
+ ifaces/pointingdevice.cpp
ifaces/camera.cpp
ifaces/opticaldrive.cpp
ifaces/device.cpp
@@ -116,6 +120,8 @@ set(solid_LIB_SRCS
backends/fakehw/fakebattery.cpp
backends/fakehw/fakeblock.cpp
backends/fakehw/fakebutton.cpp
+ backends/fakehw/fakekeyboard.cpp
+ backends/fakehw/fakepointingdevice.cpp
backends/fakehw/fakecamera.cpp
backends/fakehw/fakecdrom.cpp
backends/fakehw/fakedevice.cpp
@@ -197,6 +203,8 @@ if(NOT WIN32 AND NOT APPLE)
backends/udev/udevdvbinterface.cpp
backends/udev/udevblock.cpp
backends/udev/udevbutton.cpp
+ backends/udev/udevkeyboard.cpp
+ backends/udev/udevpointingdevice.cpp
backends/shared/udevqtclient.cpp
backends/shared/udevqtdevice.cpp
)
@@ -480,7 +488,7 @@ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/solid_export.h \
solidnamespace.h devic
camera.h portablemediaplayer.h networkinterface.h acadapter.h \
battery.h
button.h audiointerface.h dvbinterface.h predicate.h \
powermanagement.h
networking.h video.h serialinterface.h smartcardreader.h \
internetgateway.h
- networkshare.h
+ networkshare.h keyboard.h pointingdevice.h
DESTINATION ${INCLUDE_INSTALL_DIR}/solid COMPONENT Devel)
########### parser build ###############
diff --git a/tier1/solid/src/solid/backends/fakehw/fakedevice.cpp \
b/tier1/solid/src/solid/backends/fakehw/fakedevice.cpp index e1a386a..9e9d2da 100644
--- a/tier1/solid/src/solid/backends/fakehw/fakedevice.cpp
+++ b/tier1/solid/src/solid/backends/fakehw/fakedevice.cpp
@@ -38,6 +38,8 @@
#include "fakeaudiointerface.h"
#include "fakedvbinterface.h"
#include "fakesmartcardreader.h"
+#include "fakekeyboard.h"
+#include "fakepointingdevice.h"
#include <QtCore/QStringList>
#include <QtDBus/QDBusConnection>
@@ -321,6 +323,12 @@ QObject *FakeDevice::createDeviceInterface(const \
Solid::DeviceInterface::Type &t case Solid::DeviceInterface::NetworkShare:
iface = new FakeNetworkShare(this);
break;
+ case Solid::DeviceInterface::Keyboard:
+ iface = new FakeKeyboard(this);
+ break;
+ case Solid::DeviceInterface::PointingDevice:
+ iface = new FakePointingDevice(this);
+ break;
case Solid::DeviceInterface::Unknown:
break;
case Solid::DeviceInterface::Last:
diff --git a/tier1/solid/src/solid/backends/fakehw/fakekeyboard.cpp \
b/tier1/solid/src/solid/backends/fakehw/fakekeyboard.cpp new file mode 100644
index 0000000..c231265
--- /dev/null
+++ b/tier1/solid/src/solid/backends/fakehw/fakekeyboard.cpp
@@ -0,0 +1,45 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "fakekeyboard.h"
+
+using namespace Solid::Backends::Fake;
+
+FakeKeyboard::FakeKeyboard(FakeDevice *device)
+ : FakeDeviceInterface(device)
+{
+
+}
+
+FakeKeyboard::~FakeKeyboard()
+{
+
+}
+
+QString FakeKeyboard::layout() const
+{
+ return QString::fromLatin1("us");
+}
+
+QString FakeKeyboard::model() const
+{
+ return QString::fromLatin1("pc105");
+}
+
diff --git a/tier1/solid/src/solid/backends/fakehw/fakekeyboard.h \
b/tier1/solid/src/solid/backends/fakehw/fakekeyboard.h new file mode 100644
index 0000000..93ae647
--- /dev/null
+++ b/tier1/solid/src/solid/backends/fakehw/fakekeyboard.h
@@ -0,0 +1,52 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef SOLID_BACKENDS_FAKEHW_FAKEKEYBOARD_H
+#define SOLID_BACKENDS_FAKEHW_FAKEKEYBOARD_H
+
+#include "fakedeviceinterface.h"
+#include <solid/ifaces/keyboard.h>
+
+namespace Solid
+{
+namespace Backends
+{
+namespace Fake
+{
+class FakeKeyboard : public FakeDeviceInterface, virtual public \
Solid::Ifaces::Keyboard +{
+ Q_OBJECT
+ Q_INTERFACES(Solid::Ifaces::Keyboard)
+
+public:
+ explicit FakeKeyboard(FakeDevice *device);
+ ~FakeKeyboard();
+
+public Q_SLOTS:
+ QString layout() const;
+ QString model() const;
+
+
+};
+}
+}
+}
+
+#endif // SOLID_BACKENDS_FAKEHW_FAKEKEYBOARD_H
diff --git a/tier1/solid/src/solid/backends/fakehw/fakepointingdevice.cpp \
b/tier1/solid/src/solid/backends/fakehw/fakepointingdevice.cpp new file mode 100644
index 0000000..71801af
--- /dev/null
+++ b/tier1/solid/src/solid/backends/fakehw/fakepointingdevice.cpp
@@ -0,0 +1,61 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "fakepointingdevice.h"
+
+using namespace Solid::Backends::Fake;
+
+FakePointingDevice::FakePointingDevice(FakeDevice *device)
+ : FakeDeviceInterface(device)
+{
+
+}
+
+FakePointingDevice::~FakePointingDevice()
+{
+
+}
+
+Solid::PointingDevice::PointingDeviceType FakePointingDevice::type() const
+{
+ QString pointingDeviceType = fakeDevice()->property("type").toString();
+
+ if (pointingDeviceType==QLatin1String("Mouse"))
+ {
+ return Solid::PointingDevice::Mouse;
+ }
+ else if (pointingDeviceType==QLatin1String("Touchpad"))
+ {
+ return Solid::PointingDevice::Touchpad;
+ }
+ else if (pointingDeviceType==QLatin1String("Touchscreen"))
+ {
+ return Solid::PointingDevice::Touchscreen;
+ }
+ else if (pointingDeviceType==QLatin1String("Tablet"))
+ {
+ return Solid::PointingDevice::Tablet;
+ }
+ else
+ {
+ return Solid::PointingDevice::UnknownPointingDeviceType;
+ }
+}
+
diff --git a/tier1/solid/src/solid/backends/fakehw/fakepointingdevice.h \
b/tier1/solid/src/solid/backends/fakehw/fakepointingdevice.h new file mode 100644
index 0000000..d194e89
--- /dev/null
+++ b/tier1/solid/src/solid/backends/fakehw/fakepointingdevice.h
@@ -0,0 +1,50 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef SOLID_BACKENDS_FAKEHW_POINTING_DEVICE_H
+#define SOLID_BACKENDS_FAKEHW_POINTING_DEVICE_H
+
+#include "fakedeviceinterface.h"
+#include <solid/ifaces/pointingdevice.h>
+
+namespace Solid
+{
+namespace Backends
+{
+namespace Fake
+{
+class FakePointingDevice : public FakeDeviceInterface, virtual public \
Solid::Ifaces::PointingDevice +{
+ Q_OBJECT
+ Q_INTERFACES(Solid::Ifaces::PointingDevice)
+
+public:
+ explicit FakePointingDevice(FakeDevice *device);
+ ~FakePointingDevice();
+
+public Q_SLOTS:
+ virtual Solid::PointingDevice::PointingDeviceType type() const;
+
+};
+}
+}
+}
+
+#endif // SOLID_BACKENDS_FAKEHW_POINTING_DEVICE_H
diff --git a/tier1/solid/src/solid/backends/hal/haldevice.cpp \
b/tier1/solid/src/solid/backends/hal/haldevice.cpp index d1e48fb..2369b2a 100644
--- a/tier1/solid/src/solid/backends/hal/haldevice.cpp
+++ b/tier1/solid/src/solid/backends/hal/haldevice.cpp
@@ -515,6 +515,10 @@ QObject *HalDevice::createDeviceInterface(const \
Solid::DeviceInterface::Type &ty break;
case Solid::DeviceInterface::NetworkShare:
break;
+ case Solid::DeviceInterface::Keyboard:
+ break;
+ case Solid::DeviceInterface::PointingDevice:
+ break;
case Solid::DeviceInterface::Unknown:
case Solid::DeviceInterface::Last:
break;
diff --git a/tier1/solid/src/solid/backends/hal/haldeviceinterface.h \
b/tier1/solid/src/solid/backends/hal/haldeviceinterface.h index 1d70187..e827c5d \
100644
--- a/tier1/solid/src/solid/backends/hal/haldeviceinterface.h
+++ b/tier1/solid/src/solid/backends/hal/haldeviceinterface.h
@@ -113,6 +113,12 @@ public:
case Solid::DeviceInterface::NetworkShare:
list << "networkshare";
break;
+ case Solid::DeviceInterface::Keyboard:
+ // Is not supported by HAL backaned
+ break;
+ case Solid::DeviceInterface::PointingDevice:
+ // Is not supported by HAL backaned
+ break;
case Solid::DeviceInterface::Unknown:
break;
case Solid::DeviceInterface::Last:
diff --git a/tier1/solid/src/solid/backends/udev/udevdevice.cpp \
b/tier1/solid/src/solid/backends/udev/udevdevice.cpp index 8e5f9e9..6ebb788 100644
--- a/tier1/solid/src/solid/backends/udev/udevdevice.cpp
+++ b/tier1/solid/src/solid/backends/udev/udevdevice.cpp
@@ -31,6 +31,8 @@
#include "udevserialinterface.h"
#include "udevnetworkinterface.h"
#include "udevbutton.h"
+#include "udevkeyboard.h"
+#include "udevpointingdevice.h"
#include "cpuinfo.h"
#include <sys/socket.h>
@@ -235,6 +237,15 @@ bool UDevDevice::queryDeviceInterface(const \
Solid::DeviceInterface::Type &type) case Solid::DeviceInterface::Button:
return m_device.subsystem() == QLatin1String("input");
+ case Solid::DeviceInterface::Keyboard:
+ return m_device.deviceProperty("ID_INPUT_KEYBOARD").toInt() == 1;
+
+ case Solid::DeviceInterface::PointingDevice:
+ return m_device.deviceProperty("ID_INPUT_MOUSE").toInt() == 1 ||
+ m_device.deviceProperty("ID_INPUT_TOUCHPAD").toInt() == 1 ||
+ m_device.deviceProperty("ID_INPUT_TABLET").toInt() == 1 ||
+ m_device.deviceProperty("ID_INPUT_TOUCHSCREEN").toInt() == 1;
+
default:
return false;
}
@@ -280,6 +291,12 @@ QObject *UDevDevice::createDeviceInterface(const \
Solid::DeviceInterface::Type &t case Solid::DeviceInterface::Button:
return new Button(this);
+ case Solid::DeviceInterface::Keyboard:
+ return new Keyboard(this);
+
+ case Solid::DeviceInterface::PointingDevice:
+ return new PointingDevice(this);
+
default:
qFatal("Shouldn't happen");
return 0;
diff --git a/tier1/solid/src/solid/backends/udev/udevkeyboard.cpp \
b/tier1/solid/src/solid/backends/udev/udevkeyboard.cpp new file mode 100644
index 0000000..032a028
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udev/udevkeyboard.cpp
@@ -0,0 +1,47 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "udevkeyboard.h"
+
+using namespace Solid::Backends::UDev;
+
+Keyboard::Keyboard(UDevDevice *device)
+ : DeviceInterface(device)
+ , m_model(device->property("XKBMODEL").toString())
+ , m_layout(device->property("XKBLAYOUT").toString())
+{
+
+}
+
+Keyboard::~Keyboard()
+{
+
+}
+
+QString Keyboard::model() const
+{
+ return m_model;
+}
+
+QString Keyboard::layout() const
+{
+ return m_layout;
+}
+
diff --git a/tier1/solid/src/solid/backends/udev/udevkeyboard.h \
b/tier1/solid/src/solid/backends/udev/udevkeyboard.h new file mode 100644
index 0000000..885ff56
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udev/udevkeyboard.h
@@ -0,0 +1,53 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef SOLID_BACKENDS_UDEV_KEYBOARD_H
+#define SOLID_BACKENDS_UDEV_KEYBOARD_H
+
+#include <solid/ifaces/keyboard.h>
+#include "udevdeviceinterface.h"
+
+namespace Solid
+{
+namespace Backends
+{
+namespace UDev
+{
+class Keyboard : public DeviceInterface, virtual public Solid::Ifaces::Keyboard
+{
+ Q_OBJECT
+ Q_INTERFACES(Solid::Ifaces::Keyboard)
+
+public:
+ Keyboard(UDevDevice *device);
+ virtual ~Keyboard();
+
+ virtual QString model() const;
+ virtual QString layout() const;
+
+private:
+ QString m_model;
+ QString m_layout;
+};
+}
+}
+}
+
+#endif
diff --git a/tier1/solid/src/solid/backends/udev/udevmanager.cpp \
b/tier1/solid/src/solid/backends/udev/udevmanager.cpp index 57cc2bc..9be3770 100644
--- a/tier1/solid/src/solid/backends/udev/udevmanager.cpp
+++ b/tier1/solid/src/solid/backends/udev/udevmanager.cpp
@@ -123,6 +123,14 @@ bool UDevManager::Private::checkOfInterest(const UdevQt::Device \
&device) if (device.deviceProperties().contains("SW")) {
return isLidBubtton(device);
}
+ if (device.deviceProperty("ID_INPUT_KEYBOARD").toInt() == 1 ||
+ device.deviceProperty("ID_INPUT_MOUSE").toInt() == 1 ||
+ device.deviceProperty("ID_INPUT_TOUCHPAD").toInt() == 1 ||
+ device.deviceProperty("ID_INPUT_TABLET").toInt() == 1 ||
+ device.deviceProperty("ID_INPUT_TOUCHSCREEN").toInt() == 1) {
+ return true;
+ }
+
}
return device.subsystem() == QLatin1String("dvb") ||
@@ -177,7 +185,10 @@ UDevManager::UDevManager(QObject *parent)
<< Solid::DeviceInterface::DvbInterface
<< Solid::DeviceInterface::Block
<< Solid::DeviceInterface::Video
- << Solid::DeviceInterface::Button;
+ << Solid::DeviceInterface::Button
+ << Solid::DeviceInterface::Keyboard
+ << Solid::DeviceInterface::PointingDevice
+ ;
}
UDevManager::~UDevManager()
@@ -243,6 +254,7 @@ QObject *UDevManager::createDevice(const QString &udi_)
device->setProduct(tr("Devices"));
device->setDescription(tr("Devices declared in your system"));
device->setIcon("computer");
+
return device;
}
diff --git a/tier1/solid/src/solid/backends/udev/udevpointingdevice.cpp \
b/tier1/solid/src/solid/backends/udev/udevpointingdevice.cpp new file mode 100644
index 0000000..d5bd9d6
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udev/udevpointingdevice.cpp
@@ -0,0 +1,48 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "udevpointingdevice.h"
+
+#include <QDebug>
+
+using namespace Solid::Backends::UDev;
+
+PointingDevice::PointingDevice(UDevDevice *device)
+ : DeviceInterface(device)
+ , m_type(
+ device->property("ID_INPUT_MOUSE").toInt() == 1 ? \
Solid::PointingDevice::Mouse : + \
device->property("ID_INPUT_TOUCHPAD").toInt() == 1 ? \
Solid::PointingDevice::Touchpad : + \
device->property("ID_INPUT_TABLET").toInt() == 1 ? Solid::PointingDevice::Tablet \
: + device->property("ID_INPUT_TOUCHSCREEN").toInt() == 1 ? \
Solid::PointingDevice::Touchscreen : + \
Solid::PointingDevice::UnknownPointingDeviceType + )
+{
+}
+
+PointingDevice::~PointingDevice()
+{
+
+}
+
+Solid::PointingDevice::PointingDeviceType PointingDevice::type() const
+{
+ return m_type;
+}
+
diff --git a/tier1/solid/src/solid/backends/udev/udevpointingdevice.h \
b/tier1/solid/src/solid/backends/udev/udevpointingdevice.h new file mode 100644
index 0000000..bbd412e
--- /dev/null
+++ b/tier1/solid/src/solid/backends/udev/udevpointingdevice.h
@@ -0,0 +1,51 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef SOLID_BACKENDS_UDEV_POINTING_DEVICE_H
+#define SOLID_BACKENDS_UDEV_POINTING_DEVICE_H
+
+#include <solid/ifaces/pointingdevice.h>
+#include "udevdeviceinterface.h"
+
+namespace Solid
+{
+namespace Backends
+{
+namespace UDev
+{
+class PointingDevice : public DeviceInterface, virtual public \
Solid::Ifaces::PointingDevice +{
+ Q_OBJECT
+ Q_INTERFACES(Solid::Ifaces::PointingDevice)
+
+public:
+ PointingDevice(UDevDevice *device);
+ virtual ~PointingDevice();
+
+ virtual Solid::PointingDevice::PointingDeviceType type() const;
+
+private:
+ Solid::PointingDevice::PointingDeviceType m_type;
+};
+}
+}
+}
+
+#endif
diff --git a/tier1/solid/src/solid/backends/udisks/udisksdeviceinterface.h \
b/tier1/solid/src/solid/backends/udisks/udisksdeviceinterface.h index \
004732c..5a47391 100644
--- a/tier1/solid/src/solid/backends/udisks/udisksdeviceinterface.h
+++ b/tier1/solid/src/solid/backends/udisks/udisksdeviceinterface.h
@@ -113,6 +113,12 @@ public:
case Solid::DeviceInterface::NetworkShare:
// Doesn't exist with UDisks
break;
+ case Solid::DeviceInterface::Keyboard:
+ // Doesn't exist with UDisks
+ break;
+ case Solid::DeviceInterface::PointingDevice:
+ // Doesn't exist with UDisks
+ break;
case Solid::DeviceInterface::Unknown:
break;
case Solid::DeviceInterface::Last:
diff --git a/tier1/solid/src/solid/backends/upower/upowerdeviceinterface.h \
b/tier1/solid/src/solid/backends/upower/upowerdeviceinterface.h index \
8c6fe5e..2fa682b 100644
--- a/tier1/solid/src/solid/backends/upower/upowerdeviceinterface.h
+++ b/tier1/solid/src/solid/backends/upower/upowerdeviceinterface.h
@@ -116,6 +116,12 @@ public:
case Solid::DeviceInterface::NetworkShare:
// Doesn't exist with UPower
break;
+ case Solid::DeviceInterface::Keyboard:
+ // Doesn't exist with UPower
+ break;
+ case Solid::DeviceInterface::PointingDevice:
+ // Doesn't exist with UPower
+ break;
case Solid::DeviceInterface::Unknown:
break;
case Solid::DeviceInterface::Last:
diff --git a/tier1/solid/src/solid/device.cpp b/tier1/solid/src/solid/device.cpp
index d9f3c6d..23c380b 100644
--- a/tier1/solid/src/solid/device.cpp
+++ b/tier1/solid/src/solid/device.cpp
@@ -58,6 +58,10 @@
#include <solid/ifaces/battery.h>
#include <solid/button.h>
#include <solid/ifaces/button.h>
+#include <solid/keyboard.h>
+#include <solid/ifaces/keyboard.h>
+#include <solid/pointingdevice.h>
+#include <solid/ifaces/pointingdevice.h>
#include <solid/audiointerface.h>
#include <solid/ifaces/audiointerface.h>
#include <solid/dvbinterface.h>
@@ -243,6 +247,12 @@ const Solid::DeviceInterface \
*Solid::Device::asDeviceInterface(const DeviceInter case \
DeviceInterface::NetworkShare:
iface = deviceinterface_cast(Ifaces::NetworkShare, NetworkShare, \
dev_iface); break;
+ case DeviceInterface::Keyboard:
+ iface = deviceinterface_cast(Ifaces::Keyboard, Keyboard, dev_iface);
+ break;
+ case DeviceInterface::PointingDevice:
+ iface = deviceinterface_cast(Ifaces::PointingDevice, PointingDevice, \
dev_iface); + break;
case DeviceInterface::Unknown:
case DeviceInterface::Last:
break;
diff --git a/tier1/solid/src/solid/deviceinterface.cpp \
b/tier1/solid/src/solid/deviceinterface.cpp index 2cbd777..60d034e 100644
--- a/tier1/solid/src/solid/deviceinterface.cpp
+++ b/tier1/solid/src/solid/deviceinterface.cpp
@@ -109,6 +109,10 @@ QString Solid::DeviceInterface::typeDescription(Type type)
return tr("Internet Gateway Device", "Internet Gateway device type");
case NetworkShare:
return tr("Network Share", "Network Share device type");
+ case Keyboard:
+ return tr("Keyboard", "A keyboard");
+ case PointingDevice:
+ return tr("PointingDevice", "A pointing device");
case Last:
return QString();
}
diff --git a/tier1/solid/src/solid/deviceinterface.h \
b/tier1/solid/src/solid/deviceinterface.h index c94ebbd..43b637d 100644
--- a/tier1/solid/src/solid/deviceinterface.h
+++ b/tier1/solid/src/solid/deviceinterface.h
@@ -63,6 +63,8 @@ namespace Solid
* - SerialInterface: A serial interface
* - SmartCardReader: A smart card reader interface
* - NetworkShare: A network share interface
+ * - Keyboard: A keyboard
+ * - PointingDevice: A mouse, touchpad, touchscreen or a tablet
*/
enum Type { Unknown = 0, GenericInterface = 1, Processor = 2,
Block = 3, StorageAccess = 4, StorageDrive = 5,
@@ -71,7 +73,8 @@ namespace Solid
NetworkInterface = 11, AcAdapter = 12, Battery = 13,
Button = 14, AudioInterface = 15, DvbInterface = 16, Video = 17,
SerialInterface = 18, SmartCardReader = 19, InternetGateway = \
20,
- NetworkShare = 21, Last = 0xffff };
+ NetworkShare = 21, Keyboard = 22, PointingDevice = 23,
+ Last = 0xffff };
/**
* Destroys a DeviceInterface object.
diff --git a/tier1/solid/src/solid/ifaces/keyboard.cpp \
b/tier1/solid/src/solid/ifaces/keyboard.cpp new file mode 100644
index 0000000..942df6d
--- /dev/null
+++ b/tier1/solid/src/solid/ifaces/keyboard.cpp
@@ -0,0 +1,26 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "keyboard.h"
+
+Solid::Ifaces::Keyboard::~Keyboard()
+{
+
+}
diff --git a/tier1/solid/src/solid/ifaces/keyboard.h \
b/tier1/solid/src/solid/ifaces/keyboard.h new file mode 100644
index 0000000..ea96a9b
--- /dev/null
+++ b/tier1/solid/src/solid/ifaces/keyboard.h
@@ -0,0 +1,63 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef SOLID_IFACES_KEYBOARD_H
+#define SOLID_IFACES_KEYBOARD_H
+
+#include <solid/ifaces/deviceinterface.h>
+
+namespace Solid
+{
+namespace Ifaces
+{
+ /**
+ * This device interface is available on keyboards.
+ *
+ * A keyboard is an input device.
+ *
+ * @author Ivan Cukic <ivan.cukic@kde.org>
+ */
+ class Keyboard : virtual public DeviceInterface
+ {
+ public:
+ /**
+ * Destroys a Keyboard object.
+ */
+ virtual ~Keyboard();
+
+ /**
+ * Retrieves the model of the keyboard (for example 'pc105')
+ * @return the keyboard model
+ */
+ virtual QString model() const = 0;
+
+ /**
+ * Retrieves the layout of the keyboard (for example 'us')
+ * @return the layout of the keyboard
+ */
+ virtual QString layout() const = 0;
+
+ };
+}
+}
+
+Q_DECLARE_INTERFACE(Solid::Ifaces::Keyboard, "org.kde.Solid.Ifaces.Keyboard/0.1")
+
+#endif
diff --git a/tier1/solid/src/solid/ifaces/pointingdevice.cpp \
b/tier1/solid/src/solid/ifaces/pointingdevice.cpp new file mode 100644
index 0000000..c60145e
--- /dev/null
+++ b/tier1/solid/src/solid/ifaces/pointingdevice.cpp
@@ -0,0 +1,26 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "pointingdevice.h"
+
+Solid::Ifaces::PointingDevice::~PointingDevice()
+{
+
+}
diff --git a/tier1/solid/src/solid/ifaces/pointingdevice.h \
b/tier1/solid/src/solid/ifaces/pointingdevice.h new file mode 100644
index 0000000..a3736f5
--- /dev/null
+++ b/tier1/solid/src/solid/ifaces/pointingdevice.h
@@ -0,0 +1,60 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef SOLID_IFACES_POINTING_DEVICE_H
+#define SOLID_IFACES_POINTING_DEVICE_H
+
+#include <solid/ifaces/deviceinterface.h>
+#include <solid/pointingdevice.h>
+
+namespace Solid
+{
+namespace Ifaces
+{
+ /**
+ * This device interface is available on pointing devices
+ *
+ * PointingDevice are input devices such as mice, touchpads,
+ * touch screens and tablets (graphics tablets).
+ *
+ * @author Ivan Cukic <ivan.cukic@kde.org>
+ */
+ class PointingDevice : virtual public DeviceInterface
+ {
+ public:
+ /**
+ * Destroys a PointingDevice object.
+ */
+ virtual ~PointingDevice();
+
+ /**
+ * Retrieves the type of the pointing device.
+ *
+ * @return the type of the pointing device.
+ * @see Solid::PointingDevice::PointingDeviceType
+ */
+ virtual Solid::PointingDevice::PointingDeviceType type() const = 0;
+ };
+}
+}
+
+Q_DECLARE_INTERFACE(Solid::Ifaces::PointingDevice, \
"org.kde.Solid.Ifaces.PointingDevice/0.1") +
+#endif
diff --git a/tier1/solid/src/solid/keyboard.cpp b/tier1/solid/src/solid/keyboard.cpp
new file mode 100644
index 0000000..088a8dd
--- /dev/null
+++ b/tier1/solid/src/solid/keyboard.cpp
@@ -0,0 +1,48 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "keyboard.h"
+#include "keyboard_p.h"
+
+#include "soliddefs_p.h"
+#include <solid/ifaces/keyboard.h>
+
+Solid::Keyboard::Keyboard(QObject *backendObject)
+ : DeviceInterface(*new KeyboardPrivate(), backendObject)
+{
+}
+
+Solid::Keyboard::~Keyboard()
+{
+
+}
+
+QString Solid::Keyboard::layout() const
+{
+ Q_D(const Keyboard);
+ return_SOLID_CALL(Ifaces::Keyboard *, d->backendObject(), QString(), layout());
+}
+
+QString Solid::Keyboard::model() const
+{
+ Q_D(const Keyboard);
+ return_SOLID_CALL(Ifaces::Keyboard *, d->backendObject(), QString(), model());
+}
+
diff --git a/tier1/solid/src/solid/keyboard.h b/tier1/solid/src/solid/keyboard.h
new file mode 100644
index 0000000..1f6c985
--- /dev/null
+++ b/tier1/solid/src/solid/keyboard.h
@@ -0,0 +1,88 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef SOLID_KEYBOARD_H
+#define SOLID_KEYBOARD_H
+
+#include <solid/solid_export.h>
+
+#include <solid/deviceinterface.h>
+
+namespace Solid
+{
+ class KeyboardPrivate;
+ class Device;
+
+ /**
+ * This device interface is available on keyboards.
+ *
+ * A keyboard is an input device.
+ *
+ * @author Ivan Cukic <ivan.cukic@kde.org>
+ */
+ class SOLID_EXPORT Keyboard : public DeviceInterface
+ {
+ Q_OBJECT
+ Q_PROPERTY(QString model READ model CONSTANT)
+ Q_PROPERTY(QString layout READ layout CONSTANT)
+ Q_DECLARE_PRIVATE(Keyboard)
+ friend class Device;
+
+ private:
+ /**
+ * Creates a new Keyboard object.
+ * You generally won't need this. It's created when necessary using
+ * Device::as().
+ *
+ * @param backendObject the device interface object provided by the backend
+ * @see Solid::Device::as()
+ */
+ explicit Keyboard(QObject *backendObject);
+
+ public:
+ /**
+ * Destroys a Keyboard object.
+ */
+ virtual ~Keyboard();
+
+ /**
+ * Get the Solid::DeviceInterface::Type of the Keyboard device interface.
+ *
+ * @return the Keyboard device interface type
+ * @see Solid::DeviceInterface::Type
+ */
+ static Type deviceInterfaceType() { return DeviceInterface::Keyboard; }
+
+ /**
+ * Retrieves the layout of the keyboard (for example 'us')
+ * @return the layout of the keyboard
+ */
+ QString layout() const;
+
+ /**
+ * Retrieves the model of the keyboard (for example 'pc105')
+ * @return the keyboard model
+ */
+ QString model() const;
+
+ };
+}
+
+#endif
diff --git a/tier1/solid/src/solid/keyboard_p.h b/tier1/solid/src/solid/keyboard_p.h
new file mode 100644
index 0000000..ff70cdc
--- /dev/null
+++ b/tier1/solid/src/solid/keyboard_p.h
@@ -0,0 +1,36 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef SOLID_KEYBOARD_P_H
+#define SOLID_KEYBOARD_P_H
+
+#include "deviceinterface_p.h"
+
+namespace Solid
+{
+ class KeyboardPrivate : public DeviceInterfacePrivate
+ {
+ public:
+ KeyboardPrivate()
+ : DeviceInterfacePrivate() { }
+ };
+}
+
+#endif
diff --git a/tier1/solid/src/solid/pointingdevice.cpp \
b/tier1/solid/src/solid/pointingdevice.cpp new file mode 100644
index 0000000..15cc483
--- /dev/null
+++ b/tier1/solid/src/solid/pointingdevice.cpp
@@ -0,0 +1,42 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "pointingdevice.h"
+#include "pointingdevice_p.h"
+
+#include "soliddefs_p.h"
+#include <solid/ifaces/pointingdevice.h>
+
+Solid::PointingDevice::PointingDevice(QObject *backendObject)
+ : DeviceInterface(*new PointingDevicePrivate(), backendObject)
+{
+}
+
+Solid::PointingDevice::~PointingDevice()
+{
+
+}
+
+Solid::PointingDevice::PointingDeviceType Solid::PointingDevice::type() const
+{
+ Q_D(const PointingDevice);
+ return_SOLID_CALL(Ifaces::PointingDevice *, d->backendObject(), \
UnknownPointingDeviceType, type()); +}
+
diff --git a/tier1/solid/src/solid/pointingdevice.h \
b/tier1/solid/src/solid/pointingdevice.h new file mode 100644
index 0000000..dc9013f
--- /dev/null
+++ b/tier1/solid/src/solid/pointingdevice.h
@@ -0,0 +1,98 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef SOLID_POINTING_DEVICE_H
+#define SOLID_POINTING_DEVICE_H
+
+#include <solid/solid_export.h>
+
+#include <solid/deviceinterface.h>
+
+namespace Solid
+{
+ class PointingDevicePrivate;
+ class Device;
+
+ /**
+ * This device interface is available on pointing devices.
+ *
+ * A pointing device is a device like a mouse, touchpad, touch
+ * screen or a tablet (graphics tablet).
+ *
+ * @author Ivan Cukic <ivan.cukic@kde.org>
+ */
+ class SOLID_EXPORT PointingDevice : public DeviceInterface
+ {
+ Q_OBJECT
+ Q_ENUMS(PointingDeviceType)
+ Q_PROPERTY(PointingDeviceType type READ type CONSTANT)
+ Q_DECLARE_PRIVATE(PointingDevice)
+ friend class Device;
+
+ public:
+ /**
+ * This enum type defines the type of a PointingDevice.
+ *
+ * - Mouse : A mouse
+ * - Touchpad : A touchpad
+ * - Touchscreen : The touchscreen input device
+ * - Tablet : A graphics tablet with a stylus
+ * - UnknownPointingDeviceType : The type of the pointing device is unknown.
+ */
+ enum PointingDeviceType{ Mouse, Touchpad, Touchscreen, Tablet, \
UnknownPointingDeviceType }; +
+
+ private:
+ /**
+ * Creates a new PointingDevice object.
+ * You generally won't need this. It's created when necessary using
+ * Device::as().
+ *
+ * @param backendObject the device interface object provided by the backend
+ * @see Solid::Device::as()
+ */
+ explicit PointingDevice(QObject *backendObject);
+
+ public:
+ /**
+ * Destroys a PointingDevice object.
+ */
+ virtual ~PointingDevice();
+
+ /**
+ * Get the Solid::DeviceInterface::Type of the pointing device interface.
+ *
+ * @return the pointing device interface type
+ * @see Solid::DeviceInterface::Type
+ */
+ static Type deviceInterfaceType() { return DeviceInterface::PointingDevice; \
} +
+ /**
+ * Retrieves the type of the pointing device.
+ *
+ * @return the type of the pointing device.
+ * @see Solid::PointingDevice::PointingDeviceType
+ */
+ PointingDeviceType type() const;
+
+ };
+}
+
+#endif
diff --git a/tier1/solid/src/solid/pointingdevice_p.h \
b/tier1/solid/src/solid/pointingdevice_p.h new file mode 100644
index 0000000..8f7b51a
--- /dev/null
+++ b/tier1/solid/src/solid/pointingdevice_p.h
@@ -0,0 +1,36 @@
+/*
+ Copyright 2013 Ivan Cukic <ivan.cukic@kde.org>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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 6 of version 3 of the license.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef SOLID_POINTING_DEVICE_P_H
+#define SOLID_POINTING_DEVICE_P_H
+
+#include "deviceinterface_p.h"
+
+namespace Solid
+{
+ class PointingDevicePrivate : public DeviceInterfacePrivate
+ {
+ public:
+ PointingDevicePrivate()
+ : DeviceInterfacePrivate() { }
+ };
+}
+
+#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic