File indexing completed on 2024-05-12 04:01:52

0001 /*
0002     SPDX-FileCopyrightText: 2006 Davide Bettio <davide.bettio@kdemail.net>
0003     SPDX-FileCopyrightText: 2007 Jeff Mitchell <kde-dev@emailgoeshere.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #ifndef SOLID_IFACES_PORTABLEMEDIAPLAYER_H
0009 #define SOLID_IFACES_PORTABLEMEDIAPLAYER_H
0010 
0011 #include <solid/devices/ifaces/deviceinterface.h>
0012 #include <solid/portablemediaplayer.h>
0013 
0014 namespace Solid
0015 {
0016 namespace Ifaces
0017 {
0018 /**
0019  * This class implements Portable Media Player device interface and represents
0020  * a portable media player attached to the system.
0021  * A portable media player is a portable device able to play multimedia files.
0022  * Some of them have even recording capabilities.
0023  * @author Davide Bettio <davide.bettio@kdemail.net>
0024  */
0025 class PortableMediaPlayer : virtual public DeviceInterface
0026 {
0027 public:
0028     /**
0029      * Destroys a portable media player object.
0030      */
0031     ~PortableMediaPlayer() override;
0032 
0033     /**
0034      * Retrieves known protocols this device can speak.  This list may be dependent
0035      * on installed device driver libraries.
0036      *
0037      * Possible protocols:
0038      *  * storage - filesystem-based device: can browse and play media files stored
0039      *              on its volume. iPod-like devices can have both storage and ipod protocol
0040      *              set, you should use more specific (ipod) protocol in this case.
0041      *  * ipod - iPod-like device where media files are stored on filesystem, but these need
0042      *           an entry in device database in order to be playable.
0043      *  * mtp - Media Transfer Protocol-compatible devices.
0044      *
0045      * @return a list of known protocols this device can speak
0046      */
0047     virtual QStringList supportedProtocols() const = 0;
0048 
0049     /**
0050      * Retrieves known installed device drivers that claim to handle this device
0051      * using the requested protocol.
0052      *
0053      * Possible drivers:
0054      *  * usb - device is talked to using USB. This driver alone does not specify which
0055      *          particular USB service/protocol should be used.
0056      *  * usbmux - device supports AFC (Apple File Connection) and usbmuxd daemon is ready
0057      *             on /var/run/usbmuxd socket on UNIX and localhost:27015 port on Windows.
0058      *
0059      * @param protocol The protocol to get drivers for. Specify empty protocol to get
0060      *                 drivers for all possible protocols.
0061      * @return a list of known device drivers that can handle this device
0062      */
0063     virtual QStringList supportedDrivers(QString protocol = QString()) const = 0;
0064 
0065     /**
0066      * Retrieves a driver specific string allowing to access the device.
0067      *
0068      * For example for the "mtp" driver it will return the serial number
0069      * of the device and "usbmux" driver will return 40-digit device UUID
0070      *
0071      * @return the driver specific data
0072      */
0073     virtual QVariant driverHandle(const QString &driver) const = 0;
0074 };
0075 }
0076 }
0077 
0078 Q_DECLARE_INTERFACE(Solid::Ifaces::PortableMediaPlayer, "org.kde.Solid.Ifaces.PortableMediaPlayer/0.1")
0079 
0080 #endif