Solid::DeviceInterface Class

class Solid::DeviceInterface

Base class of all the device interfaces. More...

Header: #include <Solid/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, …, NetworkShare }

Public Functions

bool isValid() const

Static Public Members

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

Detailed Description

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.

ConstantValueDescription
Solid::DeviceInterface::Unknown0An undetermined device interface
Solid::DeviceInterface::GenericInterface1 
Solid::DeviceInterface::Processor2A processor
Solid::DeviceInterface::Block3A block device
Solid::DeviceInterface::StorageAccess4A mechanism to access data on a storage device
Solid::DeviceInterface::StorageDrive5A storage drive
Solid::DeviceInterface::OpticalDrive6An optical drive (CD-ROM, DVD, ...)
Solid::DeviceInterface::StorageVolume7A volume
Solid::DeviceInterface::OpticalDisc8An optical disc
Solid::DeviceInterface::Camera9A digital camera
Solid::DeviceInterface::PortableMediaPlayer10A portable media player
Solid::DeviceInterface::Battery12 
Solid::DeviceInterface::NetworkShare14A network share interface

Member Function Documentation

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.

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

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

Returns the device interface type for the given class name

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

Returns a description suitable to display in the UI of the device interface type

This function was introduced in 4.4.

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

Returns the class name of the device interface type