/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* This file is part of guh. *
* *
* Guh is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, version 2 of the License. *
* *
* Guh is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with guh. If not, see . *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef DEVICE_H
#define DEVICE_H
#include "typeutils.h"
#include "plugin/deviceclass.h"
#include "types/state.h"
#include "types/param.h"
#include
#include
#include
class Device: public QObject
{
Q_OBJECT
friend class DeviceManager;
public:
DeviceId id() const;
DeviceClassId deviceClassId() const;
PluginId pluginId() const;
QString name() const;
void setName(const QString &name);
QList params() const;
void setParams(const QList ¶ms);
QVariant paramValue(const QString ¶mName) const;
QList states() const;
bool hasParam(const QString ¶mName) const;
void setStates(const QList &states);
bool hasState(const StateTypeId &stateTypeId) const;
QVariant stateValue(const StateTypeId &stateTypeId) const;
void setStateValue(const StateTypeId &stateTypeId, const QVariant &value);
signals:
void stateValueChanged(const QUuid &stateTypeId, const QVariant &value);
private:
Device(const PluginId &pluginId, const DeviceId &id, const DeviceClassId &deviceClassId, QObject *parent = 0);
Device(const PluginId &pluginId, const DeviceClassId &deviceClassId, QObject *parent = 0);
private:
DeviceId m_id;
DeviceClassId m_deviceClassId;
PluginId m_pluginId;
QString m_name;
QList m_params;
QList m_states;
};
#endif