Hi,
Here is a new patch. I think that now is ready.
Can I commit this patch?
Bye,
Davide Bettio.
Index: kdehw/device.cpp
===================================================================
--- kdehw/device.cpp (revisione 524632)
+++ kdehw/device.cpp (copia locale)
@@ -36,6 +36,8 @@
#include <kdehw/ifaces/opticaldisc.h>
#include <kdehw/camera.h>
#include <kdehw/ifaces/camera.h>
+#include <kdehw/portablemediaplayer.h>
+#include <kdehw/ifaces/portablemediaplayer.h>
#include <kdehw/display.h>
#include <kdehw/ifaces/display.h>
@@ -270,6 +272,9 @@
case Capability::Camera:
iface = capability_cast<Ifaces::Camera, Camera>( cap_iface );
break;
+ case Capability::PortableMediaPlayer:
+ iface = capability_cast<Ifaces::PortableMediaPlayer, PortableMediaPlayer>( cap_iface );
+ break;
case Capability::Display:
iface = capability_cast<Ifaces::Display, Display>( cap_iface );
break;
Index: kdehw/predicate.cpp
===================================================================
--- kdehw/predicate.cpp (revisione 524632)
+++ kdehw/predicate.cpp (copia locale)
@@ -78,6 +78,7 @@
map["Volume"] = Capability::Volume;
map["OpticalDisc"] = Capability::OpticalDisc;
map["Camera"] = Capability::Camera;
+ map["PortableMediaPlayer"] = Capability::PortableMediaPlayer;
map["Display"] = Capability::Display;
if ( map.contains( capability ) )
@@ -215,6 +216,9 @@
case Capability::Camera:
capability = "Camera";
break;
+ case Capability::PortableMediaPlayer:
+ capability = "PortableMediaPlayer";
+ break;
case Capability::Display:
capability = "Display";
break;
Index: kdehw/ifaces/portablemediaplayer.cpp
===================================================================
--- kdehw/ifaces/portablemediaplayer.cpp (revisione 0)
+++ kdehw/ifaces/portablemediaplayer.cpp (revisione 0)
@@ -0,0 +1,25 @@
+/* This file is part of the KDE project
+ Copyright (C) 2006 Davide Bettio <[EMAIL PROTECTED]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+*/
+
+#include "portablemediaplayer.h"
+
+KDEHW::Ifaces::PortableMediaPlayer::~PortableMediaPlayer()
+{
+
+}
Index: kdehw/ifaces/Makefile.am
===================================================================
--- kdehw/ifaces/Makefile.am (revisione 524632)
+++ kdehw/ifaces/Makefile.am (copia locale)
@@ -4,9 +4,9 @@
libkdehwifaces_la_LIBADD = $(LIB_QTCORE)
libkdehwifaces_la_LDFLAGS = $(KDE_RPATH) -version-info 6:0:2 -no-undefined $(all_libraries)
-include_HEADERS = devicemanager.h device.h enums.h capability.h processor.h block.h storage.h cdrom.h volume.h opticaldisc.h camera.h display.h abstractcapability.h
+include_HEADERS = devicemanager.h device.h enums.h capability.h processor.h block.h storage.h cdrom.h volume.h opticaldisc.h camera.h portablemediaplayer.h display.h abstractcapability.h
METASOURCES = AUTO
-libkdehwifaces_la_SOURCES = devicemanager.cpp device.cpp capability.cpp processor.cpp block.cpp storage.cpp cdrom.cpp volume.cpp opticaldisc.cpp camera.cpp display.cpp abstractcapability.cpp
+libkdehwifaces_la_SOURCES = devicemanager.cpp device.cpp capability.cpp processor.cpp block.cpp storage.cpp cdrom.cpp volume.cpp opticaldisc.cpp camera.cpp portablemediaplayer.cpp display.cpp abstractcapability.cpp
Index: kdehw/ifaces/portablemediaplayer.h
===================================================================
--- kdehw/ifaces/portablemediaplayer.h (revisione 0)
+++ kdehw/ifaces/portablemediaplayer.h (revisione 0)
@@ -0,0 +1,49 @@
+/* This file is part of the KDE project
+ Copyright (C) 2006 Davide Bettio <[EMAIL PROTECTED]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef KDEHW_IFACES_PORTABLEMEDIAPLAYER_H
+#define KDEHW_IFACES_PORTABLEMEDIAPLAYER_H
+
+#include <kdehw/ifaces/capability.h>
+#include <kdehw/ifaces/enums.h>
+
+namespace KDEHW
+{
+namespace Ifaces
+{
+ class PortableMediaPlayer : virtual public Capability, public Enums::PortableMediaPlayer
+ {
+// Q_PROPERTY( AccessType accessMethod READ accessMethod )
+// Q_PROPERTY( QStringList outputFormats READ outputFormats )
+// Q_PROPERTY( QStringList inputFormats READ inputFormats )
+// Q_PROPERTY( QStringList playlistFormats READ playlistFormats )
+// Q_ENUMS( AccessType )
+
+ public:
+ virtual ~PortableMediaPlayer();
+
+ virtual AccessType accessMethod() const = 0;
+ virtual QStringList outputFormats() const = 0;
+ virtual QStringList inputFormats() const = 0;
+ virtual QStringList playlistFormats() const = 0;
+ };
+}
+}
+
+#endif
Index: kdehw/ifaces/enums.h
===================================================================
--- kdehw/ifaces/enums.h (revisione 524632)
+++ kdehw/ifaces/enums.h (copia locale)
@@ -64,12 +64,13 @@
* - Volume : A volume
* - OpticalDisc : An optical disc
* - Camera : A digital camera
+ * - PortableMediaPlayer: A portable media player
* - Display : A video display
*/
enum Type { Unknown = 0, Processor = 1, Block = 2,
Storage = 4, Cdrom = 8,
Volume = 16, OpticalDisc = 32,
- Camera = 64, Display = 128 };
+ Camera = 64, PortableMediaPlayer = 128, Display = 256 };
/**
* This type stores an OR combination of Type values.
@@ -220,6 +221,20 @@
enum AccessType { MassStorage, Ptp, Proprietary };
};
+ /**
+ * This struct holds the enumerations used by KDEHW::PortableMediaPlayer
+ * and KDEHW::Ifaces::PortableMediaPlayer. You shouldn't use it directly.
+ */
+ struct PortableMediaPlayer
+ {
+ /**
+ * This enum type defines the access method that can be used for a portable media player
+ *
+ * - MassStorage : A mass storage portable media player
+ * - Proprietary : A portable media player using a proprietary protocol
+ */
+ enum AccessType { MassStorage, Proprietary };
+ };
/**
* This struct holds the enumerations used by KDEHW::Display
Index: kdehw/portablemediaplayer.cpp
===================================================================
--- kdehw/portablemediaplayer.cpp (revisione 0)
+++ kdehw/portablemediaplayer.cpp (revisione 0)
@@ -0,0 +1,66 @@
+/* This file is part of the KDE project
+ Copyright (C) 2006 Davide Bettio <[EMAIL PROTECTED]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+*/
+
+#include "portablemediaplayer.h"
+
+#include <kdehw/ifaces/portablemediaplayer.h>
+
+namespace KDEHW
+{
+ class PortableMediaPlayer::Private
+ {
+ public:
+ Private() : iface( 0 ) {};
+
+ Ifaces::PortableMediaPlayer *iface;
+ };
+}
+
+KDEHW::PortableMediaPlayer::PortableMediaPlayer( Ifaces::PortableMediaPlayer *iface, QObject *parent )
+ : Capability( parent ), d( new Private() )
+{
+ d->iface = iface;
+}
+
+KDEHW::PortableMediaPlayer::~PortableMediaPlayer()
+{
+ delete d;
+}
+
+KDEHW::PortableMediaPlayer::AccessType KDEHW::PortableMediaPlayer::accessMethod() const
+{
+ return d->iface->accessMethod();
+}
+
+QStringList KDEHW::PortableMediaPlayer::outputFormats() const
+{
+ return d->iface->outputFormats();
+}
+
+QStringList KDEHW::PortableMediaPlayer::inputFormats() const
+{
+ return d->iface->inputFormats();
+}
+
+QStringList KDEHW::PortableMediaPlayer::playlistFormats() const
+{
+ return d->iface->playlistFormats();
+}
+
+#include "portablemediaplayer.moc"
Index: kdehw/Makefile.am
===================================================================
--- kdehw/Makefile.am (revisione 524632)
+++ kdehw/Makefile.am (copia locale)
@@ -6,11 +6,11 @@
libkdehw_la_LIBADD = $(LIB_QTCORE) $(LIB_QT) $(LIB_KDECORE) $(LIB_KIO) ifaces/libkdehwifaces.la
libkdehw_la_LDFLAGS = $(KDE_RPATH) -version-info 6:0:2 -no-undefined $(all_libraries)
-include_HEADERS = device.h devicemanager.h capability.h processor.h block.h storage.h cdrom.h volume.h opticaldisc.h camera.h display.h predicate.h
+include_HEADERS = device.h devicemanager.h capability.h processor.h block.h storage.h cdrom.h volume.h opticaldisc.h camera.h portablemediaplayer.h display.h predicate.h
METASOURCES = AUTO
-libkdehw_la_SOURCES = device.cpp devicemanager.cpp capability.cpp processor.cpp block.cpp storage.cpp cdrom.cpp volume.cpp opticaldisc.cpp camera.cpp display.cpp predicate.cpp predicateparse.cpp predicate_lexer.c predicate_parser.c
+libkdehw_la_SOURCES = device.cpp devicemanager.cpp capability.cpp processor.cpp block.cpp storage.cpp cdrom.cpp volume.cpp opticaldisc.cpp camera.cpp portablemediaplayer.cpp display.cpp predicate.cpp predicateparse.cpp predicate_lexer.c predicate_parser.c
kde_servicetypes_DATA = kdehwdevicemanager.desktop
Index: kdehw/portablemediaplayer.h
===================================================================
--- kdehw/portablemediaplayer.h (revisione 0)
+++ kdehw/portablemediaplayer.h (revisione 0)
@@ -0,0 +1,54 @@
+/* This file is part of the KDE project
+ Copyright (C) 2006 Davide Bettio <[EMAIL PROTECTED]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef KDEHW_PORTABLEMEDIAPLAYER_H
+#define KDEHW_PORTABLEMEDIAPLAYER_H
+
+#include <QStringList>
+
+#include <kdehw/capability.h>
+#include <kdehw/ifaces/enums.h>
+
+namespace KDEHW
+{
+ namespace Ifaces
+ {
+ class PortableMediaPlayer;
+ }
+
+ class PortableMediaPlayer : public Capability, public Ifaces::Enums::PortableMediaPlayer
+ {
+ Q_OBJECT
+ public:
+ PortableMediaPlayer( Ifaces::PortableMediaPlayer *iface, QObject *parent = 0 );
+ virtual ~PortableMediaPlayer();
+
+ static Type type() { return Capability::PortableMediaPlayer; };
+
+ AccessType accessMethod() const;
+ QStringList outputFormats() const;
+ QStringList inputFormats() const;
+ QStringList playlistFormats() const;
+ private:
+ class Private;
+ Private *d;
+ };
+};
+
+#endif
Index: backends/hal/haldevice.cpp
===================================================================
--- backends/hal/haldevice.cpp (revisione 524632)
+++ backends/hal/haldevice.cpp (copia locale)
@@ -30,6 +30,7 @@
#include "volume.h"
#include "opticaldisc.h"
#include "camera.h"
+#include "portablemediaplayer.h"
#include "display.h"
class HalDevicePrivate
@@ -245,6 +246,9 @@
case Capability::Camera:
iface = new Camera( this );
break;
+ case Capability::PortableMediaPlayer:
+ iface = new PortableMediaPlayer( this );
+ break;
case Capability::Display:
iface = new Display( this );
break;
Index: backends/hal/portablemediaplayer.cpp
===================================================================
--- backends/hal/portablemediaplayer.cpp (revisione 0)
+++ backends/hal/portablemediaplayer.cpp (revisione 0)
@@ -0,0 +1,62 @@
+/* This file is part of the KDE project
+ Copyright (C) 2006 Davide Bettio <[EMAIL PROTECTED]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+*/
+
+#include "portablemediaplayer.h"
+
+PortableMediaPlayer::PortableMediaPlayer( HalDevice *device )
+ : Capability( device )
+{
+
+}
+
+PortableMediaPlayer::~PortableMediaPlayer()
+{
+
+}
+
+PortableMediaPlayer::AccessType PortableMediaPlayer::accessMethod() const
+{
+ QString type = m_device->property("portable_audio_player.access_method").toString();
+
+ if ( type == "storage" )
+ {
+ return MassStorage;
+ }
+ else
+ {
+ return Proprietary;
+ }
+}
+
+QStringList PortableMediaPlayer::outputFormats() const
+{
+ return m_device->property("portable_audio_player.output_formats").toStringList();
+}
+
+QStringList PortableMediaPlayer::inputFormats() const
+{
+ return m_device->property("portable_audio_player.input_formats").toStringList();
+}
+
+QStringList PortableMediaPlayer::playlistFormats() const
+{
+ return m_device->property("portable_audio_player.playlist_format").toStringList();
+}
+
+#include "portablemediaplayer.moc"
Index: backends/hal/capability.h
===================================================================
--- backends/hal/capability.h (revisione 524632)
+++ backends/hal/capability.h (copia locale)
@@ -54,6 +54,8 @@
return "volume";
case Capability::OpticalDisc:
return "volume.disc";
+ case Capability::PortableMediaPlayer:
+ return "portable_audio_player";
case Capability::Display:
return "display_device";
default:
@@ -75,6 +77,8 @@
return Capability::Volume;
else if ( capability == "volume.disc" )
return Capability::OpticalDisc;
+ else if ( capability == "portable_audio_player" )
+ return Capability::PortableMediaPlayer;
else if ( capability == "display_device" )
return Capability::Display;
else
Index: backends/hal/Makefile.am
===================================================================
--- backends/hal/Makefile.am (revisione 524632)
+++ backends/hal/Makefile.am (copia locale)
@@ -7,7 +7,7 @@
kdehw_hal_la_LIBADD = $(LIB_QTCORE) $(LIB_QT) $(LIB_KDECORE) $(LIB_KIO) -ldbus-qt4-1 $(top_builddir)/kdehw/ifaces/libkdehwifaces.la
kdehw_hal_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
-kdehw_hal_la_SOURCES = halmanager.cpp haldevice.cpp halcalljob.cpp capability.cpp processor.cpp block.cpp storage.cpp cdrom.cpp volume.cpp opticaldisc.cpp camera.cpp display.cpp
+kdehw_hal_la_SOURCES = halmanager.cpp haldevice.cpp halcalljob.cpp capability.cpp processor.cpp block.cpp storage.cpp cdrom.cpp volume.cpp opticaldisc.cpp camera.cpp portablemediaplayer.cpp display.cpp
METASOURCES = AUTO
Index: backends/hal/portablemediaplayer.h
===================================================================
--- backends/hal/portablemediaplayer.h (revisione 0)
+++ backends/hal/portablemediaplayer.h (revisione 0)
@@ -0,0 +1,49 @@
+/* This file is part of the KDE project
+ Copyright (C) 2006 Davide Bettio <[EMAIL PROTECTED]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef PORTABLEMEDIAPLAYER_H
+#define PORTABLEMEDIAPLAYER_H
+
+#include <QStringList>
+
+#include <kdehw/ifaces/portablemediaplayer.h>
+#include "capability.h"
+
+class HalDevice;
+
+class PortableMediaPlayer : public Capability, virtual public KDEHW::Ifaces::PortableMediaPlayer
+{
+ Q_OBJECT
+ Q_PROPERTY( AccessType accessMethod READ accessMethod )
+ Q_PROPERTY( QStringList outputFormats READ outputFormats )
+ Q_PROPERTY( QStringList inputFormats READ inputFormats )
+ Q_PROPERTY( QStringList playlistFormats READ playlistFormats )
+ Q_ENUMS( AccessType )
+
+ public:
+ PortableMediaPlayer( HalDevice *device );
+ virtual ~PortableMediaPlayer();
+
+ virtual AccessType accessMethod() const;
+ virtual QStringList outputFormats() const;
+ virtual QStringList inputFormats() const;
+ virtual QStringList playlistFormats() const;
+};
+
+#endif
Index: backends/fake/fakecomputer.xml
===================================================================
--- backends/fake/fakecomputer.xml (revisione 524632)
+++ backends/fake/fakecomputer.xml (copia locale)
@@ -55,4 +55,14 @@
<property key="displayType">lcd</property>
<property key="lcdBrightness">50</property>
</device>
+ <device udi="/org/kde/solid/fake/portablemediaplayer0">
+ <property key="name">Portable Media Player #0</property>
+ <property key="vendor">Acme Corporation</property>
+ <property key="capability">portablemediaplayer</property>
+ <property key="parent">/org/kde/solid/fake/computer</property>
+ <property key="accessMethod">MassStorage</property>
+ <property key="outputFormats">audio/mpeg</property>
+ <property key="inputFormats">audio/x-wav</property>
+ <property key="playlistFormats">audio/x-mpegurl</property>
+ </device>
</machine>
Index: backends/fake/fakeportablemediaplayer.cpp
===================================================================
--- backends/fake/fakeportablemediaplayer.cpp (revisione 0)
+++ backends/fake/fakeportablemediaplayer.cpp (revisione 0)
@@ -0,0 +1,64 @@
+/* This file is part of the KDE project
+ Copyright (C) 2006 Davide Bettio <[EMAIL PROTECTED]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+*/
+
+#include <QStringList>
+
+#include "fakeportablemediaplayer.h"
+
+FakePortableMediaPlayer::FakePortableMediaPlayer( FakeDevice *device )
+ : FakeCapability( device )
+{
+
+}
+
+FakePortableMediaPlayer::~FakePortableMediaPlayer()
+{
+
+}
+
+FakePortableMediaPlayer::AccessType FakePortableMediaPlayer::accessMethod() const
+{
+ QString type = fakeDevice()->property("accessMethod").toString();
+
+ if ( type == "MassStorage" )
+ {
+ return MassStorage;
+ }
+ else
+ {
+ return Proprietary;
+ }
+}
+
+QStringList FakePortableMediaPlayer::outputFormats() const
+{
+ return fakeDevice()->property("outputFormats").toStringList();
+}
+
+QStringList FakePortableMediaPlayer::inputFormats() const
+{
+ return fakeDevice()->property("inputFormats").toStringList();
+}
+
+QStringList FakePortableMediaPlayer::playlistFormats() const
+{
+ return fakeDevice()->property("playlistFormats").toStringList();
+}
+
+#include "fakeportablemediaplayer.moc"
Index: backends/fake/fakecapability.h
===================================================================
--- backends/fake/fakecapability.h (revisione 524632)
+++ backends/fake/fakecapability.h (copia locale)
@@ -57,6 +57,8 @@
return "volume";
case Capability::OpticalDisc:
return "opticaldisc";
+ case Capability::PortableMediaPlayer:
+ return "portablemediaplayer";
case Capability::Display:
return "display";
default:
@@ -78,6 +80,8 @@
return Capability::Volume;
else if ( capability == "opticaldisc" )
return Capability::OpticalDisc;
+ else if ( capability == "portablemediaplayer" )
+ return Capability::PortableMediaPlayer;
else if ( capability == "display" )
return Capability::Display;
else
Index: backends/fake/fakeportablemediaplayer.h
===================================================================
--- backends/fake/fakeportablemediaplayer.h (revisione 0)
+++ backends/fake/fakeportablemediaplayer.h (revisione 0)
@@ -0,0 +1,45 @@
+/* This file is part of the KDE project
+ Copyright (C) 2006 Davide Bettio <[EMAIL PROTECTED]>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License version 2 as published by the Free Software Foundation.
+
+ 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef FAKEPORTABLEMEDIAPLAYER_H
+#define FAKEPORTABLEMEDIAPLAYER_H
+
+#include "fakecapability.h"
+#include <kdehw/ifaces/portablemediaplayer.h>
+
+class FakePortableMediaPlayer : public FakeCapability, virtual public KDEHW::Ifaces::PortableMediaPlayer
+{
+ Q_OBJECT
+ Q_PROPERTY( AccessType accessMethod READ accessMethod )
+ Q_PROPERTY( QStringList outputFormats READ outputFormats )
+ Q_PROPERTY( QStringList inputFormats READ inputFormats )
+ Q_PROPERTY( QStringList playlistFormats READ playlistFormats )
+ Q_ENUMS( AccessType )
+
+public:
+ FakePortableMediaPlayer( FakeDevice *device );
+ ~FakePortableMediaPlayer();
+
+ virtual AccessType accessMethod() const;
+ virtual QStringList outputFormats() const;
+ virtual QStringList inputFormats() const;
+ virtual QStringList playlistFormats() const;
+};
+
+#endif
Index: backends/fake/fakedevice.cpp
===================================================================
--- backends/fake/fakedevice.cpp (revisione 524632)
+++ backends/fake/fakedevice.cpp (copia locale)
@@ -25,6 +25,7 @@
#include "fakecdrom.h"
#include "fakevolume.h"
#include "fakeopticaldisc.h"
+#include "fakeportablemediaplayer.h"
#include "fakedisplay.h"
#include <QStringList>
@@ -127,6 +128,9 @@
case Capability::OpticalDisc:
iface = new FakeOpticalDisc(this);
break;
+ case Capability::PortableMediaPlayer:
+ iface = new FakePortableMediaPlayer(this);
+ break;
case Capability::Display:
iface = new FakeDisplay(this);
break;
Index: backends/fake/Makefile.am
===================================================================
--- backends/fake/Makefile.am (revisione 524632)
+++ backends/fake/Makefile.am (copia locale)
@@ -6,7 +6,7 @@
kdehw_fake_la_LIBADD = $(LIB_QTCORE) $(LIB_QT) $(LIB_QTXML) $(LIB_KDECORE) $(LIB_KIO) $(top_builddir)/kdehw/ifaces/libkdehwifaces.la
kdehw_fake_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined
-kdehw_fake_la_SOURCES = fakemanager.cpp fakedevice.cpp fakecapability.cpp fakeblock.cpp fakestorage.cpp fakecdrom.cpp fakevolume.cpp fakeopticaldisc.cpp fakecamera.cpp fakeprocessor.cpp fakedisplay.cpp
+kdehw_fake_la_SOURCES = fakemanager.cpp fakedevice.cpp fakecapability.cpp fakeblock.cpp fakestorage.cpp fakecdrom.cpp fakevolume.cpp fakeopticaldisc.cpp fakecamera.cpp fakeportablemediaplayer.cpp fakeprocessor.cpp fakedisplay.cpp
METASOURCES = AUTO
_______________________________________________
Kde-hardware-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-hardware-devel