1 | /* |
2 | Copyright 2006 Davide Bettio <davide.bettio@kdemail.net> |
3 | Copyright 2007 Kevin Ottens <ervin@kde.org> |
4 | Copyright 2007 Jeff Mitchell <kde-dev@emailgoeshere.com> |
5 | |
6 | This library is free software; you can redistribute it and/or |
7 | modify it under the terms of the GNU Lesser General Public |
8 | License as published by the Free Software Foundation; either |
9 | version 2.1 of the License, or (at your option) version 3, or any |
10 | later version accepted by the membership of KDE e.V. (or its |
11 | successor approved by the membership of KDE e.V.), which shall |
12 | act as a proxy defined in Section 6 of version 3 of the license. |
13 | |
14 | This library is distributed in the hope that it will be useful, |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 | Lesser General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Lesser General Public |
20 | License along with this library. If not, see <http://www.gnu.org/licenses/>. |
21 | */ |
22 | |
23 | #ifndef SOLID_PORTABLEMEDIAPLAYER_H |
24 | #define SOLID_PORTABLEMEDIAPLAYER_H |
25 | |
26 | #include <QtCore/QStringList> |
27 | #include <QtCore/QVariant> |
28 | |
29 | #include <solid/solid_export.h> |
30 | |
31 | #include <solid/deviceinterface.h> |
32 | |
33 | namespace Solid |
34 | { |
35 | class PortableMediaPlayerPrivate; |
36 | class Device; |
37 | |
38 | /** |
39 | * This class implements Portable Media Player device interface and represents |
40 | * a portable media player attached to the system. |
41 | * A portable media player is a portable device able to play multimedia files. |
42 | * Some of them have even recording capabilities. |
43 | * @author Davide Bettio <davide.bettio@kdemail.net> |
44 | */ |
45 | class SOLID_EXPORT PortableMediaPlayer : public DeviceInterface |
46 | { |
47 | Q_OBJECT |
48 | Q_PROPERTY(QStringList supportedProtocols READ supportedProtocols) |
49 | Q_PROPERTY(QStringList supportedDrivers READ supportedDrivers) |
50 | Q_DECLARE_PRIVATE(PortableMediaPlayer) |
51 | friend class Device; |
52 | |
53 | public: |
54 | |
55 | private: |
56 | /** |
57 | * Creates a new PortableMediaPlayer object. |
58 | * You generally won't need this. It's created when necessary using |
59 | * Device::as(). |
60 | * |
61 | * @param backendObject the device interface object provided by the backend |
62 | * @see Solid::Device::as() |
63 | */ |
64 | explicit PortableMediaPlayer(QObject *backendObject); |
65 | |
66 | public: |
67 | /** |
68 | * Destroys a portable media player object. |
69 | */ |
70 | virtual ~PortableMediaPlayer(); |
71 | |
72 | /** |
73 | * Get the Solid::DeviceInterface::Type of the PortableMediaPlayer device interface. |
74 | * |
75 | * @return the PortableMediaPlayer device interface type |
76 | * @see Solid::DeviceInterface::Type |
77 | */ |
78 | static Type deviceInterfaceType() { return DeviceInterface::PortableMediaPlayer; } |
79 | |
80 | /** |
81 | * Retrieves known protocols this device can speak. This list may be dependent |
82 | * on installed device driver libraries. |
83 | * |
84 | * @return a list of known protocols this device can speak |
85 | */ |
86 | QStringList supportedProtocols() const; |
87 | |
88 | /** |
89 | * Retrieves known installed device drivers that claim to handle this device |
90 | * using the requested protocol. If protocol is blank, returns a list of |
91 | * all drivers supporting the device. |
92 | * |
93 | * @param protocol The protocol to get drivers for. |
94 | * @return a list of installed drivers meeting the criteria |
95 | */ |
96 | QStringList supportedDrivers(QString protocol = QString()) const; |
97 | |
98 | /** |
99 | * Retrieves a driver specific string allowing to access the device. |
100 | * |
101 | * For example for the "mtp" driver it will return the serial number |
102 | * of the device. |
103 | * |
104 | * @return the driver specific data |
105 | */ |
106 | QVariant driverHandle(const QString &driver) const; |
107 | }; |
108 | } |
109 | |
110 | #endif |
111 | |