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

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp_av/src/controlpoint/hav_controlpoint_configuration.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) 2011 Tuomo Penttinen, all rights reserved.
 
3
 *
 
4
 *  Author: Tuomo Penttinen <tp@herqq.org>
 
5
 *
 
6
 *  This file is part of Herqq UPnP Av (HUPnPAv) library.
 
7
 *
 
8
 *  Herqq UPnP Av is free software: you can redistribute it and/or modify
 
9
 *  it under the terms of the GNU 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 Av 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 General Public License for more details.
 
17
 *
 
18
 *  You should have received a copy of the GNU General Public License
 
19
 *  along with Herqq UPnP Av. If not, see <http://www.gnu.org/licenses/>.
 
20
 */
 
21
 
 
22
#ifndef HAV_CONTROLPOINT_CONFIGURATION_H_
 
23
#define HAV_CONTROLPOINT_CONFIGURATION_H_
 
24
 
 
25
#include <HUpnpAv/HUpnpAv>
 
26
#include <HUpnpCore/HClonable>
 
27
 
 
28
class QHostAddress;
 
29
 
 
30
namespace Herqq
 
31
{
 
32
 
 
33
namespace Upnp
 
34
{
 
35
 
 
36
namespace Av
 
37
{
 
38
 
 
39
class HAvControlPointConfigurationPrivate;
 
40
 
 
41
/*!
 
42
 * Class for specifying initialization information to HAvControlPoint instances.
 
43
 *
 
44
 * \brief This class is used to pass initialization information for HAvControlPoint
 
45
 * instances. The use of this is optional and an HAvControlPoint instance is
 
46
 * perfectly functional with the default configuration.
 
47
 *
 
48
 * However, you can configure an HAvControlPoint in following ways:
 
49
 * - Define what UPnP A/V device types the control point should look for.
 
50
 * - Define whether an HAvControlPoint should subscribe to events when a
 
51
 * device has been discovered by using setSubscribeToEvents().
 
52
 * By default an HAvControlPoint instances subscribes to all events.
 
53
 * - Set the timeout request for event subscriptions with setDesiredSubscriptionTimeout().
 
54
 * The default is 30 minutes.
 
55
 * - Specify whether an HAvControlPoint should perform initial discovery upon
 
56
 * startup using setAutoDiscovery(). The default is yes.
 
57
 * - Specify the network addresses an HAvControlPoint should use in its operations
 
58
 * with setNetworkAddressesToUse().
 
59
 * The default is the first found interface that is up. Non-loopback interfaces
 
60
 * have preference, but if none are found the loopback is used. However, in this
 
61
 * case UDP multicast is not available.
 
62
 *
 
63
 * \headerfile hav_controlpoint_configuration.h HAvControlPointConfiguration
 
64
 *
 
65
 * \ingroup hupnp_av_cp
 
66
 *
 
67
 * \sa HAvControlPoint
 
68
 *
 
69
 * \remarks This class is not thread-safe.
 
70
 */
 
71
class H_UPNP_AV_EXPORT HAvControlPointConfiguration :
 
72
    public HClonable
 
73
{
 
74
H_DISABLE_COPY(HAvControlPointConfiguration)
 
75
H_DECLARE_PRIVATE(HAvControlPointConfiguration)
 
76
 
 
77
protected:
 
78
 
 
79
    // Documented in HClonable
 
80
    virtual void doClone(HClonable*) const;
 
81
 
 
82
    // Documented in HClonable
 
83
    virtual HAvControlPointConfiguration* newInstance() const;
 
84
 
 
85
    HAvControlPointConfigurationPrivate* h_ptr;
 
86
 
 
87
public:
 
88
 
 
89
    /*!
 
90
     * \brief This enumeration is used to specify the device types the HAvControlPoint
 
91
     * should search and use.
 
92
     */
 
93
    enum InterestingDeviceType
 
94
    {
 
95
        /*!
 
96
         * No device types should be accepted.
 
97
         */
 
98
        None = 0,
 
99
 
 
100
        /*!
 
101
         * Media Renderers should be accepted.
 
102
         */
 
103
        MediaRenderer = 0x01,
 
104
 
 
105
        /*!
 
106
         * Media Servers should be accepted.
 
107
         */
 
108
        MediaServer = 0x02,
 
109
 
 
110
        /*!
 
111
         * All device types should be accepted.
 
112
         *
 
113
         * \remarks This is the default value.
 
114
         */
 
115
        All = 0x1f
 
116
    };
 
117
 
 
118
    Q_DECLARE_FLAGS(InterestingDeviceTypes, InterestingDeviceType)
 
119
 
 
120
    /*!
 
121
     * \brief Creates a new instance.
 
122
     *
 
123
     * Creates a new instance with default values.
 
124
     */
 
125
    HAvControlPointConfiguration();
 
126
 
 
127
    /*!
 
128
     * \brief Destroys the instance.
 
129
     */
 
130
    virtual ~HAvControlPointConfiguration();
 
131
 
 
132
    /*!
 
133
     * \brief Returns a deep copy of the instance.
 
134
     *
 
135
     * \return a deep copy of the instance.
 
136
     *
 
137
     * \remarks
 
138
     * \li The ownership of the returned object is transferred to the caller.
 
139
     */
 
140
    virtual HAvControlPointConfiguration* clone() const;
 
141
 
 
142
    /*!
 
143
     * \brief Returns the device types the HAvControlPoint should search, accept and
 
144
     * use.
 
145
     *
 
146
     * \return The device types the HAvControlPoint should search, accept and
 
147
     * use.
 
148
     *
 
149
     * \sa setInterestingDeviceTypes()
 
150
     */
 
151
    InterestingDeviceTypes interestingDeviceTypes() const;
 
152
 
 
153
    /*!
 
154
     * \brief Indicates whether the control point should run discovery upon
 
155
     * initialization.
 
156
     *
 
157
     * \return \e true in case the the control point should run discovery upon
 
158
     * initialization. This is the default value.
 
159
     *
 
160
     * \remarks if the discovery is not performed the control point will be
 
161
     * unaware of UPnP devices that are already active in the network until they
 
162
     * re-advertise themselves.
 
163
     *
 
164
     * \sa setAutoDiscovery()
 
165
     */
 
166
    bool autoDiscovery() const;
 
167
 
 
168
    /*!
 
169
     * \brief Returns the network addresses a control point should use in its
 
170
     * operations.
 
171
     *
 
172
     * \return The network addresses a control point should use in its
 
173
     * operations.
 
174
     *
 
175
     * \sa setNetworkAddressesToUse()
 
176
     */
 
177
    QList<QHostAddress> networkAddressesToUse() const;
 
178
 
 
179
    /*!
 
180
     * \brief Indicates whether to automatically subscribe to all events on all services
 
181
     * of a device when a new device is added into the control of an HAvControlPoint.
 
182
     *
 
183
     * \return \e true in case the HAvControlPoint instance should subscribe to all
 
184
     * events of all services of a newly added device.
 
185
     *
 
186
     * \sa setSubscribeToEvents()
 
187
     */
 
188
    bool subscribeToEvents() const;
 
189
 
 
190
    /*!
 
191
     * \brief Returns the subscription timeout a control point requests when it subscribes
 
192
     * to an evented service.
 
193
     *
 
194
     * The default value is 30 minutes.
 
195
     *
 
196
     * \return The subscription timeout in seconds a control point requests
 
197
     * when it subscribes to an evented service.
 
198
     *
 
199
     * \sa setDesiredSubscriptionTimeout()
 
200
     */
 
201
    qint32 desiredSubscriptionTimeout() const;
 
202
 
 
203
    /*!
 
204
     * \brief Sets the device types the HAvControlPoint should search, accept and
 
205
     * use.
 
206
     *
 
207
     * \param types specifies the device types the HAvControlPoint should
 
208
     * search, accept and use.
 
209
     *
 
210
     * \sa interestingDeviceTypes()
 
211
     */
 
212
     void setInterestingDeviceTypes(InterestingDeviceTypes types) const;
 
213
 
 
214
    /*!
 
215
     * Defines whether a control point should automatically subscribe to all
 
216
     * events on all services of a device when a new device is added
 
217
     * into the control of an HAvControlPoint.
 
218
     *
 
219
     * \param subscribeAutomatically when \e true an HAvControlPoint instance
 
220
     * should by default subscribe to all events of all services of a newly added
 
221
     * device.
 
222
     *
 
223
     * \sa subscribeToEvents()
 
224
     */
 
225
    void setSubscribeToEvents(bool subscribeAutomatically);
 
226
 
 
227
    /*!
 
228
     * \brief Sets the subscription timeout a control point requests when it subscribes
 
229
     * to an evented service.
 
230
     *
 
231
     * Values less than or equal to zero are rejected and instead the default value
 
232
     * is used. The default value is 30 minutes.
 
233
     *
 
234
     * \param timeout specifies the requested timeout in seconds.
 
235
     *
 
236
     * \sa desiredSubscriptionTimeout()
 
237
     */
 
238
    void setDesiredSubscriptionTimeout(qint32 timeout);
 
239
 
 
240
    /*!
 
241
     * Defines whether the control point should perform discovery upon
 
242
     * initialization.
 
243
     *
 
244
     * \param arg when \e true an HAvControlPoint instance will perform discovery
 
245
     * when it is initialized. This is the default.
 
246
     *
 
247
     * \remarks if the discovery is not performed the control point will be
 
248
     * unaware of UPnP devices that are already active in the network until they
 
249
     * re-advertise themselves.
 
250
     *
 
251
     * \sa autoDiscovery()
 
252
     */
 
253
    void setAutoDiscovery(bool arg);
 
254
 
 
255
    /*!
 
256
     * Defines the network addresses the control point should use in its
 
257
     * operations.
 
258
     *
 
259
     * \param addresses specifies the network addresses the control point
 
260
     * should use in its operations.
 
261
     *
 
262
     * \return \e true in case the provided addresses are valid and can be
 
263
     * used.
 
264
     *
 
265
     * \sa networkAddressesToUse()
 
266
     */
 
267
    bool setNetworkAddressesToUse(const QList<QHostAddress>& addresses);
 
268
};
 
269
 
 
270
Q_DECLARE_OPERATORS_FOR_FLAGS(HAvControlPointConfiguration::InterestingDeviceTypes)
 
271
 
 
272
}
 
273
}
 
274
}
 
275
 
 
276
#endif /* HAV_CONTROLPOINT_CONFIGURATION_H_ */