/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* 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 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
#include
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 states() const;
void setStates(const QList &stateTypes);
QList events() const;
void setEvents(const QList &eventTypes);
QList actions() const;
void setActions(const QList &actionTypes);
QList params() const;
void setParams(const QList ¶ms);
CreateMethod createMethod() const;
void setCreateMethod(CreateMethod createMethod);
SetupMethod setupMethod() const;
void setSetupMethod(SetupMethod setupMethod);
bool operator==(const DeviceClass &device) const;
private:
DeviceClassId m_id;
VendorId m_vendorId;
PluginId m_pluginId;
QString m_name;
QList m_states;
QList m_events;
QList m_actions;
QList m_params;
CreateMethod m_createMethod;
SetupMethod m_setupMethod;
};
#endif