From 134879793f45cdc55b816777b394dc0727644f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Fri, 26 Feb 2016 16:02:57 +0100 Subject: [PATCH] add DeviceIcon API type -> close #297 add more units -> close #301 --- doc/typeutils.qdoc | 64 ++++++++++++++++++++++------- libguh/plugin/deviceclass.cpp | 53 ++++++++++++++++++++++++ libguh/plugin/deviceclass.h | 34 ++++++++++++++++ libguh/typeutils.h | 10 ++++- server/jsonrpc/jsontypes.cpp | 77 +++++++++++++++++++---------------- server/jsonrpc/jsontypes.h | 1 + 6 files changed, 189 insertions(+), 50 deletions(-) diff --git a/doc/typeutils.qdoc b/doc/typeutils.qdoc index ec2fceae..6ba6229f 100644 --- a/doc/typeutils.qdoc +++ b/doc/typeutils.qdoc @@ -1,7 +1,7 @@ /*! \page typeutils.h \title Type Utils - + \chapter Types::StateOperator \table \header @@ -17,7 +17,7 @@ \li 1 \li The logical OR \tt | operator for two \l{State}{States} \endtable - + \chapter Types::ValueOperator \table \header @@ -27,11 +27,11 @@ \row \li Types::ValueOperatorEquals \li 0 - \li The \tt = operator to compare two \a values of a \l{Param}. + \li The \tt = operator to compare two \a values of a \l{Param}. \row \li Types::ValueOperatorNotEquals \li 1 - \li The \tt != operator to compare two \a values of a \l{Param}. + \li The \tt != operator to compare two \a values of a \l{Param}. \row \li Types::ValueOperatorLess \li 2 @@ -265,6 +265,38 @@ \li Types::UnitDollar \li 39 \li The value of the \l{Param} has unit \tt {[\$]} \unicode{0x2192} dollar. + \row + \li Types::UnitHerz + \li 40 + \li The value of the \l{Param} has unit \tt {[Hz]} \unicode{0x2192} herz. + \row + \li Types::UnitAmpere + \li 41 + \li The value of the \l{Param} has unit \tt {[A]} \unicode{0x2192} ampere. + \row + \li Types::UnitMilliAmpere + \li 42 + \li The value of the \l{Param} has unit \tt {[mA]} \unicode{0x2192} milli ampere. + \row + \li Types::UnitVolt + \li 43 + \li The value of the \l{Param} has unit \tt {[V]} \unicode{0x2192} volt. + \row + \li Types::UnitMilliVolt + \li 44 + \li The value of the \l{Param} has unit \tt {[mV]} \unicode{0x2192} milli volt. + \row + \li Types::UnitVoltAmpere + \li 45 + \li The value of the \l{Param} has unit \tt {[VA]} \unicode{0x2192} volt ampere. + \row + \li Types::UnitVoltAmpereReactive + \li 46 + \li The value of the \l{Param} has unit \tt {[var]} \unicode{0x2192} volt-ampere reactive. + \row + \li Types::UnitAmpereHour + \li 47 + \li The value of the \l{Param} has unit \tt {[Ah]} \unicode{0x2192} ampere hour. \endtable \chapter UUID Types @@ -274,37 +306,39 @@ \section2 VendorId This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{Vendor}. - \section2 DeviceClassId + + \section2 DeviceClassId This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{DeviceClass}. + \section2 DeviceId - This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{Device}. + This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{Device}. \section2 DeviceDescriptorId - This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{DeviceDescriptor}. + This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{DeviceDescriptor}. \section2 EventTypeId - This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{EventType}. + This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{EventType}. \section2 EventId - This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{Event}. + This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{Event}. \section2 StateTypeId - This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{StateType}. + This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{StateType}. \section2 StateId - This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{State}. + This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{State}. \section2 ActionTypeId - This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{ActionType}. + This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{ActionType}. \section2 ActionId - This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{Action} and \l{RuleAction}. + This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{Action} and \l{RuleAction}. \section2 RuleId - This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{guhserver::Rule}. + This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a \l{guhserver::Rule}. \section2 PairingTransactionId - This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a pairing transaction. + This class is a subclass of \l{http://doc.qt.io/qt-5/quuid.html}{QUuid} and represents the \e id of a pairing transaction. */ diff --git a/libguh/plugin/deviceclass.cpp b/libguh/plugin/deviceclass.cpp index f1f11174..21efb014 100644 --- a/libguh/plugin/deviceclass.cpp +++ b/libguh/plugin/deviceclass.cpp @@ -104,6 +104,44 @@ */ +/*! \enum DeviceClass::DeviceIcon + + This enum type specifies the default device icon of the DeviceClass. + Each client should have an icon set containing this list of icon types. + If a client want's to offer special icons for a special DeviceClass or device type, + he can bring it's own icon for a special DeviceClassId. If there is no special icon + defined, he can fallback to the default icon. + + \value DeviceIconBed + \value DeviceIconBlinds + \value DeviceIconCeilingLamp + \value DeviceIconCouch + \value DeviceIconDeskLamp + \value DeviceIconDesk + \value DeviceIconHifi + \value DeviceIconPower + \value DeviceIconRadio + \value DeviceIconSmartPhone + \value DeviceIconSocket + \value DeviceIconStandardLamp + \value DeviceIconSun + \value DeviceIconTablet + \value DeviceIconThermometer + \value DeviceIconTune + \value DeviceIconTv + \value DeviceIconBattery + \value DeviceIconDishwasher + \value DeviceIconWashingMachine + \value DeviceIconLaundryDryer + \value DeviceIconIrHeater + \value DeviceIconRadiator + \value DeviceIconSwitch + \value DeviceIconMotionDetectors + \value DeviceIconWeather + \value DeviceIconCloud +*/ + + #include "deviceclass.h" /*! Constructs a DeviceClass with the give \a pluginId ,\a vendorId and \a id . @@ -155,6 +193,21 @@ void DeviceClass::setName(const QString &name) m_name = name; } +/*! Returns the default \l{DeviceIcon} of this \l{DeviceClass}'s. */ +DeviceClass::DeviceIcon DeviceClass::deviceIcon() const +{ + return m_deviceIcon; +} + +/*! Set the \a deviceIcon of this DeviceClass. + + \sa DeviceClass::DeviceIcon +*/ +void DeviceClass::setDeviceIcon(const DeviceClass::DeviceIcon &deviceIcon) +{ + m_deviceIcon = deviceIcon; +} + /*! Returns the list of basicTags of this DeviceClass. \sa DeviceClass::BasicTag diff --git a/libguh/plugin/deviceclass.h b/libguh/plugin/deviceclass.h index 25907629..040bef8b 100644 --- a/libguh/plugin/deviceclass.h +++ b/libguh/plugin/deviceclass.h @@ -39,6 +39,7 @@ class LIBGUH_EXPORT DeviceClass Q_ENUMS(CreateMethod) Q_ENUMS(SetupMethod) Q_ENUMS(BasicTag) + Q_ENUMS(DeviceIcon) public: enum CreateMethod { @@ -76,6 +77,35 @@ public: BasicTagLock }; + enum DeviceIcon { + DeviceIconBed, + DeviceIconBlinds, + DeviceIconCeilingLamp, + DeviceIconCouch, + DeviceIconDeskLamp, + DeviceIconDesk, + DeviceIconHifi, + DeviceIconPower, + DeviceIconRadio, + DeviceIconSmartPhone, + DeviceIconSocket, + DeviceIconStandardLamp, + DeviceIconSun, + DeviceIconTablet, + DeviceIconThermometer, + DeviceIconTune, + DeviceIconTv, + DeviceIconBattery, + DeviceIconDishwasher, + DeviceIconWashingMachine, + DeviceIconLaundryDryer, + DeviceIconIrHeater, + DeviceIconRadiator, + DeviceIconSwitch, + DeviceIconMotionDetectors, + DeviceIconWeather, + DeviceIconCloud + }; DeviceClass(const PluginId &pluginId = PluginId(), const VendorId &vendorId = VendorId(), const DeviceClassId &id = DeviceClassId()); @@ -87,6 +117,9 @@ public: QString name() const; void setName(const QString &name); + DeviceIcon deviceIcon() const; + void setDeviceIcon(const DeviceIcon &deviceIcon); + QList basicTags() const; void setBasicTags(const QList &basicTags); @@ -124,6 +157,7 @@ private: VendorId m_vendorId; PluginId m_pluginId; QString m_name; + DeviceIcon m_deviceIcon; QList m_basicTags; QList m_stateTypes; QList m_eventTypes; diff --git a/libguh/typeutils.h b/libguh/typeutils.h index 0a4fe19b..8ae918e6 100644 --- a/libguh/typeutils.h +++ b/libguh/typeutils.h @@ -119,7 +119,15 @@ public: UnitPercentage, UnitPartsPerMillion, UnitEuro, - UnitDollar + UnitDollar, + UnitHerz, + UnitAmpere, + UnitMilliAmpere, + UnitVolt, + UnitMilliVolt, + UnitVoltAmpere, + UnitVoltAmpereReactive, + UnitAmpereHour }; enum ValueOperator { diff --git a/server/jsonrpc/jsontypes.cpp b/server/jsonrpc/jsontypes.cpp index ff7d89bd..ce0637e2 100644 --- a/server/jsonrpc/jsontypes.cpp +++ b/server/jsonrpc/jsontypes.cpp @@ -39,6 +39,7 @@ QString JsonTypes::s_lastError; QVariantList JsonTypes::s_basicType; QVariantList JsonTypes::s_basicTag; +QVariantList JsonTypes::s_deviceIcon; QVariantList JsonTypes::s_stateOperator; QVariantList JsonTypes::s_valueOperator; QVariantList JsonTypes::s_inputType; @@ -87,6 +88,7 @@ void JsonTypes::init() s_unit = enumToStrings(Types::staticMetaObject, "Unit"); s_createMethod = enumToStrings(DeviceClass::staticMetaObject, "CreateMethod"); s_setupMethod = enumToStrings(DeviceClass::staticMetaObject, "SetupMethod"); + s_deviceIcon = enumToStrings(DeviceClass::staticMetaObject, "DeviceIcon"); s_removePolicy = enumToStrings(RuleEngine::staticMetaObject, "RemovePolicy"); s_deviceError = enumToStrings(DeviceManager::staticMetaObject, "DeviceError"); s_ruleError = enumToStrings(RuleEngine::staticMetaObject, "RuleError"); @@ -277,6 +279,7 @@ QVariantMap JsonTypes::allTypes() allTypes.insert("Unit", unit()); allTypes.insert("CreateMethod", createMethod()); allTypes.insert("SetupMethod", setupMethod()); + allTypes.insert("DeviceIcon", deviceIcon()); allTypes.insert("ValueOperator", valueOperator()); allTypes.insert("StateOperator", stateOperator()); allTypes.insert("RemovePolicy", removePolicy()); @@ -1103,7 +1106,7 @@ QPair JsonTypes::validateVariant(const QVariant &templateVariant, } else if (refName == eventRef()) { QPair result = validateMap(eventDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "event not valid"; + qCWarning(dcJsonRpc) << "Event not valid"; return result; } } else if (refName == paramRef()) { @@ -1119,192 +1122,198 @@ QPair JsonTypes::validateVariant(const QVariant &templateVariant, } else if (refName == deviceRef()) { QPair result = validateMap(deviceDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "device not valid"; + qCWarning(dcJsonRpc) << "Device not valid"; return result; } } else if (refName == deviceDescriptorRef()) { QPair result = validateMap(deviceDescriptorDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "devicedescription not valid"; + qCWarning(dcJsonRpc) << "Devicedescriptor not valid"; return result; } } else if (refName == vendorRef()) { QPair result = validateMap(vendorDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "value not allowed in" << vendorRef(); + qCWarning(dcJsonRpc) << "Value not allowed in" << vendorRef(); } } else if (refName == deviceClassRef()) { QPair result = validateMap(deviceClassDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "device class not valid"; + qCWarning(dcJsonRpc) << "Device class not valid"; return result; } } else if (refName == paramTypeRef()) { QPair result = validateMap(paramTypeDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "param types not matching"; + qCWarning(dcJsonRpc) << "Param types not matching"; return result; } } else if (refName == ruleActionRef()) { QPair result = validateMap(ruleActionDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "ruleAction type not matching"; + qCWarning(dcJsonRpc) << "RuleAction type not matching"; return result; } } else if (refName == ruleActionParamRef()) { QPair result = validateMap(ruleActionParamDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "ruleActionParam type not matching"; + qCWarning(dcJsonRpc) << "RuleActionParam type not matching"; return result; } } else if (refName == actionTypeRef()) { QPair result = validateMap(actionTypeDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "action type not matching"; + qCWarning(dcJsonRpc) << "Action type not matching"; return result; } } else if (refName == eventTypeRef()) { QPair result = validateMap(eventTypeDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "event type not matching"; + qCWarning(dcJsonRpc) << "Event type not matching"; return result; } } else if (refName == stateTypeRef()) { QPair result = validateMap(stateTypeDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "state type not matching"; + qCWarning(dcJsonRpc) << "State type not matching"; return result; } } else if (refName == stateEvaluatorRef()) { QPair result = validateMap(stateEvaluatorDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "stateEvaluator type not matching"; + qCWarning(dcJsonRpc) << "StateEvaluator type not matching"; return result; } } else if (refName == stateDescriptorRef()) { QPair result = validateMap(stateDescriptorDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "stateDescriptor type not matching"; + qCWarning(dcJsonRpc) << "StateDescriptor type not matching"; return result; } } else if (refName == pluginRef()) { QPair result = validateMap(pluginDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "plugin not matching"; + qCWarning(dcJsonRpc) << "Plugin not matching"; return result; } } else if (refName == ruleRef()) { QPair result = validateMap(ruleDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "rule type not matching"; + qCWarning(dcJsonRpc) << "Rule type not matching"; return result; } } else if (refName == ruleDescriptionRef()) { QPair result = validateMap(s_ruleDescription, variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "ruleDescription type not matching"; + qCWarning(dcJsonRpc) << "RuleDescription type not matching"; return result; } } else if (refName == stateRef()) { QPair result = validateMap(s_state, variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "state not matching"; + qCWarning(dcJsonRpc) << "State not matching"; return result; } } else if (refName == eventDescriptorRef()) { QPair result = validateMap(eventDescriptorDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "evendescriptor not matching"; + qCWarning(dcJsonRpc) << "Eventdescriptor not matching"; return result; } } else if (refName == logEntryRef()) { QPair result = validateMap(logEntryDescription(), variant.toMap()); if (!result.first) { - qCWarning(dcJsonRpc) << "logEntry not matching"; + qCWarning(dcJsonRpc) << "LogEntry not matching"; return result; } } else if (refName == basicTypeRef()) { QPair result = validateBasicType(variant); if (!result.first) { - qCWarning(dcJsonRpc) << "value not allowed in" << basicTypeRef(); + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(basicTypeRef()); return result; } } else if (refName == stateOperatorRef()) { QPair result = validateEnum(s_stateOperator, variant); if (!result.first) { - qCWarning(dcJsonRpc) << "value not allowed in" << stateOperatorRef(); + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(stateOperatorRef()); return result; } } else if (refName == createMethodRef()) { QPair result = validateEnum(s_createMethod, variant); if (!result.first) { - qCWarning(dcJsonRpc) << "value not allowed in" << createMethodRef() << variant; + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(createMethodRef()); return result; } } else if (refName == setupMethodRef()) { QPair result = validateEnum(s_setupMethod, variant); if (!result.first) { - qCWarning(dcJsonRpc) << "value not allowed in" << createMethodRef(); + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(setupMethodRef()); return result; } } else if (refName == valueOperatorRef()) { QPair result = validateEnum(s_valueOperator, variant); if (!result.first) { - qCWarning(dcJsonRpc) << QString("value %1 not allowed in %2").arg(variant.toString()).arg(valueOperatorRef()); + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(valueOperatorRef()); return result; } } else if (refName == deviceErrorRef()) { QPair result = validateEnum(s_deviceError, variant); if (!result.first) { - qCWarning(dcJsonRpc) << QString("value %1 not allowed in %2").arg(variant.toString()).arg(deviceErrorRef()); + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(deviceErrorRef()); return result; } } else if (refName == ruleErrorRef()) { QPair result = validateEnum(s_ruleError, variant); if (!result.first) { - qCWarning(dcJsonRpc) << QString("value %1 not allowed in %2").arg(variant.toString()).arg(ruleErrorRef()); + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(ruleErrorRef()); return result; } } else if (refName == loggingErrorRef()) { QPair result = validateEnum(s_loggingError, variant); if (!result.first) { - qCWarning(dcJsonRpc) << QString("value %1 not allowed in %2").arg(variant.toString()).arg(loggingErrorRef()); + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(loggingErrorRef()); return result; } } else if (refName == loggingSourceRef()) { QPair result = validateEnum(s_loggingSource, variant); if (!result.first) { - qCWarning(dcJsonRpc) << QString("value %1 not allowed in %2").arg(variant.toString()).arg(loggingSourceRef()); + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(loggingSourceRef()); return result; } } else if (refName == loggingLevelRef()) { QPair result = validateEnum(s_loggingLevel, variant); if (!result.first) { - qCWarning(dcJsonRpc) << QString("value %1 not allowed in %2").arg(variant.toString()).arg(loggingLevelRef()); + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(loggingLevelRef()); return result; } } else if (refName == loggingEventTypeRef()) { QPair result = validateEnum(s_loggingEventType, variant); if (!result.first) { - qCWarning(dcJsonRpc) << QString("value %1 not allowed in %2").arg(variant.toString()).arg(loggingEventTypeRef()); + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(loggingEventTypeRef()); return result; } } else if (refName == inputTypeRef()) { QPair result = validateEnum(s_inputType, variant); if (!result.first) { - qCWarning(dcJsonRpc) << QString("value %1 not allowed in %2").arg(variant.toString()).arg(inputTypeRef()); + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(inputTypeRef()); return result; } } else if (refName == unitRef()) { QPair result = validateEnum(s_unit, variant); if (!result.first) { - qCWarning(dcJsonRpc) << QString("value %1 not allowed in %2").arg(variant.toString()).arg(unitRef()); + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(unitRef()); return result; } } else if (refName == basicTagRef()) { QPair result = validateEnum(s_basicTag, variant); if (!result.first) { - qCWarning(dcJsonRpc) << QString("value %1 not allowed in %2").arg(variant.toString()).arg(basicTagRef()); + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(basicTagRef()); + return result; + } + } else if (refName == deviceIconRef()) { + QPair result = validateEnum(s_deviceIcon, variant); + if (!result.first) { + qCWarning(dcJsonRpc) << QString("Value %1 not allowed in %2").arg(variant.toString()).arg(deviceIconRef()); return result; } } else { @@ -1335,7 +1344,7 @@ QPair JsonTypes::validateVariant(const QVariant &templateVariant, break; } default: - qCWarning(dcJsonRpc) << "unhandled value" << templateVariant; + qCWarning(dcJsonRpc) << "Unhandled value" << templateVariant; return report(false, QString("Unhandled value %1.").arg(templateVariant.toString())); } return report(true, ""); diff --git a/server/jsonrpc/jsontypes.h b/server/jsonrpc/jsontypes.h index 2e86b5b3..595a70cb 100644 --- a/server/jsonrpc/jsontypes.h +++ b/server/jsonrpc/jsontypes.h @@ -107,6 +107,7 @@ public: DECLARE_TYPE(unit, "Unit", Types, Unit) DECLARE_TYPE(createMethod, "CreateMethod", DeviceClass, CreateMethod) DECLARE_TYPE(setupMethod, "SetupMethod", DeviceClass, SetupMethod) + DECLARE_TYPE(deviceIcon, "DeviceIcon", DeviceClass, DeviceIcon) DECLARE_TYPE(deviceError, "DeviceError", DeviceManager, DeviceError) DECLARE_TYPE(removePolicy, "RemovePolicy", RuleEngine, RemovePolicy) DECLARE_TYPE(ruleError, "RuleError", RuleEngine, RuleError)