| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2006 Davide Bettio <davide.bettio@kdemail.net> |
| 3 | SPDX-FileCopyrightText: 2007 Jeff Mitchell <kde-dev@emailgoeshere.com> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 6 | */ |
| 7 | |
| 8 | #ifndef SOLID_IFACES_PORTABLEMEDIAPLAYER_H |
| 9 | #define SOLID_IFACES_PORTABLEMEDIAPLAYER_H |
| 10 | |
| 11 | #include <solid/devices/ifaces/deviceinterface.h> |
| 12 | #include <solid/portablemediaplayer.h> |
| 13 | |
| 14 | namespace Solid |
| 15 | { |
| 16 | namespace Ifaces |
| 17 | { |
| 18 | /** |
| 19 | * This class implements Portable Media Player device interface and represents |
| 20 | * a portable media player attached to the system. |
| 21 | * A portable media player is a portable device able to play multimedia files. |
| 22 | * Some of them have even recording capabilities. |
| 23 | * @author Davide Bettio <davide.bettio@kdemail.net> |
| 24 | */ |
| 25 | class PortableMediaPlayer : virtual public DeviceInterface |
| 26 | { |
| 27 | public: |
| 28 | /** |
| 29 | * Destroys a portable media player object. |
| 30 | */ |
| 31 | ~PortableMediaPlayer() override; |
| 32 | |
| 33 | /** |
| 34 | * Retrieves known protocols this device can speak. This list may be dependent |
| 35 | * on installed device driver libraries. |
| 36 | * |
| 37 | * Possible protocols: |
| 38 | * * storage - filesystem-based device: can browse and play media files stored |
| 39 | * on its volume. iPod-like devices can have both storage and ipod protocol |
| 40 | * set, you should use more specific (ipod) protocol in this case. |
| 41 | * * ipod - iPod-like device where media files are stored on filesystem, but these need |
| 42 | * an entry in device database in order to be playable. |
| 43 | * * mtp - Media Transfer Protocol-compatible devices. |
| 44 | * |
| 45 | * @return a list of known protocols this device can speak |
| 46 | */ |
| 47 | virtual QStringList supportedProtocols() const = 0; |
| 48 | |
| 49 | /** |
| 50 | * Retrieves known installed device drivers that claim to handle this device |
| 51 | * using the requested protocol. |
| 52 | * |
| 53 | * Possible drivers: |
| 54 | * * usb - device is talked to using USB. This driver alone does not specify which |
| 55 | * particular USB service/protocol should be used. |
| 56 | * * usbmux - device supports AFC (Apple File Connection) and usbmuxd daemon is ready |
| 57 | * on /var/run/usbmuxd socket on UNIX and localhost:27015 port on Windows. |
| 58 | * |
| 59 | * @param protocol The protocol to get drivers for. Specify empty protocol to get |
| 60 | * drivers for all possible protocols. |
| 61 | * @return a list of known device drivers that can handle this device |
| 62 | */ |
| 63 | virtual QStringList supportedDrivers(QString protocol = QString()) const = 0; |
| 64 | |
| 65 | /** |
| 66 | * Retrieves a driver specific string allowing to access the device. |
| 67 | * |
| 68 | * For example for the "mtp" driver it will return the serial number |
| 69 | * of the device and "usbmux" driver will return 40-digit device UUID |
| 70 | * |
| 71 | * @return the driver specific data |
| 72 | */ |
| 73 | virtual QVariant driverHandle(const QString &driver) const = 0; |
| 74 | }; |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | Q_DECLARE_INTERFACE(Solid::Ifaces::PortableMediaPlayer, "org.kde.Solid.Ifaces.PortableMediaPlayer/0.1" ) |
| 79 | |
| 80 | #endif |
| 81 | |