~ubuntu-branches/ubuntu/trusty/digikam/trusty

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp/src/devicemodel/hservices_setupdata.h

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-11-26 18:24:20 UTC
  • mfrom: (1.9.1) (3.1.23 experimental)
  • Revision ID: package-import@ubuntu.com-20121126182420-qoy6z0nx4ai0wzcl
Tags: 4:3.0.0~beta3-0ubuntu1
* New upstream release
  - Add build-deps :  libhupnp-dev, libqtgstreamer-dev, libmagickcore-dev
* Merge from debian, remaining changes:
  - Make sure libqt4-opengl-dev, libgl1-mesa-dev and libglu1-mesa-dev only
    install on i386,amd64 and powerpc
  - Depend on libtiff-dev instead of libtiff4-dev
  - Drop digikam breaks/replaces kipi-plugins-common since we're past the
    LTS release now
  - digikam to recommend mplayerthumbs | ffmpegthumbs. We currently only
    have latter in the archives, even though former is also supposed to
    be part of kdemultimedia. (LP: #890059)
  - kipi-plugins to recommend www-browser rather than konqueror directly
    since 2.8 no direct usage of konqueror is present in the flickr
    plugin anymore (LP: #1011211)
  - Keep kubuntu_mysqld_executable_name.diff
  - Don't install libkipi translations
  - Keep deps on libcv-dev, libcvaux-dev
  - Keep split packaging of libraries
  - Replace icons from KDE 3 time in debian/xpm.d/*.xpm with the new
    versions (LP: #658047)
* Update debian/not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2010, 2011 Tuomo Penttinen, all rights reserved.
 
3
 *
 
4
 *  Author: Tuomo Penttinen <tp@herqq.org>
 
5
 *
 
6
 *  This file is part of Herqq UPnP (HUPnP) library.
 
7
 *
 
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.
 
12
 *
 
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.
 
17
 *
 
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/>.
 
20
 */
 
21
 
 
22
#ifndef HSERVICES_SETUPDATA_H_
 
23
#define HSERVICES_SETUPDATA_H_
 
24
 
 
25
#include <HUpnpCore/HUpnp>
 
26
#include <HUpnpCore/HServiceId>
 
27
 
 
28
#include <QtCore/QHash>
 
29
#include <QtCore/QString>
 
30
#include <QtCore/QSharedDataPointer>
 
31
 
 
32
namespace Herqq
 
33
{
 
34
 
 
35
namespace Upnp
 
36
{
 
37
 
 
38
class HServiceSetupPrivate;
 
39
 
 
40
/*!
 
41
 * \brief This class is used to specify information that can be used to validate
 
42
 * a UPnP service.
 
43
 *
 
44
 * \headerfile hservices_setupdata.h HServiceSetup
 
45
 *
 
46
 * \ingroup hupnp_devicemodel
 
47
 *
 
48
 * \sa HServicesSetupData, HClientService, HServerService
 
49
 *
 
50
 * \remarks This class is not thread-safe.
 
51
 */
 
52
class H_UPNP_CORE_EXPORT HServiceSetup
 
53
{
 
54
private:
 
55
 
 
56
    QSharedDataPointer<HServiceSetupPrivate> h_ptr;
 
57
 
 
58
public:
 
59
 
 
60
    /*!
 
61
     * Creates a new, invalid instance.
 
62
     *
 
63
     * \sa isValid()
 
64
     */
 
65
    HServiceSetup();
 
66
 
 
67
    /*!
 
68
     * \brief Creates a new instance.
 
69
     *
 
70
     * \param id specifies the service ID.
 
71
     *
 
72
     * \param serviceType specifies the service type.
 
73
     *
 
74
     * \param incReq specifies the \e inclusion \e requirement of the
 
75
     * service.
 
76
     *
 
77
     * \sa isValid()
 
78
     *
 
79
     * \remarks the version() is set to 1.
 
80
     */
 
81
    HServiceSetup(
 
82
        const HServiceId& id,
 
83
        const HResourceType& serviceType,
 
84
        HInclusionRequirement incReq = InclusionMandatory);
 
85
 
 
86
    /*!
 
87
     * \brief Creates a new instance.
 
88
     *
 
89
     * \param id specifies the service ID.
 
90
     *
 
91
     * \param serviceType specifies the service type.
 
92
     *
 
93
     * \param version specifies the version of the UPnP device, which first
 
94
     * specified the service.
 
95
     *
 
96
     * \param incReq specifies the \e inclusion \e requirement of the
 
97
     * service.
 
98
     *
 
99
     * \sa isValid()
 
100
     */
 
101
    HServiceSetup(
 
102
        const HServiceId& id,
 
103
        const HResourceType& serviceType,
 
104
        int version,
 
105
        HInclusionRequirement incReq = InclusionMandatory);
 
106
 
 
107
    /*!
 
108
     * \brief Assignment operator.
 
109
     *
 
110
     * Copies the contents of \a other to this.
 
111
     */
 
112
    HServiceSetup& operator=(const HServiceSetup&);
 
113
 
 
114
    /*!
 
115
     * \brief Copy constructor.
 
116
     *
 
117
     * Creates a copy of \a other.
 
118
     */
 
119
    HServiceSetup(const HServiceSetup&);
 
120
 
 
121
    /*!
 
122
     * \brief Destroys the instance.
 
123
     */
 
124
    ~HServiceSetup();
 
125
 
 
126
    /*!
 
127
     * \brief Returns the <em>inclusion requirement</em>.
 
128
     *
 
129
     * \return The <em>inclusion requirement</em>.
 
130
     *
 
131
     * \sa setInclusionRequirement()
 
132
     */
 
133
    HInclusionRequirement inclusionRequirement() const;
 
134
 
 
135
    /*!
 
136
     * \brief Indicates if the object is valid.
 
137
     *
 
138
     * \param checkLevel specifies whether the validity of the object should be
 
139
     * checked strictly according to the UDA specification.
 
140
     *
 
141
     * \return \e true in case the object is valid, that is, the service ID,
 
142
     * service type, version and inclusion requirement are all properly defined
 
143
     * in respect to the specified \c checkLevel.
 
144
     */
 
145
    bool isValid(HValidityCheckLevel checkLevel) const;
 
146
 
 
147
    /*!
 
148
     * \brief Returns the service ID.
 
149
     *
 
150
     * \return The service ID.
 
151
     *
 
152
     * \sa setServiceId()
 
153
     */
 
154
    const HServiceId& serviceId() const;
 
155
 
 
156
    /*!
 
157
     * \brief Returns the service type.
 
158
     *
 
159
     * \return The service type.
 
160
     *
 
161
     * \sa setServiceType()
 
162
     */
 
163
    const HResourceType& serviceType() const;
 
164
 
 
165
    /*!
 
166
     * \brief Returns the version of the UPnP device, which first specified the service.
 
167
     *
 
168
     * \return The version of the UPnP device, which first specified the service.
 
169
     *
 
170
     * \sa setVersion()
 
171
     */
 
172
    int version() const;
 
173
 
 
174
    /*!
 
175
     * \brief Sets the the <em>inclusion requirement</em>.
 
176
     *
 
177
     * \param arg specifies the <em>inclusion requirement</em>.
 
178
     *
 
179
     * \sa inclusionRequirement()
 
180
     */
 
181
    void setInclusionRequirement(HInclusionRequirement arg);
 
182
 
 
183
    /*!
 
184
     * \brief Sets the service ID.
 
185
     *
 
186
     * \param arg specifies the service ID.
 
187
     *
 
188
     * \sa serviceId()
 
189
     */
 
190
    void setServiceId(const HServiceId& arg);
 
191
 
 
192
    /*!
 
193
     * \brief Sets the service type.
 
194
     *
 
195
     * \param arg specifies the service type.
 
196
     *
 
197
     * \sa serviceType()
 
198
     */
 
199
    void setServiceType(const HResourceType& arg);
 
200
 
 
201
    /*!
 
202
     * \brief Sets the version of the UPnP device, which first specified the service.
 
203
     *
 
204
     * \param version defines the version of the UPnP device,
 
205
     * which first specifies the service.
 
206
     *
 
207
     * \sa version()
 
208
     */
 
209
    void setVersion(int version);
 
210
};
 
211
 
 
212
/*!
 
213
 * Compares the two objects for equality.
 
214
 *
 
215
 * \return \e true in case the provided objects are equal, false otherwise.
 
216
 *
 
217
 * \relates HServiceSetup
 
218
 */
 
219
H_UPNP_CORE_EXPORT bool operator==(const HServiceSetup&, const HServiceSetup&);
 
220
 
 
221
/*!
 
222
 * Compares the two objects for inequality.
 
223
 *
 
224
 * \return \e true in case the provided objects are not equal, false otherwise.
 
225
 *
 
226
 * \relates HServiceSetup
 
227
 */
 
228
inline bool operator!=(const HServiceSetup& obj1, const HServiceSetup& obj2)
 
229
{
 
230
    return !(obj1 == obj2);
 
231
}
 
232
 
 
233
/*!
 
234
 * \brief This class is used to specify information that can be used to validate
 
235
 * UPnP services.
 
236
 *
 
237
 * \headerfile hservices_setupdata.h HServicesSetupData
 
238
 *
 
239
 * \ingroup hupnp_devicemodel
 
240
 *
 
241
 * \remarks This class is not thread-safe.
 
242
 */
 
243
class H_UPNP_CORE_EXPORT HServicesSetupData
 
244
{
 
245
friend H_UPNP_CORE_EXPORT bool operator==(
 
246
    const HServicesSetupData&, const HServicesSetupData&);
 
247
 
 
248
private:
 
249
 
 
250
    QHash<HServiceId, HServiceSetup> m_serviceSetupInfos;
 
251
 
 
252
public:
 
253
 
 
254
    /*!
 
255
     * \brief Creates a new, empty instance.
 
256
     *
 
257
     * \sa isEmpty()
 
258
     */
 
259
    HServicesSetupData();
 
260
 
 
261
    /*!
 
262
     * \brief Destroys the instance.
 
263
     */
 
264
    ~HServicesSetupData();
 
265
 
 
266
    /*!
 
267
     * \brief Retrieves a service setup object.
 
268
     *
 
269
     * \param id specifies the service ID of the item.
 
270
     *
 
271
     * \return The item with the specified service ID. Note that the returned item
 
272
     * is invalid, i.e. HServiceSetup::isValid() returns false in case no item
 
273
     * with the specified service ID was found.
 
274
     *
 
275
     * \sa contains()
 
276
     */
 
277
    HServiceSetup get(const HServiceId& id) const;
 
278
 
 
279
    /*!
 
280
     * \brief Indicates if the instance contains a service setup item that has the
 
281
     * specified service ID.
 
282
     *
 
283
     * \param id specifies the service ID of the item.
 
284
     *
 
285
     * \return \e true if the instance contains an item with the specified
 
286
     * service ID.
 
287
     *
 
288
     * \sa get()
 
289
     */
 
290
    bool contains(const HServiceId& id) const;
 
291
 
 
292
    /*!
 
293
     * \brief Indicates if the object is empty.
 
294
     *
 
295
     * \return \e true in case the instance has no items.
 
296
     */
 
297
    bool isEmpty() const;
 
298
 
 
299
    /*!
 
300
     * \brief Returns the number of contained items.
 
301
     *
 
302
     * \return The number of contained items.
 
303
     */
 
304
    int size() const;
 
305
 
 
306
    /*!
 
307
     * \brief Returns the service IDs of the contained items.
 
308
     *
 
309
     * \return The service IDs of the contained items.
 
310
     */
 
311
    QSet<HServiceId> serviceIds() const;
 
312
 
 
313
    /*!
 
314
     * Inserts a new item.
 
315
     *
 
316
     * \param newItem specifies the item to be added.
 
317
     *
 
318
     * \param overWrite specifies whether to replace an already existing item
 
319
     * with the same service ID. The default is \c false.
 
320
     *
 
321
     * \return \e true in case the item was added. The \a newItem will not be added
 
322
     * if the instance already contains an item that has the same
 
323
     * HServiceSetup::serviceId() as the \a newItem and the \a overWrite is
 
324
     * \c false, or the \a newItem is invalid.
 
325
     */
 
326
    bool insert(const HServiceSetup& newItem, bool overWrite = false);
 
327
 
 
328
    /*!
 
329
     * Removes an existing item.
 
330
     *
 
331
     * \param id specifies the service ID of the item to be removed.
 
332
     *
 
333
     * \return \e true in case the item was found and removed.
 
334
     */
 
335
    bool remove(const HServiceId& id);
 
336
};
 
337
 
 
338
/*!
 
339
 * Compares the two objects for equality.
 
340
 *
 
341
 * \return \e true in case the provided objects are equal, false otherwise.
 
342
 *
 
343
 * \relates HServicesSetupData
 
344
 */
 
345
H_UPNP_CORE_EXPORT bool operator==(const HServicesSetupData&, const HServicesSetupData&);
 
346
 
 
347
/*!
 
348
 * Compares the two objects for inequality.
 
349
 *
 
350
 * \return \e true in case the provided objects are not equal, false otherwise.
 
351
 *
 
352
 * \relates HServicesSetupData
 
353
 */
 
354
inline bool operator!=(const HServicesSetupData& obj1, const HServicesSetupData& obj2)
 
355
{
 
356
    return !(obj1 == obj2);
 
357
}
 
358
 
 
359
}
 
360
}
 
361
 
 
362
#endif /* HSERVICES_SETUPDATA_H_ */