#ifndef LIBNYMEAAPPCORE_H #define LIBNYMEAAPPCORE_H #include "engine.h" #include "vendorsproxy.h" #include "deviceclassesproxy.h" #include "devicesproxy.h" #include "pluginsproxy.h" #include "devicediscovery.h" #include "discovery/nymeadiscovery.h" #include "discovery/discoverymodel.h" #include "discovery/discoverydevice.h" #include "interfacesmodel.h" #include "rulemanager.h" #include "models/rulesfiltermodel.h" #include "types/ruleactions.h" #include "types/ruleaction.h" #include "types/ruleactionparams.h" #include "types/ruleactionparam.h" #include "types/eventdescriptors.h" #include "types/eventdescriptor.h" #include "types/timedescriptor.h" #include "types/timeeventitems.h" #include "types/timeeventitem.h" #include "types/repeatingoption.h" #include "types/calendaritems.h" #include "types/calendaritem.h" #include "types/rule.h" #include "types/interfaces.h" #include "types/interface.h" #include "types/statedescriptor.h" #include "types/stateevaluator.h" #include "types/stateevaluators.h" #include "models/logsmodel.h" #include "models/logsmodelng.h" #include "models/valuelogsproxymodel.h" #include "models/interfacesproxy.h" #include "configuration/nymeaconfiguration.h" #include "configuration/serverconfiguration.h" #include "configuration/serverconfigurations.h" #include "configuration/mqttpolicy.h" #include "configuration/mqttpolicies.h" #include "wifisetup/networkmanagercontroller.h" #include "wifisetup/wirelessaccesspoint.h" #include "wifisetup/wirelessaccesspoints.h" #include "wifisetup/wirelessaccesspointsproxy.h" #include "tagsmanager.h" #include "models/tagsproxymodel.h" #include "types/tag.h" #include "ruletemplates/ruletemplates.h" #include "ruletemplates/ruletemplate.h" #include "ruletemplates/eventdescriptortemplate.h" #include "ruletemplates/stateevaluatortemplate.h" #include "ruletemplates/statedescriptortemplate.h" #include "ruletemplates/ruleactiontemplate.h" #include "ruletemplates/ruleactionparamtemplate.h" #include "connection/awsclient.h" #include "models/devicemodel.h" #include static QObject* interfacesModel_provider(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) return new Interfaces(); } static QObject* awsClientProvider(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) return AWSClient::instance(); } void registerQmlTypes() { const char uri[] = "Nymea"; qmlRegisterType(uri, 1, 0, "Engine"); qmlRegisterUncreatableType(uri, 1, 0, "DeviceManager", "Can't create this in QML. Get it from the Engine."); qmlRegisterUncreatableType(uri, 1, 0, "JsonRpcClient", "Can't create this in QML. Get it from the Engine."); qmlRegisterUncreatableType(uri, 1, 0, "NymeaConnection", "Can't create this in QML. Get it from the Engine."); // libnymea-common qmlRegisterUncreatableType(uri, 1, 0, "Types", "Can't create this in QML. Get it from the Engine."); qmlRegisterUncreatableType(uri, 1, 0, "ParamType", "Can't create this in QML. Get it from the ParamTypes."); qmlRegisterUncreatableType(uri, 1, 0, "ParamTypes", "Can't create this in QML. Get it from the DeviceClass."); qmlRegisterUncreatableType(uri, 1, 0, "EventType", "Can't create this in QML. Get it from the EventTypes."); qmlRegisterUncreatableType(uri, 1, 0, "EventTypes", "Can't create this in QML. Get it from the DeviceClass."); qmlRegisterUncreatableType(uri, 1, 0, "StateType", "Can't create this in QML. Get it from the StateTypes."); qmlRegisterUncreatableType(uri, 1, 0, "StateTypes", "Can't create this in QML. Get it from the DeviceClass."); qmlRegisterUncreatableType(uri, 1, 0, "ActionType", "Can't create this in QML. Get it from the ActionTypes."); qmlRegisterUncreatableType(uri, 1, 0, "ActionTypes", "Can't create this in QML. Get it from the DeviceClass."); qmlRegisterUncreatableType(uri, 1, 0, "State", "Can't create this in QML. Get it from the States."); qmlRegisterUncreatableType(uri, 1, 0, "States", "Can't create this in QML. Get it from the Device."); qmlRegisterUncreatableType(uri, 1, 0, "Vendor", "Can't create this in QML. Get it from the Vendors."); qmlRegisterUncreatableType(uri, 1, 0, "Vendors", "Can't create this in QML. Get it from the DeviceManager."); qmlRegisterType(uri, 1, 0, "VendorsProxy"); qmlRegisterUncreatableType(uri, 1, 0, "Device", "Can't create this in QML. Get it from the Devices."); qmlRegisterUncreatableType(uri, 1, 0, "Devices", "Can't create this in QML. Get it from the DeviceManager."); qmlRegisterType(uri, 1, 0, "DevicesProxy"); qmlRegisterType(uri, 1, 0, "InterfacesModel"); qmlRegisterType(uri, 1, 0, "InterfacesSortModel"); qmlRegisterUncreatableType(uri, 1, 0, "DeviceClass", "Can't create this in QML. Get it from the DeviceClasses."); qmlRegisterUncreatableType(uri, 1, 0, "DeviceClasses", "Can't create this in QML. Get it from the DeviceManager."); qmlRegisterType(uri, 1, 0, "DeviceClassesProxy"); qmlRegisterType(uri, 1, 0, "DeviceDiscovery"); qmlRegisterType(uri, 1, 0, "DeviceModel"); qmlRegisterUncreatableType(uri, 1, 0, "RuleManager", "Get it from the Engine"); qmlRegisterUncreatableType(uri, 1, 0, "Rules", "Get it from RuleManager"); qmlRegisterUncreatableType(uri, 1, 0, "Rule", "Get it from Rules"); qmlRegisterUncreatableType(uri, 1, 0, "RuleActions", "Get them from the rule"); qmlRegisterUncreatableType(uri, 1, 0, "RuleAction", "Get it from RuleActions"); qmlRegisterUncreatableType(uri, 1, 0, "RuleActionParams", "Get it from RuleActions"); qmlRegisterUncreatableType(uri, 1, 0, "RuleActionParam", "Get it from RuleActionParams"); qmlRegisterType(uri, 1, 0, "RulesFilterModel"); qmlRegisterUncreatableType(uri, 1, 0, "EventDescriptors", "Get them from rules"); qmlRegisterUncreatableType(uri, 1, 0, "EventDescriptor", "Get them from rules"); qmlRegisterUncreatableType(uri, 1, 0, "ParamTypes", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "ParamType", "Uncreatable"); qmlRegisterType(uri, 1, 0, "Param"); qmlRegisterUncreatableType(uri, 1, 0, "ParamDescriptor", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "ParamDescriptors", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "StateDescriptor", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "StateEvaluator", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "StateEvaluators", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "TimeDescriptor", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "TimeEventItems", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "TimeEventItem", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "RepeatingOption", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "CalendarItems", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "CalendarItem", "Uncreatable"); qmlRegisterUncreatableType(uri, 1, 0, "Interface", "Uncreatable"); qmlRegisterSingletonType(uri, 1, 0, "Interfaces", interfacesModel_provider); qmlRegisterType(uri, 1, 0, "InterfacesProxy"); qmlRegisterUncreatableType(uri, 1, 0, "Plugin", "Can't create this in QML. Get it from the Plugins."); qmlRegisterUncreatableType(uri, 1, 0, "Plugins", "Can't create this in QML. Get it from the DeviceManager."); qmlRegisterType(uri, 1, 0, "PluginsProxy"); qmlRegisterUncreatableType(uri, 1, 0, "NymeaConfiguration", "Get it from Engine"); qmlRegisterUncreatableType(uri, 1, 0, "ServerConfiguration", "Get it from NymeaConfiguration"); qmlRegisterUncreatableType(uri, 1, 0, "ServerConfigurations", "Get it from NymeaConfiguration"); qmlRegisterUncreatableType(uri, 1, 0, "MqttPolicy", "Get it from NymeaConfiguration"); qmlRegisterUncreatableType(uri, 1, 0, "MqttPolicies", "Get it from NymeaConfiguration"); qmlRegisterType(uri, 1, 0, "NymeaDiscovery"); qmlRegisterUncreatableType(uri, 1, 0, "DiscoveryModel", "Get it from NymeaDiscovery"); qmlRegisterUncreatableType(uri, 1, 0, "DiscoveryDevice", "Get it from DiscoveryModel"); qmlRegisterUncreatableType(uri, 1, 0, "Connection", "Get it from DiscoveryDevice"); qmlRegisterType(uri, 1, 0, "LogsModel"); qmlRegisterType(uri, 1, 0, "LogsModelNg"); qmlRegisterType(uri, 1, 0, "ValueLogsProxyModel"); qmlRegisterUncreatableType(uri, 1, 0, "LogEntry", "Get them from LogsModel"); qmlRegisterUncreatableType(uri, 1, 0, "TagsManager", "Get it from Engine"); qmlRegisterUncreatableType(uri, 1, 0, "Tags", "Get it from TagsManager"); qmlRegisterUncreatableType(uri, 1, 0, "Tag", "Get it from Tags"); qmlRegisterType(uri, 1, 0, "TagsProxyModel"); qmlRegisterType(uri, 1, 0, "NetworkManagerController"); qmlRegisterType(uri, 1, 0, "BluetoothDiscovery"); qmlRegisterUncreatableType(uri, 1, 0, "BluetoothDeviceInfo", "Can't create this in QML. Get it from the DeviceInfos."); qmlRegisterUncreatableType(uri, 1, 0, "BluetoothDeviceInfos", "Can't create this in QML. Get it from the BluetoothDiscovery."); qmlRegisterUncreatableType(uri, 1, 0, "WirelessSetupManager", "Can't create this in QML. Get it from the NetworkManagerControler."); qmlRegisterUncreatableType(uri, 1, 0, "WirelessAccessPoints", "Can't create this in QML. Get it from the WirelessAccessPoints."); qmlRegisterUncreatableType(uri, 1, 0, "WirelessAccessPoints", "Can't create this in QML. Get it from the Engine instance."); qmlRegisterType(uri, 1, 0, "WirelessAccessPointsProxy"); qmlRegisterSingletonType(uri, 1, 0, "AWSClient", awsClientProvider); qmlRegisterUncreatableType(uri, 1, 0, "AWSDevice", "Can't create this in QML. Get it from AWSClient"); qmlRegisterType(uri, 1, 0, "RuleTemplates"); qmlRegisterType(uri, 1, 0, "RuleTemplatesFilterModel"); qmlRegisterUncreatableType(uri, 1, 0, "RuleTemplate", "Get them from RuleTemplates"); qmlRegisterUncreatableType(uri, 1, 0, "EventDescriptorTemplates", "Get it from RuleTemplate"); qmlRegisterUncreatableType(uri, 1, 0, "EventDescriptorTemplate", "Get it from EventDescriptorTemplates"); qmlRegisterUncreatableType(uri, 1, 0, "StateEvaluatorTemplate", "Get it from RuleTemplate"); qmlRegisterUncreatableType(uri, 1, 0, "StateDescriptorTemplate", "Get it from StateEvaluatorTemplate"); qmlRegisterUncreatableType(uri, 1, 0, "RuleActionTemplates", "Get it from RuleTemplate"); qmlRegisterUncreatableType(uri, 1, 0, "RuleActionTemplate", "Get it from RuleActionTemplates"); qmlRegisterUncreatableType(uri, 1, 0, "RuleActionParamTemplates", "Get it from RuleActionTemplate"); qmlRegisterUncreatableType(uri, 1, 0, "RuleActionParamTemplate", "Get it from RuleActionParamTemplates"); } #endif // LIBNYMEAAPPCORE_H