/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright (C) 2015 Simon Stuerz * * Copyright (C) 2014 Michael Zanetti * * * * 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 { Q_GADGET Q_ENUMS(CreateMethod) Q_ENUMS(SetupMethod) public: enum CreateMethod { CreateMethodUser = 0x01, CreateMethodAuto = 0x02, CreateMethodDiscovery = 0x04 }; Q_DECLARE_FLAGS(CreateMethods, CreateMethod) 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 stateTypes() const; void setStateTypes(const QList &stateTypes); QList eventTypes() const; void setEventTypes(const QList &eventTypes); QList actionTypes() const; void setActionTypes(const QList &actionTypes); QList paramTypes() const; void setParamTypes(const QList ¶mTypes); QList discoveryParamTypes() const; void setDiscoveryParamTypes(const QList ¶mTypes); CreateMethods createMethods() const; void setCreateMethods(CreateMethods createMethods); 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 m_stateTypes; QList m_eventTypes; QList m_allEventTypes; QList m_actionTypes; QList m_paramTypes; QList m_discoveryParamTypes; CreateMethods m_createMethods; SetupMethod m_setupMethod; QString m_pairingInfo; }; #endif