nymea/libguh/plugin/deviceclass.h

99 lines
3.4 KiB
C++

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* 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 <http://www.gnu.org/licenses/>. *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef DEVICECLASS_H
#define DEVICECLASS_H
#include "typeutils.h"
#include "types/vendor.h"
#include "types/eventtype.h"
#include "types/actiontype.h"
#include "types/statetype.h"
#include "types/paramtype.h"
#include <QList>
#include <QUuid>
class DeviceClass
{
public:
enum CreateMethod {
CreateMethodUser,
CreateMethodAuto,
CreateMethodDiscovery
};
enum SetupMethod {
SetupMethodJustAdd,
SetupMethodDisplayPin,
SetupMethodEnterPin,
SetupMethodPushButton
};
DeviceClass(const PluginId &pluginId = PluginId(), const VendorId &vendorId = VendorId(), const DeviceClassId &id = DeviceClassId());
DeviceClassId id() const;
VendorId vendorId() const;
PluginId pluginId() const;
bool isValid() const;
QString name() const;
void setName(const QString &name);
QList<StateType> stateTypes() const;
void setStateTypes(const QList<StateType> &stateTypes);
QList<EventType> eventTypes() const;
void setEventTypes(const QList<EventType> &eventTypes);
QList<ActionType> actionTypes() const;
void setActions(const QList<ActionType> &actionTypes);
QList<ParamType> paramTypes() const;
void setParamTypes(const QList<ParamType> &paramTypes);
QList<ParamType> discoveryParamTypes() const;
void setDiscoveryParamTypes(const QList<ParamType> &paramTypes);
CreateMethod createMethod() const;
void setCreateMethod(CreateMethod createMethod);
SetupMethod setupMethod() const;
void setSetupMethod(SetupMethod setupMethod);
QString pairingInfo() const;
void setPairingInfo(const QString &pairingInfo);
bool operator==(const DeviceClass &device) const;
private:
DeviceClassId m_id;
VendorId m_vendorId;
PluginId m_pluginId;
QString m_name;
QList<StateType> m_stateTypes;
QList<EventType> m_eventTypes;
QList<EventType> m_allEventTypes;
QList<ActionType> m_actionTypes;
QList<ParamType> m_paramTypes;
QList<ParamType> m_discoveryParamTypes;
CreateMethod m_createMethod;
SetupMethod m_setupMethod;
QString m_pairingInfo;
};
#endif