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 HSERVICEINFO_H_
23
#define HSERVICEINFO_H_
25
#include <HUpnpCore/HUpnp>
27
#include <QtCore/QSharedDataPointer>
38
class HServiceInfoPrivate;
41
* \brief This class is used to contain information of a UPnP service
42
* found in a UPnP device description document.
44
* A device description defines a UPnP device and among other things,
45
* the definition includes the declarations of the services the device contains.
47
* \headerfile hserviceinfo.h HServiceInfo
49
* \ingroup hupnp_common
51
* \remarks This class is not thread-safe.
53
* \sa HDeviceInfo, HActionInfo and HStateVariableInfo.
55
class H_UPNP_CORE_EXPORT HServiceInfo
57
friend H_UPNP_CORE_EXPORT bool operator==(
58
const HServiceInfo& obj1, const HServiceInfo& obj2);
62
QSharedDataPointer<HServiceInfoPrivate> h_ptr;
67
* \brief Creates a new, empty instance.
74
* Constructs a new instance from the specified parameters that the UDA
75
* specification mandates for a UPnP service.
77
* The parameters the constructor expects are arguments defined in the
78
* device description document and they are all mandatory for a valid
81
* \param serviceId specifies the identifier of the service.
83
* \param serviceType specifies the type of the service.
85
* \param controlUrl specifies the URL for control.
87
* \param eventSubUrl specifies the URL for eventing.
89
* \param scpdUrl specifies the URL for service description.
91
* \param incReq specifies whether the service is required or optional.
92
* This parameter is optional.
94
* \param checkLevel specifies the level of strictness used in validating
95
* the specified arguments. This parameter is optional.
97
* \param err specifies a pointer to a \c QString that will contain
98
* an error description in case the construction failed. This is optional.
100
* \remarks in case any of the provided arguments does not meet the
101
* specified requirements, the created object is \e invalid.
106
const HServiceId& serviceId,
107
const HResourceType& serviceType,
108
const QUrl& controlUrl,
109
const QUrl& eventSubUrl,
111
HInclusionRequirement incReq = InclusionMandatory,
112
HValidityCheckLevel checkLevel = StrictChecks,
116
* \brief Destroys the instance.
121
* \brief Copy constructor.
123
* Copies the contents of the \c other to this.
125
* \param other specifies the object to be copied.
127
HServiceInfo(const HServiceInfo& other);
130
* \brief Assignment operator.
132
* Assigns the contents of the other to this.
134
* \param other specifies the object to be copied.
136
HServiceInfo& operator=(const HServiceInfo& other);
139
* \brief Indicates if the object is valid.
141
* A valid object contains the mandatory data of a UPnP service.
143
* \param level specifies the level of strictness used in validating
144
* the object. This parameter is optional and the default level is strict.
146
* \return \e true in case the object is valid.
148
bool isValid(HValidityCheckLevel level) const;
151
* \brief Returns the service identifier found in the device description file.
153
* \return The service identifier found in the device description file.
155
const HServiceId& serviceId() const;
158
* \brief Returns the type of the service found in the device description file.
160
* \return The type of the service found in the device description file.
162
const HResourceType& serviceType() const;
165
* \brief Returns the URL for service description.
167
* This is the URL where the service description can be retrieved.
168
* This is defined in the device description.
170
* \return The URL for service description.
172
QUrl scpdUrl() const;
175
* \brief Returns the URL for control.
177
* This is the URL to which the action invocations must be sent.
178
* This is defined in the device description.
180
* \return The URL for control.
182
QUrl controlUrl() const;
185
* \brief Returns the URL for eventing.
187
* This is the URL to which subscriptions and un-subscriptions are sent.
188
* This is defined in the device description.
190
* \return The URL for eventing.
192
QUrl eventSubUrl() const;
195
* \brief Indicates whether the service is required or optional.
197
* \return value indicating whether the service is required or optional.
199
HInclusionRequirement inclusionRequirement() const;
203
* Compares the two objects for equality.
205
* \return \e true in case the objects are logically equivalent.
207
* \relates HServiceInfo
209
H_UPNP_CORE_EXPORT bool operator==(const HServiceInfo&, const HServiceInfo&);
212
* Compares the two objects for inequality.
214
* \return \e true in case the objects are not logically equivalent.
216
* \relates HServiceInfo
218
inline bool operator!=(const HServiceInfo& obj1, const HServiceInfo& obj2)
220
return !(obj1 == obj2);
226
#endif /* HSERVICEINFO_H_ */