Solid::Ifaces::GenericInterface

Search for usage in LXR

Solid::Ifaces::GenericInterface Class Referenceabstract

#include <genericinterface.h>

Public Member Functions

virtual ~GenericInterface ()
 
virtual QMap< QString, QVariantallProperties () const =0
 
virtual QVariant property (const QString &key) const =0
 
virtual bool propertyExists (const QString &key) const =0
 

Protected Member Functions

virtual void conditionRaised (const QString &condition, const QString &reason)=0
 
virtual void propertyChanged (const QMap< QString, int > &changes)=0
 

Detailed Description

Generic interface to deal with a device.

It exposes a set of properties and is organized a a key/value set.

Warning: Using this class could expose some backend specific details and lead to non portable code. Use it at your own risk, or during transitional phases when the provided device interfaces don't provide the necessary methods.

Definition at line 28 of file ifaces/genericinterface.h.

Constructor & Destructor Documentation

◆ ~GenericInterface()

Solid::Ifaces::GenericInterface::~GenericInterface ( )
virtual

Destroys a GenericInterface object.

Definition at line 9 of file ifaces/genericinterface.cpp.

Member Function Documentation

◆ allProperties()

virtual QMap< QString, QVariant > Solid::Ifaces::GenericInterface::allProperties ( ) const
pure virtual

Retrieves all the properties of this device.

Returns
all properties in a map

◆ conditionRaised()

virtual void Solid::Ifaces::GenericInterface::conditionRaised ( const QString & condition,
const QString & reason )
protectedpure virtual

This signal is emitted when an event occurred in the device.

For example when a button is pressed.

Parameters
conditionthe condition name
reasona message explaining why the condition has been raised

◆ property()

virtual QVariant Solid::Ifaces::GenericInterface::property ( const QString & key) const
pure virtual

Retrieves the value of a property.

Parameters
keythe property name
Returns
the property value or QVariant() if the property doesn't exist

◆ propertyChanged()

virtual void Solid::Ifaces::GenericInterface::propertyChanged ( const QMap< QString, int > & changes)
protectedpure virtual

This signal is emitted when a property is changed in the device.

Parameters
changesthe map describing the property changes that occurred in the device, keys are property name and values describe the kind of change done on the device property (added/removed/modified), it's one of the type Solid::Device::PropertyChange

◆ propertyExists()

virtual bool Solid::Ifaces::GenericInterface::propertyExists ( const QString & key) const
pure virtual

Tests if a property exist.

Parameters
keythe property name
Returns
true if the property exists in this device, false otherwise

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.