add documentation

This commit is contained in:
Simon Stürz 2015-05-07 23:04:31 +02:00 committed by Michael Zanetti
parent 265207914a
commit 4c022b6a7e
4 changed files with 52 additions and 4 deletions

View File

@ -93,6 +93,10 @@
The \l{Device} is currently bussy.
\value DeviceErrorPairingTransactionIdNotFound
Couldn't find the PairingTransactionId for the given id.
\value DeviceErrorAuthentificationFailure
The device could not authentificate with something.
\value DeviceErrorParameterNotEditable
One of the given device params is not editable.
*/
/*! \enum DeviceManager::DeviceSetupStatus
@ -121,6 +125,26 @@
\l{StateType} and the \a value parameter holds the new value.
*/
/*! \fn void DeviceManager::deviceRemoved(const DeviceId &deviceId);
This signal is emitted when the \l{Device} with the given \a deviceId was removed from the system. This signal will
create the Devices.DeviceRemoved notification.
*/
/*! \fn void DeviceManager::deviceAdded(Device *device);
This signal is emitted when a \a \device was added to the system. This signal will
create the Devices.DeviceAdded notification.
*/
/*! \fn void DeviceManager::deviceParamsChanged(Device *device);
This signal is emitted when a \a \device was changed in the system (by edit or rediscover). This signal will
create the Devices.DeviceParamsChanged notification.
*/
/*! \fn void DeviceManager::deviceEditFinished(Device *device, DeviceError status);
This signal is emitted when the edit process of a \a device is finished. The \a status parameter describes the
\l{DeviceManager::DeviceError}{DeviceError} that occurred.
*/
/*! \fn void DeviceManager::devicesDiscovered(const DeviceClassId &deviceClassId, const QList<DeviceDescriptor> &devices);
This signal is emitted when the discovery of a \a deviceClassId is finished. The \a devices parameter describes the
list of \l{DeviceDescriptor}{DeviceDescriptors} of all discovered \l{Device}{Devices}.
@ -325,7 +349,13 @@ DeviceManager::DeviceError DeviceManager::addConfiguredDevice(const DeviceClassI
return addConfiguredDeviceInternal(deviceClassId, descriptor.params(), deviceId);
}
DeviceManager::DeviceError DeviceManager::editDevice(const DeviceId &deviceId, const ParamList &params, const bool fromDiscovery)
/*! Edit the \l{ParamList}{Params} of a configured device with the given \a deviceId to the new given \a params.
* The given parameter \a fromDiscovery specifies if the new \a params came
* from a discovery or if the user set them. If it came from discovery not editable will be changed too.
*
* Returns \l{DeviceError} to inform about the result. */
DeviceManager::DeviceError DeviceManager::editDevice(const DeviceId &deviceId, const ParamList &params, const bool &fromDiscovery)
{
Device *device = findConfiguredDevice(deviceId);
if (!device) {
@ -389,6 +419,13 @@ DeviceManager::DeviceError DeviceManager::editDevice(const DeviceId &deviceId, c
return DeviceErrorNoError;
}
/*! Edit the \l{Param}{Params} of a configured device to the \l{Param}{Params} of the DeviceDescriptor with the
* given \a deviceId to the given DeviceDescriptorId.
* Only devices with \l{DeviceClass}{CreateMethodDiscovery} can be changed using this method.
* The \a deviceDescriptorId must refer to an existing DeviceDescriptorId from the discovery.
* This method allows to rediscover a device and update it's \l{Param}{Params}.
*
* Returns \l{DeviceError} to inform about the result. */
DeviceManager::DeviceError DeviceManager::editDevice(const DeviceId &deviceId, const DeviceDescriptorId &deviceDescriptorId)
{
Device *device = findConfiguredDevice(deviceId);

View File

@ -99,7 +99,7 @@ public:
DeviceError addConfiguredDevice(const DeviceClassId &deviceClassId, const ParamList &params, const DeviceId id = DeviceId::createDeviceId());
DeviceError addConfiguredDevice(const DeviceClassId &deviceClassId, const DeviceDescriptorId &deviceDescriptorId, const DeviceId &id = DeviceId::createDeviceId());
DeviceError editDevice(const DeviceId &deviceId, const ParamList &params, const bool fromDiscovery = false);
DeviceError editDevice(const DeviceId &deviceId, const ParamList &params, const bool &fromDiscovery = false);
DeviceError editDevice(const DeviceId &deviceId, const DeviceDescriptorId &deviceDescriptorId);
DeviceError pairDevice(const PairingTransactionId &pairingTransactionId, const DeviceClassId &deviceClassId, const ParamList &params);

View File

@ -333,6 +333,15 @@ DeviceManager::DeviceSetupStatus DevicePlugin::setupDevice(Device *device)
return DeviceManager::DeviceSetupStatusSuccess;
}
/*! This will be called when the \l{ParamList}{Params} of the given \a device was changed.
* Here you have the chance to set up the device with the new \l{ParamList}{Params} without creating a new one.
*
* Return \l{DeviceManager}{DeviceSetupStatusFailure} if something bad happened during the setup in which case the \a device
* will be disabled. Return \l{DeviceManager}{DeviceSetupStatusSuccess} if everything went well. If you can't tell yet and
* need more time to set up the \a device (note: you should never block in this method) you can
* return \l{DeviceManager}{DeviceSetupStatusAsync}. In that case the \l{DeviceManager} will wait for you to emit
* \l{DevicePlugin}{deviceSetupFinished} to report the status.
*/
DeviceManager::DeviceSetupStatus DevicePlugin::editDevice(Device *device)
{
Q_UNUSED(device)

View File

@ -33,9 +33,9 @@
\sa Event, EventDescriptor, Rule, RuleAction
*/
/*! \fn void RuleEngine::ruleAdded(const RuleId &ruleId)
/*! \fn void RuleEngine::ruleAdded(const Rule &rule)
Will be emitted whenever a new \l{Rule} is added to this Engine.
\a ruleId holds the id of the new rule.*/
The \a rule parameter holds the entire new rule.*/
/*! \fn void RuleEngine::ruleRemoved(const RuleId &ruleId)
Will be emitted whenever a \l{Rule} is removed from this Engine.
@ -63,6 +63,8 @@
One of the given \l{Param}{Params} is missing.
\value RuleErrorInvalidRuleActionParameter
One of the given \l{RuleActionParam}{RuleActionParams} is not valid.
\value RuleErrorTypesNotMatching
One of the RuleActionParams type does not match with the corresponding EventParam type.
*/
/*! \enum RuleEngine::RemovePolicy