Solid::DeviceInterface Class

class Solid::DeviceInterface
Header: #include <DeviceInterface>
CMake: find_package(KF6 REQUIRED COMPONENTS Solid)
target_link_libraries(mytarget PRIVATE KF6::Solid)
Inherits: QObject
Inherited By:

Solid::Battery, Solid::Block, Solid::Camera, Solid::GenericInterface, Solid::NetworkShare, Solid::PortableMediaPlayer, Solid::Processor, Solid::StorageAccess, Solid::StorageDrive, and Solid::StorageVolume

Public Types

enum Type { Unknown, GenericInterface, Processor, Block, StorageAccess, …, Last }

Public Functions

virtual ~DeviceInterface() override
bool isValid() const

Static Public Members

Solid::DeviceInterface::Type stringToType(const QString &type)
QString typeDescription(Solid::DeviceInterface::Type type)
QString typeToString(Solid::DeviceInterface::Type type)

Protected Functions

DeviceInterface(Solid::DeviceInterfacePrivate &dd, QObject *backendObject)

Detailed Description

@class Solid::DeviceInterface deviceinterface.h <Solid/DeviceInterface>

Base class of all the device interfaces.

A device interface describes what a device can do. A device generally has a set of device interfaces.

Member Type Documentation

enum DeviceInterface::Type

This enum type defines the type of device interface that a Device can have.

- Unknown : An undetermined device interface - Processor : A processor - Block : A block device - StorageAccess : A mechanism to access data on a storage device - StorageDrive : A storage drive - OpticalDrive : An optical drive (CD-ROM, DVD, ...) - StorageVolume : A volume - OpticalDisc : An optical disc - Camera : A digital camera - PortableMediaPlayer: A portable media player - NetworkShare: A network share interface

Member Function Documentation

[protected] DeviceInterface::DeviceInterface(Solid::DeviceInterfacePrivate &dd, QObject *backendObject)

@internal Creates a new DeviceInterface object.

@param dd the private d member. It will take care of deleting it upon destruction. @param backendObject the device interface object provided by the backend

[override virtual noexcept] DeviceInterface::~DeviceInterface()

Destroys a DeviceInterface object.

bool DeviceInterface::isValid() const

Indicates if this device interface is valid. A device interface is considered valid if the device it is referring is available in the system.

@return true if this device interface's device is available, false otherwise

[static] Solid::DeviceInterface::Type DeviceInterface::stringToType(const QString &type)

@return the device interface type for the given class name

[static] QString DeviceInterface::typeDescription(Solid::DeviceInterface::Type type)

@return a description suitable to display in the UI of the device interface type @since 4.4

[static] QString DeviceInterface::typeToString(Solid::DeviceInterface::Type type)

@return the class name of the device interface type