File indexing completed on 2024-05-19 04:03:19

0001 /*
0002     SPDX-FileCopyrightText: 2006 Davide Bettio <davide.bettio@kdemail.net>
0003     SPDX-FileCopyrightText: 2007 Kevin Ottens <ervin@kde.org>
0004     SPDX-FileCopyrightText: 2007 Jeff Mitchell <kde-dev@emailgoeshere.com>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef SOLID_PORTABLEMEDIAPLAYER_H
0010 #define SOLID_PORTABLEMEDIAPLAYER_H
0011 
0012 #include <QStringList>
0013 #include <QVariant>
0014 
0015 #include <solid/solid_export.h>
0016 
0017 #include <solid/deviceinterface.h>
0018 
0019 namespace Solid
0020 {
0021 class PortableMediaPlayerPrivate;
0022 class Device;
0023 
0024 /**
0025  * @class Solid::PortableMediaPlayer portablemediaplayer.h <Solid/PortableMediaPlayer>
0026  *
0027  * This class implements Portable Media Player device interface and represents
0028  * a portable media player attached to the system.
0029  * A portable media player is a portable device able to play multimedia files.
0030  * Some of them have even recording capabilities.
0031  * @author Davide Bettio <davide.bettio@kdemail.net>
0032  */
0033 class SOLID_EXPORT PortableMediaPlayer : public DeviceInterface
0034 {
0035     Q_OBJECT
0036     Q_PROPERTY(QStringList supportedProtocols READ supportedProtocols)
0037     Q_PROPERTY(QStringList supportedDrivers READ supportedDrivers)
0038     Q_DECLARE_PRIVATE(PortableMediaPlayer)
0039     friend class Device;
0040 
0041 public:
0042 private:
0043     /**
0044      * Creates a new PortableMediaPlayer object.
0045      * You generally won't need this. It's created when necessary using
0046      * Device::as().
0047      *
0048      * @param backendObject the device interface object provided by the backend
0049      * @see Solid::Device::as()
0050      */
0051     SOLID_NO_EXPORT explicit PortableMediaPlayer(QObject *backendObject);
0052 
0053 public:
0054     /**
0055      * Destroys a portable media player object.
0056      */
0057     ~PortableMediaPlayer() override;
0058 
0059     /**
0060      * Get the Solid::DeviceInterface::Type of the PortableMediaPlayer device interface.
0061      *
0062      * @return the PortableMediaPlayer device interface type
0063      * @see Solid::DeviceInterface::Type
0064      */
0065     static Type deviceInterfaceType()
0066     {
0067         return DeviceInterface::PortableMediaPlayer;
0068     }
0069 
0070     /**
0071      * Retrieves known protocols this device can speak.  This list may be dependent
0072      * on installed device driver libraries.
0073      *
0074      * @return a list of known protocols this device can speak
0075      */
0076     QStringList supportedProtocols() const;
0077 
0078     /**
0079      * Retrieves known installed device drivers that claim to handle this device
0080      * using the requested protocol.  If protocol is blank, returns a list of
0081      * all drivers supporting the device.
0082      *
0083      * @param protocol The protocol to get drivers for.
0084      * @return a list of installed drivers meeting the criteria
0085      */
0086     QStringList supportedDrivers(QString protocol = QString()) const;
0087 
0088     /**
0089      * Retrieves a driver specific string allowing to access the device.
0090      *
0091      * For example for the "mtp" driver it will return the serial number
0092      * of the device.
0093      *
0094      * @return the driver specific data
0095      */
0096     QVariant driverHandle(const QString &driver) const;
0097 };
0098 }
0099 
0100 #endif