File indexing completed on 2024-05-12 04:01:50
0001 /* 0002 SPDX-FileCopyrightText: 2006-2007 Kevin Ottens <ervin@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 #ifndef SOLID_CAMERA_H 0008 #define SOLID_CAMERA_H 0009 0010 #include <solid/solid_export.h> 0011 0012 #include <solid/deviceinterface.h> 0013 0014 #include <QStringList> 0015 #include <QVariant> 0016 0017 namespace Solid 0018 { 0019 class CameraPrivate; 0020 class Device; 0021 0022 /** 0023 * @class Solid::Camera camera.h <Solid/Camera> 0024 * 0025 * This device interface is available on digital camera devices. 0026 * 0027 * A digital camera is a device used to transform images into 0028 * data. Nowaday most digital cameras are multifunctional and 0029 * able to take photographs, video or sound. On the system side 0030 * they are a particular type of device holding data, the access 0031 * method can be different from the typical storage device, hence 0032 * why it's a separate device interface. 0033 */ 0034 class SOLID_EXPORT Camera : public DeviceInterface 0035 { 0036 Q_OBJECT 0037 Q_PROPERTY(QStringList supportedProtocols READ supportedProtocols) 0038 Q_PROPERTY(QStringList supportedDrivers READ supportedDrivers) 0039 Q_DECLARE_PRIVATE(Camera) 0040 friend class Device; 0041 0042 private: 0043 /** 0044 * Creates a new Camera 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 Camera(QObject *backendObject); 0052 0053 public: 0054 /** 0055 * Destroys a Camera object. 0056 */ 0057 ~Camera() override; 0058 0059 /** 0060 * Get the Solid::DeviceInterface::Type of the Camera device interface. 0061 * 0062 * @return the Camera device interface type 0063 * @see Solid::DeviceInterface::Type 0064 */ 0065 static Type deviceInterfaceType() 0066 { 0067 return DeviceInterface::Camera; 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 "gphoto" driver it will return a list of the 0092 * form '("usb", vendor_id, product_id)'. 0093 * 0094 * @return the driver specific data 0095 */ 0096 QVariant driverHandle(const QString &driver) const; 0097 }; 0098 } 0099 0100 #endif