changed style color and improved icon
added GuhCore documentation for completeness
This commit is contained in:
parent
4895bd940e
commit
23a09278a2
Binary file not shown.
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 5.3 KiB |
@ -224,7 +224,7 @@
|
||||
display: block;
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
background: #4dc6a9;
|
||||
background: #69938C;
|
||||
height: 10.5em;
|
||||
}
|
||||
/* end global settings*/
|
||||
|
||||
@ -107,7 +107,7 @@
|
||||
|
||||
/*! \fn void DeviceManager::deviceSetupFinished(Device *device, DeviceError status);
|
||||
This signal is emitted when the setup of a \a device is finished. The \a status parameter describes the
|
||||
\l{DeviceManager}{DeviceError} that occurred.
|
||||
\l{DeviceManager::DeviceError}{DeviceError} that occurred.
|
||||
*/
|
||||
|
||||
/*! \fn void DeviceManager::deviceStateChanged(Device *device, const QUuid &stateTypeId, const QVariant &value);
|
||||
@ -123,12 +123,12 @@
|
||||
|
||||
/*! \fn void DeviceManager::actionExecutionFinished(const ActionId &actionId, DeviceError status);
|
||||
The DeviceManager will emit a this Signal when the \l{Action} with the given \a actionId is finished.
|
||||
The \a status of the \l{Action} execution will be described as \l{DeviceManager}{DeviceError}.
|
||||
The \a status of the \l{Action} execution will be described as \l{DeviceManager::DeviceError}{DeviceError}.
|
||||
*/
|
||||
|
||||
/*! \fn void DeviceManager::pairingFinished(const PairingTransactionId &pairingTransactionId, DeviceError status, const DeviceId &deviceId = DeviceId());
|
||||
The DeviceManager will emit a this Signal when the pairing of a \l{Device} with the \a deviceId and \a pairingTransactionId is finished.
|
||||
The \a status of the pairing will be described as \l{DeviceManager}{DeviceError}.
|
||||
The \a status of the pairing will be described as \l{DeviceManager::DeviceError}{DeviceError}.
|
||||
*/
|
||||
|
||||
/*! \fn void DeviceManager::eventTriggered(const Event &event)
|
||||
@ -317,7 +317,7 @@ DeviceManager::DeviceError DeviceManager::addConfiguredDevice(const DeviceClassI
|
||||
}
|
||||
|
||||
/*! Trys to pair a Device with the given \a pairingTransactionId, \a deviceClassId and \a params.
|
||||
* Returns \l{DeviceManager}{DeviceError} to inform about the result. */
|
||||
* Returns \l{DeviceManager::DeviceError}{DeviceError} to inform about the result. */
|
||||
DeviceManager::DeviceError DeviceManager::pairDevice(const PairingTransactionId &pairingTransactionId, const DeviceClassId &deviceClassId, const ParamList ¶ms)
|
||||
{
|
||||
DeviceClass deviceClass = findDeviceClass(deviceClassId);
|
||||
@ -347,7 +347,7 @@ DeviceManager::DeviceError DeviceManager::pairDevice(const PairingTransactionId
|
||||
}
|
||||
|
||||
/*! Trys to pair a Device with the given \a pairingTransactionId, \a deviceClassId and \a deviceDescriptorId.
|
||||
* Returns \l{DeviceManager}{DeviceError} to inform about the result. */
|
||||
* Returns \l{DeviceManager::DeviceError}{DeviceError} to inform about the result. */
|
||||
DeviceManager::DeviceError DeviceManager::pairDevice(const PairingTransactionId &pairingTransactionId, const DeviceClassId &deviceClassId, const DeviceDescriptorId &deviceDescriptorId)
|
||||
{
|
||||
DeviceClass deviceClass = findDeviceClass(deviceClassId);
|
||||
@ -378,7 +378,7 @@ DeviceManager::DeviceError DeviceManager::pairDevice(const PairingTransactionId
|
||||
}
|
||||
|
||||
/*! Confirms the pairing of a \l{Device} with the given \a pairingTransactionId and \a secret.
|
||||
* Returns \l{DeviceManager}{DeviceError} to inform about the result. */
|
||||
* Returns \l{DeviceManager::DeviceError}{DeviceError} to inform about the result. */
|
||||
DeviceManager::DeviceError DeviceManager::confirmPairing(const PairingTransactionId &pairingTransactionId, const QString &secret)
|
||||
{
|
||||
Q_UNUSED(secret)
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
\fn DeviceManager::DeviceError DevicePlugin::executeAction(Device *device, const Action &action)
|
||||
This will be called to actually execute actions on the hardware. The \{Device} and
|
||||
the \{Action} are contained in the \a device and \a action parameters.
|
||||
Return the appropriate \l{DeviceManager}{DeviceError}.
|
||||
Return the appropriate \l{DeviceManager::DeviceError}{DeviceError}.
|
||||
|
||||
It is possible to execute actions asynchronously. You never should do anything blocking for
|
||||
a long time (e.g. wait on a network reply from the internet) but instead return
|
||||
@ -70,14 +70,14 @@
|
||||
/*!
|
||||
\fn void DevicePlugin::pairingFinished(const PairingTransactionId &pairingTransactionId, DeviceManager::DeviceSetupStatus status);
|
||||
This signal is emitted when the pairing of a \a pairingTransactionId is finished.
|
||||
The \a status of the will be described as \l{DeviceManager}{DeviceError}.
|
||||
The \a status of the will be described as \l{DeviceManager::DeviceError}{DeviceError}.
|
||||
\sa confirmPairing()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void DevicePlugin::deviceSetupFinished(Device *device, DeviceManager::DeviceSetupStatus status);
|
||||
This signal is emitted when the setup of a \a device in this DevicePlugin is finished. The \a status parameter describes the
|
||||
\l{DeviceManager}{DeviceError} that occurred.
|
||||
\l{DeviceManager::DeviceError}{DeviceError} that occurred.
|
||||
*/
|
||||
|
||||
/*!
|
||||
@ -89,7 +89,7 @@
|
||||
\fn void DevicePlugin::actionExecutionFinished(const ActionId &id, DeviceManager::DeviceError status)
|
||||
This signal is to be emitted when you previously have returned \l{DeviceManager}{DeviceErrorAsync}
|
||||
in a call of executeAction(). The \a id refers to the executed \l{Action}. The \a status of the \l{Action}
|
||||
execution will be described as \l{DeviceManager}{DeviceError}.
|
||||
execution will be described as \l{DeviceManager::DeviceError}{DeviceError}.
|
||||
*/
|
||||
|
||||
/*!
|
||||
@ -281,7 +281,7 @@ void DevicePlugin::deviceRemoved(Device *device)
|
||||
}
|
||||
|
||||
/*! Confirms the pairing of a \a deviceClassId with the given \a pairingTransactionId and \a params.
|
||||
* Returns \l{DeviceManager}{DeviceError} to inform about the result. */
|
||||
* Returns \l{DeviceManager::DeviceError}{DeviceError} to inform about the result. */
|
||||
DeviceManager::DeviceSetupStatus DevicePlugin::confirmPairing(const PairingTransactionId &pairingTransactionId, const DeviceClassId &deviceClassId, const ParamList ¶ms)
|
||||
{
|
||||
Q_UNUSED(pairingTransactionId)
|
||||
|
||||
@ -27,6 +27,36 @@
|
||||
instantiate, set up and connect all the other components.
|
||||
*/
|
||||
|
||||
/*! \fn void GuhCore::eventTriggered(const Event &event);
|
||||
This signal is emitted when an \a event happend.
|
||||
*/
|
||||
|
||||
/*! \fn void GuhCore::deviceStateChanged(Device *device, const QUuid &stateTypeId, const QVariant &value);
|
||||
This signal is emitted when the \l{State} of a \a device changed. The \a stateTypeId parameter describes the
|
||||
\l{StateType} and the \a value parameter holds the new value.
|
||||
*/
|
||||
|
||||
/*! \fn void GuhCore::actionExecuted(const ActionId &id, DeviceManager::DeviceError status);
|
||||
This signal is emitted when the \l{Action} with the given \a id is finished.
|
||||
The \a status of the \l{Action} execution will be described as \l{DeviceManager::DeviceError}{DeviceError}.
|
||||
*/
|
||||
|
||||
/*! \fn void GuhCore::devicesDiscovered(const DeviceClassId &deviceClassId, const QList<DeviceDescriptor> deviceDescriptors);
|
||||
This signal is emitted when the discovery of a \a deviceClassId is finished. The \a deviceDescriptors parameter describes the
|
||||
list of \l{DeviceDescriptor}{DeviceDescriptors} of all discovered \l{Device}{Devices}.
|
||||
\sa discoverDevices()
|
||||
*/
|
||||
|
||||
/*! \fn void GuhCore::deviceSetupFinished(Device *device, DeviceManager::DeviceError status);
|
||||
This signal is emitted when the setup of a \a device is finished. The \a status parameter describes the
|
||||
\l{DeviceManager::DeviceError}{DeviceError} that occurred.
|
||||
*/
|
||||
|
||||
/*! \fn void GuhCore::pairingFinished(const PairingTransactionId &pairingTransactionId, DeviceManager::DeviceError status, const DeviceId &deviceId);
|
||||
The DeviceManager will emit a this Signal when the pairing of a \l{Device} with the \a deviceId and \a pairingTransactionId is finished.
|
||||
The \a status of the pairing will be described as \l{DeviceManager::DeviceError}{DeviceError}.
|
||||
*/
|
||||
|
||||
#include "guhcore.h"
|
||||
#include "jsonrpcserver.h"
|
||||
#include "ruleengine.h"
|
||||
@ -38,7 +68,7 @@
|
||||
|
||||
GuhCore* GuhCore::s_instance = 0;
|
||||
|
||||
/*! Returns a pointer to the single \l{GuhCore} instance.*/
|
||||
/*! Returns a pointer to the single \l{GuhCore} instance. */
|
||||
GuhCore *GuhCore::instance()
|
||||
{
|
||||
if (!s_instance) {
|
||||
@ -47,37 +77,48 @@ GuhCore *GuhCore::instance()
|
||||
return s_instance;
|
||||
}
|
||||
|
||||
/*! Destructor of the \l{GuhCore}. */
|
||||
GuhCore::~GuhCore()
|
||||
{
|
||||
qDebug() << "Shutting down. Bye.";
|
||||
}
|
||||
|
||||
/*! Destroyes the \l{GuhCore} instance. */
|
||||
void GuhCore::destroy()
|
||||
{
|
||||
delete s_instance;
|
||||
s_instance = 0;
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::plugins().
|
||||
* \sa DeviceManager::plugins(), */
|
||||
QList<DevicePlugin *> GuhCore::plugins() const
|
||||
{
|
||||
return m_deviceManager->plugins();
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::setPluginConfig(\a pluginId, \a params).
|
||||
* \sa DeviceManager::setPluginConfig(), */
|
||||
DeviceManager::DeviceError GuhCore::setPluginConfig(const PluginId &pluginId, const ParamList ¶ms)
|
||||
{
|
||||
return m_deviceManager->setPluginConfig(pluginId, params);
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::supportedVendors().
|
||||
* \sa DeviceManager::supportedVendors(), */
|
||||
QList<Vendor> GuhCore::supportedVendors() const
|
||||
{
|
||||
return m_deviceManager->supportedVendors();
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::supportedDevices(\a vendorId).
|
||||
* \sa DeviceManager::supportedDevices(), */
|
||||
QList<DeviceClass> GuhCore::supportedDevices(const VendorId &vendorId) const
|
||||
{
|
||||
return m_deviceManager->supportedDevices(vendorId);
|
||||
}
|
||||
|
||||
/*! Removes a configured \l{Device} with the given \a deviceId and \a removePolicyList. */
|
||||
DeviceManager::DeviceError GuhCore::removeConfiguredDevice(const DeviceId &deviceId, const QHash<RuleId, RuleEngine::RemovePolicy> &removePolicyList)
|
||||
{
|
||||
QHash<RuleId, RuleEngine::RemovePolicy> toBeChanged;
|
||||
@ -113,86 +154,123 @@ DeviceManager::DeviceError GuhCore::removeConfiguredDevice(const DeviceId &devic
|
||||
return m_deviceManager->removeConfiguredDevice(deviceId);
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::pairDevice(\a pairingTransactionId, \a deviceClassId, \a deviceDescriptorId).
|
||||
* Returns \l{DeviceManager::DeviceError}{DeviceError} to inform about the result.
|
||||
* \sa DeviceManager::pairDevice(), */
|
||||
DeviceManager::DeviceError GuhCore::pairDevice(const PairingTransactionId &pairingTransactionId, const DeviceClassId &deviceClassId, const DeviceDescriptorId &deviceDescriptorId)
|
||||
{
|
||||
return m_deviceManager->pairDevice(pairingTransactionId, deviceClassId, deviceDescriptorId);
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::pairDevice(\a pairingTransactionId, \a deviceClassId, \a params).
|
||||
* Returns \l{DeviceManager::DeviceError}{DeviceError} to inform about the result.
|
||||
* \sa DeviceManager::pairDevice(), */
|
||||
DeviceManager::DeviceError GuhCore::pairDevice(const PairingTransactionId &pairingTransactionId, const DeviceClassId &deviceClassId, const ParamList ¶ms)
|
||||
{
|
||||
return m_deviceManager->pairDevice(pairingTransactionId, deviceClassId, params);
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::confirmPairing(\a pairingTransactionId, \a secret).
|
||||
* Returns \l{DeviceManager::DeviceError}{DeviceError} to inform about the result.
|
||||
* \sa DeviceManager::confirmPairing(), */
|
||||
DeviceManager::DeviceError GuhCore::confirmPairing(const PairingTransactionId &pairingTransactionId, const QString &secret)
|
||||
{
|
||||
return m_deviceManager->confirmPairing(pairingTransactionId, secret);
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::executeAction(\a action).
|
||||
* \sa DeviceManager::executeAction(), */
|
||||
DeviceManager::DeviceError GuhCore::executeAction(const Action &action)
|
||||
{
|
||||
return m_deviceManager->executeAction(action);
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::findDeviceClass(\a deviceClassId).
|
||||
* \sa DeviceManager::findDeviceClass(), */
|
||||
DeviceClass GuhCore::findDeviceClass(const DeviceClassId &deviceClassId) const
|
||||
{
|
||||
return m_deviceManager->findDeviceClass(deviceClassId);
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::discoverDevices(\a deviceClassId, \a params).
|
||||
* \sa DeviceManager::discoverDevices(), */
|
||||
DeviceManager::DeviceError GuhCore::discoverDevices(const DeviceClassId &deviceClassId, const ParamList ¶ms)
|
||||
{
|
||||
return m_deviceManager->discoverDevices(deviceClassId, params);
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::addConfiguredDevice(\a deviceClassId, \a params, \a newId).
|
||||
* \sa DeviceManager::addConfiguredDevice(), */
|
||||
DeviceManager::DeviceError GuhCore::addConfiguredDevice(const DeviceClassId &deviceClassId, const ParamList ¶ms, const DeviceId &newId)
|
||||
{
|
||||
return m_deviceManager->addConfiguredDevice(deviceClassId, params, newId);
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::addConfiguredDevice(\a deviceClassId, \a deviceDescriptorId, \a newId).
|
||||
* \sa DeviceManager::addConfiguredDevice(), */
|
||||
DeviceManager::DeviceError GuhCore::addConfiguredDevice(const DeviceClassId &deviceClassId, const DeviceDescriptorId &deviceDescriptorId, const DeviceId &newId)
|
||||
{
|
||||
return m_deviceManager->addConfiguredDevice(deviceClassId, deviceDescriptorId, newId);
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::configuredDevices().
|
||||
* \sa DeviceManager::configuredDevices(), */
|
||||
QList<Device *> GuhCore::configuredDevices() const
|
||||
{
|
||||
return m_deviceManager->configuredDevices();
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::findConfiguredDevice(\a deviceId).
|
||||
* \sa DeviceManager::findConfiguredDevice(), */
|
||||
Device *GuhCore::findConfiguredDevice(const DeviceId &deviceId) const
|
||||
{
|
||||
return m_deviceManager->findConfiguredDevice(deviceId);
|
||||
}
|
||||
|
||||
/*! Calls the metheod DeviceManager::findConfiguredDevice(\a deviceClassId).
|
||||
* \sa DeviceManager::findConfiguredDevice(), */
|
||||
QList<Device *> GuhCore::findConfiguredDevices(const DeviceClassId &deviceClassId) const
|
||||
{
|
||||
return m_deviceManager->findConfiguredDevices(deviceClassId);
|
||||
}
|
||||
|
||||
/*! Calls the metheod RuleEngine::rule().
|
||||
* \sa RuleEngine, */
|
||||
QList<Rule> GuhCore::rules() const
|
||||
{
|
||||
return m_ruleEngine->rules();
|
||||
}
|
||||
|
||||
/*! Calls the metheod RuleEngine::ruleIds().
|
||||
* \sa RuleEngine, */
|
||||
QList<RuleId> GuhCore::ruleIds() const
|
||||
{
|
||||
return m_ruleEngine->ruleIds();
|
||||
}
|
||||
|
||||
/*! Calls the metheod RuleEngine::findRule(\a ruleId).
|
||||
* \sa RuleEngine, */
|
||||
Rule GuhCore::findRule(const RuleId &ruleId)
|
||||
{
|
||||
return m_ruleEngine->findRule(ruleId);
|
||||
}
|
||||
|
||||
RuleEngine::RuleError GuhCore::addRule(const RuleId &id, const QList<EventDescriptor> &eventDescriptorList, const QList<Action> &actionList, bool enabled)
|
||||
/*! Calls the metheod RuleEngine::addRule(\a id, \a eventDescriptorList, \a actionList).
|
||||
* \sa RuleEngine, */
|
||||
RuleEngine::RuleError GuhCore::addRule(const RuleId &id, const QList<EventDescriptor> &eventDescriptorList, const QList<Action> &actionList)
|
||||
{
|
||||
return m_ruleEngine->addRule(id, eventDescriptorList, actionList, enabled);
|
||||
}
|
||||
|
||||
/*! Calls the metheod RuleEngine::removeRule(\a id).
|
||||
* \sa RuleEngine, */
|
||||
RuleEngine::RuleError GuhCore::removeRule(const RuleId &id)
|
||||
{
|
||||
return m_ruleEngine->removeRule(id);
|
||||
}
|
||||
|
||||
/*! Calls the metheod RuleEngine::findRules(\a deviceId).
|
||||
* \sa RuleEngine, */
|
||||
QList<RuleId> GuhCore::findRules(const DeviceId &deviceId)
|
||||
{
|
||||
return m_ruleEngine->findRules(deviceId);
|
||||
|
||||
Reference in New Issue
Block a user