guh - Developer documentation

Device Class

A Device represents a installed and configured hardware device. More...

Header: #include <Device>
Inherits:

Public Functions

DeviceClassId deviceClassId() const
bool hasParam(const ParamTypeId & paramTypeId) const
bool hasState(const StateTypeId & stateTypeId) const
DeviceId id() const
QString name() const
QVariant paramValue(const ParamTypeId & paramTypeId) const
ParamList params() const
DeviceId parentId() const
PluginId pluginId() const
void setName(const QString & name)
void setParamValue(const ParamTypeId & paramTypeId, const QVariant & value)
void setParams(const ParamList & params)
void setParentId(const DeviceId & parentId)
void setStateValue(const StateTypeId & stateTypeId, const QVariant & value)
void setStates(const QList<State> & states)
bool setupComplete() const
State state(const StateTypeId & stateTypeId) const
QVariant stateValue(const StateTypeId & stateTypeId) const
QList<State> states() const

Signals

void stateValueChanged(const QUuid & stateTypeId, const QVariant & value)

Detailed Description

A Device represents a installed and configured hardware device.

This class holds the values for configured devices. It is associated with a {DeviceClass} which can be used to get more details about the device.

See also DeviceClass and DeviceDescriptor.

Member Function Documentation

DeviceClassId Device::deviceClassId() const

Returns the deviceClassId of the associated DeviceClass.

bool Device::hasParam(const ParamTypeId & paramTypeId) const

Returns true, a Param with the given paramTypeId exists for this Device.

bool Device::hasState(const StateTypeId & stateTypeId) const

Returns true, a State with the given stateTypeId exists for this Device.

DeviceId Device::id() const

Returns the id of this Device.

QString Device::name() const

Returns the name of this Device. This is visible to the user.

See also setName().

QVariant Device::paramValue(const ParamTypeId & paramTypeId) const

Returns the value of the Param of this Device with the given paramTypeId.

See also setParamValue().

ParamList Device::params() const

Returns the parameter of this Device. It must match the parameter description in the associated DeviceClass.

See also setParams().

DeviceId Device::parentId() const

Returns the DeviceId of the parent Device from Device. If the parentId is not set, this device is a parent device.

See also setParentId().

PluginId Device::pluginId() const

Returns the id of the DevicePlugin this Device is managed by.

void Device::setName(const QString & name)

Set the name for this Device. This is visible to the user.

See also name().

void Device::setParamValue(const ParamTypeId & paramTypeId, const QVariant & value)

Sets the value of the Param with the given paramTypeId.

See also paramValue().

void Device::setParams(const ParamList & params)

Sets the params of this Device. It must match the parameter description in the associated DeviceClass.

See also params().

void Device::setParentId(const DeviceId & parentId)

Sets the parentId of this Device. If the parentId is not set, this device is a parent device.

See also parentId().

void Device::setStateValue(const StateTypeId & stateTypeId, const QVariant & value)

For convenience, this finds the State matching the given stateTypeId in this Device and sets the current value to value.

See also stateValue().

void Device::setStates(const QList<State> & states)

Set the States of this Device to the given states.

See also states().

bool Device::setupComplete() const

Returns true, if setup of this Device is already completed.

State Device::state(const StateTypeId & stateTypeId) const

Returns the State with the given stateTypeId of this Device.

QVariant Device::stateValue(const StateTypeId & stateTypeId) const

For convenience, this finds the State matching the given stateTypeId and returns the current valie in this Device.

See also setStateValue().

[signal] void Device::stateValueChanged(const QUuid & stateTypeId, const QVariant & value)

This signal is emitted when the State with the given stateTypeId changed. The value parameter describes the new value of the State.

QList<State> Device::states() const

Returns the states of this Device. It must match the StateType description in the associated DeviceClass.

See also setStates().