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

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp/src/general/hupnp_global.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 HUPNP_GLOBAL_H_
 
23
#define HUPNP_GLOBAL_H_
 
24
 
 
25
#include <HUpnpCore/public/hupnp_fwd.h>
 
26
#include <HUpnpCore/public/hupnp_defs.h>
 
27
 
 
28
/*!
 
29
 * \file
 
30
 * This file contains public functions and enumerations.
 
31
 */
 
32
 
 
33
namespace Herqq
 
34
{
 
35
 
 
36
namespace Upnp
 
37
{
 
38
 
 
39
/*!
 
40
 * \brief This enumeration specifies the generic error codes that UPnP action invocation
 
41
 * may return.
 
42
 *
 
43
 * These values correspond to the values defined in the UDA, excluding
 
44
 * \c NotImplemented and \c UndefinedFailure, which are defined for the purposes
 
45
 * of HUPnP.
 
46
 *
 
47
 * \note These are only the generic error codes. Many UPnP devices define
 
48
 * and use domain specific error codes that cannot be specified here.
 
49
 */
 
50
enum UpnpErrorCode
 
51
{
 
52
    /*!
 
53
     * \brief Action invocation succeeded.
 
54
     *
 
55
     * Action invocation succeeded.
 
56
     */
 
57
    UpnpSuccess = 200,
 
58
 
 
59
    /*!
 
60
     * Invalid action.
 
61
     *
 
62
     * The specified action was not found.
 
63
     */
 
64
    UpnpInvalidAction = 401,
 
65
 
 
66
    /*!
 
67
     * Action invocation failed due to:
 
68
     * \li not enough arguments,
 
69
     * \li arguments in wrong order,
 
70
     * \li one or more arguments have wrong data type
 
71
     */
 
72
    UpnpInvalidArgs = 402,
 
73
 
 
74
    /*!
 
75
     * \brief The current state of the service prevents the action invocation.
 
76
     *
 
77
     * The current state of the service prevents the action invocation.
 
78
     */
 
79
    UpnpActionFailed = 501,
 
80
 
 
81
    /*!
 
82
     * \brief Action invocation failed due to an invalid argument value.
 
83
     *
 
84
     * Action invocation failed due to an invalid argument value.
 
85
     */
 
86
    UpnpArgumentValueInvalid = 600,
 
87
 
 
88
    /*!
 
89
     * Action invocation failed due to:
 
90
     * \li an argument value is less than the minimum of the allowed value range,
 
91
     * \li an argument value is more than the maximum of the allowed value range,
 
92
     * \li an argument value is not in the allowed value list
 
93
     */
 
94
    UpnpArgumentValueOutOfRange = 601,
 
95
 
 
96
    /*!
 
97
     * Action invocation failed due to the requested action being optional
 
98
     * and not implemented by the device.
 
99
     */
 
100
    UpnpOptionalActionNotImplemented = 602,
 
101
 
 
102
    /*!
 
103
     * Action invocation failed due to insufficient memory.
 
104
     *
 
105
     * The device does not have sufficient memory available to complete the action.
 
106
     * This MAY be a temporary condition; the control point MAY choose to retry the
 
107
     * unmodified request again later and it MAY succeed if memory is available.
 
108
     */
 
109
    UpnpOutOfMemory = 603,
 
110
 
 
111
    /*!
 
112
     * The device has encountered an error condition which it cannot resolve itself
 
113
     * and required human intervention such as a reset or power cycle. See the device
 
114
     * display or documentation for further guidance.
 
115
     */
 
116
    UpnpHumanInterventionRequired = 604,
 
117
 
 
118
    /*!
 
119
     * Action invocation failed due to a string argument being
 
120
     * too long for the device to handle properly.
 
121
     */
 
122
    UpnpStringArgumentTooLong = 605,
 
123
 
 
124
    /*!
 
125
     * The action invocation is in progress.
 
126
     *
 
127
     * \remarks
 
128
     * This value is defined and used by HUPnP in-process only.
 
129
     */
 
130
    UpnpInvocationInProgress = 0x00f00000,
 
131
 
 
132
    /*!
 
133
     * \brief Action invocation failed, but the exact cause could not be determined.
 
134
     *
 
135
     * Action invocation failed, but the exact cause could not be determined.
 
136
     *
 
137
     * \remarks
 
138
     * This value is defined and used by HUPnP in-process only.
 
139
     */
 
140
    UpnpUndefinedFailure = 0x0ff00000,
 
141
 
 
142
    /*!
 
143
     * The action invocation was aborted by user.
 
144
     *
 
145
     * \remarks
 
146
     * This value is defined and used by HUPnP in-process only.
 
147
     */
 
148
    UpnpInvocationAborted = 0x00f00001
 
149
};
 
150
 
 
151
/*!
 
152
 * \brief Returns a string representation of the specified error code.
 
153
 *
 
154
 * \param errCode specififes the error code.
 
155
 *
 
156
 * \return a string representation of the specified error code.
 
157
 */
 
158
QString H_UPNP_CORE_EXPORT upnpErrorCodeToString(qint32 errCode);
 
159
 
 
160
/*!
 
161
 * \brief This enumeration specifies how a device tree should be traversed given a
 
162
 * starting node.
 
163
 *
 
164
 * HUPnP \ref hupnp_devicemodel is organized into a tree that has a root
 
165
 * device, which may contain embedded devices as its children and they may contain
 
166
 * embedded devices as their children recursively.
 
167
 *
 
168
 * \brief This enumeration is used to specify how a device and its children are traversed.
 
169
 */
 
170
enum DeviceVisitType
 
171
{
 
172
    /*!
 
173
     * This value is used to indicate that only the device in question is visited.
 
174
     */
 
175
    VisitThisOnly = 0,
 
176
 
 
177
    /*!
 
178
     * This value is used to indicate that this device and its embedded devices
 
179
     * are visited.
 
180
     */
 
181
    VisitThisAndDirectChildren,
 
182
 
 
183
    /*!
 
184
     * This value is used to indicate that this device and all of its child
 
185
     * devices are visited recursively.
 
186
     */
 
187
    VisitThisRecursively
 
188
};
 
189
 
 
190
/*!
 
191
 * \brief This enumeration specifies the device types that are considered as
 
192
 * \e targets of an operation.
 
193
 */
 
194
enum TargetDeviceType
 
195
{
 
196
    /*!
 
197
     * This value is used to indicate that \b all devices, both root and
 
198
     * embedded are the targets of an operation.
 
199
     */
 
200
    AllDevices,
 
201
 
 
202
    /*!
 
203
     * This value is used to indicate that \b only embedded devices are the
 
204
     * targets of an operation.
 
205
     */
 
206
    EmbeddedDevices,
 
207
 
 
208
    /*!
 
209
     * This value is used to indicate that \b only root devices are the
 
210
     * targets of an operation.
 
211
     */
 
212
    RootDevices
 
213
};
 
214
 
 
215
/*!
 
216
 * \brief This enumeration specifies the type of a device location URL.
 
217
 */
 
218
enum LocationUrlType
 
219
{
 
220
    /*!
 
221
     * The absolute URL for the device description.
 
222
     */
 
223
    AbsoluteUrl,
 
224
 
 
225
    /*!
 
226
     * The base URL of the device. This is the URL with which the various
 
227
     * other URLs found in a device description are resolved.
 
228
     */
 
229
    BaseUrl
 
230
};
 
231
 
 
232
/*!
 
233
 * \brief This enumeration is used to specify the strictness of argument validation.
 
234
 *
 
235
 * \ingroup hupnp_common
 
236
 */
 
237
enum HValidityCheckLevel
 
238
{
 
239
    /*!
 
240
     * The arguments are validated strictly according to the UDA
 
241
     * v1.0 and v1.1 specifications.
 
242
     */
 
243
    StrictChecks,
 
244
 
 
245
    /*!
 
246
     * The validation allows slight deviations from the UDA specifications
 
247
     * in an attempt to improve interoperability. The accepted exceptions
 
248
     * have been encountered in other UPnP software that are popular enough
 
249
     * to warrant the exceptional behavior.
 
250
     */
 
251
    LooseChecks
 
252
};
 
253
 
 
254
/*!
 
255
 * \brief This enumeration specifies whether a component of the \ref hupnp_devicemodel is
 
256
 * mandatory within a specific UPnP device.
 
257
 *
 
258
 * In more detail, any component of the device model
 
259
 * (a device, a service, a state variable or an action) may be specified as
 
260
 * a mandatory or an optional part of a UPnP device; for example,
 
261
 * a UPnP device may have two mandatory embedded devices and one
 
262
 * optional embedded device. The same applies to the other components as well.
 
263
 *
 
264
 * When HUPnP builds an object model of a UPnP device, this information can be
 
265
 * used in validating a description document, or verifying that the provided
 
266
 * device tree accurately depicts a description document.
 
267
 *
 
268
 * For instance, if the author of a subclass of a HServerService has
 
269
 * specified that a particular action is mandatory, the user of the class,
 
270
 * who is the one that provides the description document, has to make sure that
 
271
 * the description document also contains the definition of the action.
 
272
 *
 
273
 * These types of mappings are optional, but they are highly useful in case
 
274
 * the component is to be used as a public part of a library.
 
275
 * They help to ensure that the implementation back-end reflects the used
 
276
 * description documents appropriately. This is important, as it is the
 
277
 * description documents that are transferred from servers to clients and it is
 
278
 * these documents that advertise what a particular UPnP device supports and
 
279
 * is capable of doing.
 
280
 *
 
281
 * From the client's perspective they are also useful in defining requirements
 
282
 * for device and service types. For instance, if you have a component that
 
283
 * expects a discovered UPnP device to contain certain services, state variables
 
284
 * and actions, HUPnP can use these requirements to filter devices that are
 
285
 * suitable in terms of advertised capabilities.
 
286
 *
 
287
 * \ingroup hupnp_common
 
288
 */
 
289
enum HInclusionRequirement
 
290
{
 
291
    /*!
 
292
     * This value indicates that the inclusion requirement for the component
 
293
     * is not specified.
 
294
     *
 
295
     * This value is used only in error situations.
 
296
     */
 
297
    InclusionRequirementUnknown = 0,
 
298
 
 
299
    /*!
 
300
     * This value indicates that the component has to be appropriately specified.
 
301
     * It is a critical error if the component is missing.
 
302
     */
 
303
    InclusionMandatory,
 
304
 
 
305
    /*!
 
306
     * This value indicates that the component is optional and may or may not be
 
307
     * specified.
 
308
     */
 
309
    InclusionOptional
 
310
};
 
311
 
 
312
 /*!
 
313
 * \brief This enumeration specifies the logging levels that can be used with the device host.
 
314
 *
 
315
 * \ingroup hupnp_common
 
316
 */
 
317
enum HLogLevel
 
318
{
 
319
    /*!
 
320
     * No logs are generated.
 
321
     *
 
322
     * \remark by default, HUPnP uses this logging level.
 
323
     */
 
324
    None = 0,
 
325
 
 
326
    /*!
 
327
     * Only fatal messages are logged. Most often a fatal message is
 
328
     * followed by termination of the application.
 
329
     */
 
330
    Fatal = 1,
 
331
 
 
332
    /*!
 
333
     * Only critical and fatal messages are logged. Most often a critical message
 
334
     * signals a severe runtime error.
 
335
     */
 
336
    Critical = 2,
 
337
 
 
338
    /*!
 
339
     * Messages with level set to warning, critical and fatal are logged.
 
340
     * A warning message usually signifies an error or exceptional situation
 
341
     * that should be noted. Most often the system stability is not at stake
 
342
     * when warning messages appear, but they may still indicate that some
 
343
     * component, internal or external, is not functioning correctly.
 
344
     * Usually the source of warnings should be investigated.
 
345
     */
 
346
    Warning = 3,
 
347
 
 
348
    /*!
 
349
     * All but debug level messages are logged. An informational message is used
 
350
     * to log status information of control flow. A good example of an informational
 
351
     * message is when a sizable component logs the start of an initialization procedure.
 
352
     */
 
353
    Information = 4,
 
354
 
 
355
    /*!
 
356
     * All up to the debug messages are output. This excludes only the function
 
357
     * enter and exit messages.
 
358
     *
 
359
     * \remark Enabling this level of logging has notable effect on performance.
 
360
     * This generally should be used only for debugging purposes.
 
361
     */
 
362
    Debug = 5,
 
363
 
 
364
    /*!
 
365
     * Every log message is output. This includes even the function enters
 
366
     * and exits.
 
367
     *
 
368
     * \remark Enabling this level of logging has severe effect on performance.
 
369
     * This is very rarely needed and usually the debug level is far more helpful.
 
370
     */
 
371
    All = 6
 
372
};
 
373
 
 
374
/*!
 
375
 * \brief Sets the logging level the HUPnP should use.
 
376
 *
 
377
 * \param level specifies the desired logging level.
 
378
 *
 
379
 * \remark
 
380
 * \li The new logging level will take effect immediately.
 
381
 * \li The function is thread-safe.
 
382
 *
 
383
 * \ingroup hupnp_common
 
384
 */
 
385
void H_UPNP_CORE_EXPORT SetLoggingLevel(HLogLevel level);
 
386
 
 
387
/*!
 
388
 * Enables / disables warnings that relate to non-standard behavior discovered
 
389
 * in other UPnP software.
 
390
 *
 
391
 * Most often if non-standard behavior in other UPnP software is discovered, it
 
392
 * isn't fatal or critical and it may be possible to inter-operate with the software.
 
393
 * However, deviations from the specifications and standards are unfortunate and such
 
394
 * \b errors should be fixed.
 
395
 *
 
396
 * Regardless, you may not want to be notified about these warnings in which
 
397
 * case you can specifically disable all the warnings that relate to non-standard
 
398
 * behavior.
 
399
 *
 
400
 * \param arg specifies whether to output warnings that are about non-standard
 
401
 * behavior in other UPnP software.
 
402
 *
 
403
 * \remark by default, the non standard behavior warnings are on.
 
404
 *
 
405
 * \ingroup hupnp_common
 
406
 */
 
407
void H_UPNP_CORE_EXPORT EnableNonStdBehaviourWarnings(bool arg);
 
408
 
 
409
}
 
410
}
 
411
 
 
412
#endif /* HUPNP_GLOBAL_H_ */