2
* Copyright (C) 2010, 2011 Tuomo Penttinen, all rights reserved.
4
* Author: Tuomo Penttinen <tp@herqq.org>
6
* This file is part of Herqq UPnP (HUPnP) library.
8
* Herqq UPnP is free software: you can redistribute it and/or modify
9
* it under the terms of the GNU Lesser General Public License as published by
10
* the Free Software Foundation, either version 3 of the License, or
11
* (at your option) any later version.
13
* Herqq UPnP is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public License
19
* along with Herqq UPnP. If not, see <http://www.gnu.org/licenses/>.
22
#ifndef HDEVICEMODEL_INFOPROVIDER_H_
23
#define HDEVICEMODEL_INFOPROVIDER_H_
25
#include <HUpnpCore/HClonable>
33
class HDeviceModelInfoProviderPrivate;
36
* A protocol class for providing information that is used to validate
37
* components of UPnP's device architecture and to setup components of
38
* HUPnP's device model.
40
* The main purpose of this class is to define an interface that enables the
41
* users to provide information that HUPnP can use for verification and
42
* validation purposes. Although optional, this information can be especially
43
* useful when provided to HDeviceHost via HDeviceHostConfiguration. This enables
44
* HUPnP to use the information to verify that device and service descriptions
45
* are setup according to the specified information.
47
* The benefit of this is that your custom device model components can rest
48
* assured that all the required state variables, actions, services and
49
* embedded devices are properly defined and initialized before the instantiation
50
* of the HUPnP's device model (device tree) is published for control points to use.
52
* The benefits of this may be somewhat difficult to realize at first, since most
53
* of the time it is you, the user, who provides the implementation and
54
* the description documents. Apart from inadvertent mistakes, you usually
55
* get those right. However, when someone else provides the implementation of
56
* the HUPnP's device model or the description documents, mismatches can easily
57
* occur and this is where the benefits of this additional information are truly
58
* useful. Remember, in UPnP architecture the description documents are used to
59
* marshal device model information from servers to clients. If the description
60
* documents do not accurately reflect the server-side implementation, the
61
* client-side may not be able to correctly invoke the server-side.
63
* \headerfile hdevicemodel_infoprovider.h HDeviceModelInfoProvider
65
* \ingroup hupnp_devicemodel
67
* \sa hupnp_devicehosting, HDeviceHostConfiguration
69
class H_UPNP_CORE_EXPORT HDeviceModelInfoProvider :
72
H_DISABLE_COPY(HDeviceModelInfoProvider)
77
* \brief Creates a new instance.
79
HDeviceModelInfoProvider();
82
* \brief Destroys the instance.
84
virtual ~HDeviceModelInfoProvider() = 0;
87
* \brief Returns information of the services the specified device type may contain.
89
* \param info specifies the device type.
91
* \return information of the services the specified device type may contain.
93
virtual HServicesSetupData servicesSetupData(const HDeviceInfo& info) const;
96
* \brief Returns information of the embedded devices the specified device type may contain.
98
* \param info specifies the device type.
100
* \return information of the embedded devices the specified device type may contain.
102
virtual HDevicesSetupData embedddedDevicesSetupData(
103
const HDeviceInfo& info) const;
106
* \brief Returns information of the actions the specified service type may contain.
108
* \param serviceInfo specifies the service type.
110
* \param parentDeviceInfo specifies information about the parent UPnP device
111
* that contains this service.
113
* \return information of the actions the specified service type may contain.
115
virtual HActionsSetupData actionsSetupData(
116
const HServiceInfo& serviceInfo, const HDeviceInfo& parentDeviceInfo) const;
119
* \brief Returns information of the state variables the specified service type
122
* \param serviceInfo specifies the service type.
124
* \param parentDeviceInfo specifies information about the parent UPnP device
125
* that contains this service.
127
* \return information of the state variables the specified service type
130
virtual HStateVariablesSetupData stateVariablesSetupData(
131
const HServiceInfo& serviceInfo, const HDeviceInfo& parentDeviceInfo) const;
134
// Documented in HClonable
135
virtual HDeviceModelInfoProvider* clone() const;
141
#endif /* HDEVICEMODEL_INFOPROVIDER_H_ */