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

« back to all changes in this revision

Viewing changes to extra/kipi-plugins/dlnaexport/extra/hupnp_av/src/connectionmanager/hconnectionmanager_adapter.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 HCONNECTIONMANAGER_H_
 
23
#define HCONNECTIONMANAGER_H_
 
24
 
 
25
#include <HUpnpAv/HConnectionManagerInfo>
 
26
 
 
27
#include <HUpnpCore/HClientServiceAdapter>
 
28
 
 
29
namespace Herqq
 
30
{
 
31
 
 
32
namespace Upnp
 
33
{
 
34
 
 
35
namespace Av
 
36
{
 
37
 
 
38
class HConnectionManagerAdapterPrivate;
 
39
 
 
40
/*!
 
41
 * \brief This is a convenience class for using a ConnectionManager service.
 
42
 *
 
43
 * This class that provides a simple asynchronous API for
 
44
 * accessing server-side ConnectionManager service from the client-side.
 
45
 * The class can be instantiated with a HClientService that
 
46
 * provides the mandatory functionality of a ConnectionManager.
 
47
 *
 
48
 * For more information,
 
49
 * see <a href=http://upnp.org/specs/av/UPnP-av-ConnectionManager-v2-Service.pdf>
 
50
 * UPnP ConnectionManager:2 specification</a>.
 
51
 *
 
52
 * \headerfile hconnectionmanager.h HConnectionManagerAdapter
 
53
 *
 
54
 * \ingroup hupnp_av_cm
 
55
 *
 
56
 * \remarks This class is not thread-safe.
 
57
 */
 
58
class H_UPNP_AV_EXPORT HConnectionManagerAdapter :
 
59
    public HClientServiceAdapter
 
60
{
 
61
Q_OBJECT
 
62
H_DISABLE_COPY(HConnectionManagerAdapter)
 
63
H_DECLARE_PRIVATE(HConnectionManagerAdapter)
 
64
 
 
65
private Q_SLOTS:
 
66
 
 
67
    void sourceProtocolInfoChanged_(
 
68
        const Herqq::Upnp::HClientStateVariable* source,
 
69
        const Herqq::Upnp::HStateVariableEvent& event);
 
70
 
 
71
    void sinkProtocolInfoChanged_(
 
72
        const Herqq::Upnp::HClientStateVariable* source,
 
73
        const Herqq::Upnp::HStateVariableEvent& event);
 
74
 
 
75
    void currentConnectionIDsChanged_(
 
76
        const Herqq::Upnp::HClientStateVariable* source,
 
77
        const Herqq::Upnp::HStateVariableEvent& event);
 
78
 
 
79
protected:
 
80
 
 
81
    virtual bool prepareService(HClientService* service);
 
82
 
 
83
public:
 
84
 
 
85
    /*!
 
86
     * \brief Creates a new instance.
 
87
     *
 
88
     * \param parent specifies the \c QObject parent.
 
89
     */
 
90
    HConnectionManagerAdapter(QObject* parent = 0);
 
91
 
 
92
    /*!
 
93
     * \brief Destroys the instance.
 
94
     */
 
95
    virtual ~HConnectionManagerAdapter();
 
96
 
 
97
    /*!
 
98
     * \brief Retrieves the protocol related information this instance supports in its
 
99
     * current state.
 
100
     *
 
101
     * \return The ID used to identify the asynchronous operation. The returned
 
102
     * object is null, i.e. HClientAdapterOp<HProtocolInfoResult>::isNull() returns
 
103
     * \e true in case the object is not ready for use.
 
104
     *
 
105
     * \remarks This is an asynchronous method.
 
106
     *
 
107
     * \sa isReady(), getProtocolInfoCompleted()
 
108
     */
 
109
    HClientAdapterOp<HProtocolInfoResult> getProtocolInfo();
 
110
 
 
111
    /*!
 
112
     * \brief Prepares the device for the purpose of sending or receiving data.
 
113
     *
 
114
     * \param remoteProtocolInfo specifies the protocol-related information
 
115
     * that \b must be used to transfer the content.
 
116
     *
 
117
     * \param peerConnectionManager specifies the ConnectionManager service on
 
118
     * the other side of the connection.
 
119
     *
 
120
     * \param peerConnectionId specifies the ID of the connection the peer
 
121
     * ConnectionManager has allocated for this connection. This can be set to
 
122
     * \c -1 if the ID is not known. This is the case if the peer does not
 
123
     * implement this action or prepareForConnection() has not been invoked on
 
124
     * that ConnectionManager yet.
 
125
     *
 
126
     * \param direction specifies the direction to which data will be sent
 
127
     * using the new connection.
 
128
     *
 
129
     * \return The ID used to identify the asynchronous operation. The returned
 
130
     * object is invalid in case the object is not ready for use or the target
 
131
     * UPnP device does not support this optional action.
 
132
     *
 
133
     * \remarks This is an asynchronous method.
 
134
     *
 
135
     * \sa isReady(), prepareForConnectionCompleted()
 
136
     */
 
137
    HClientAdapterOp<HPrepareForConnectionResult> prepareForConnection(
 
138
        const HProtocolInfo& remoteProtocolInfo,
 
139
        const HConnectionManagerId& peerConnectionManager,
 
140
        qint32 peerConnectionId,
 
141
        HConnectionManagerInfo::Direction direction);
 
142
 
 
143
    /*!
 
144
     * \brief Informs the device that a previously \e prepared connection is no longer
 
145
     * needed.
 
146
     *
 
147
     * \param connectionId specifies the ID of the connection.
 
148
     *
 
149
     * \return The ID used to identify the asynchronous operation. The returned
 
150
     * object is invalid in case the object is not ready for use or the target
 
151
     * UPnP device does not support this optional action.
 
152
     *
 
153
     * \remarks This is an asynchronous method.
 
154
     *
 
155
     * \sa isReady(), connectionCompleteCompleted()
 
156
     */
 
157
    HClientAdapterOpNull connectionComplete(qint32 connectionId);
 
158
 
 
159
    /*!
 
160
     * \brief Returns the IDs of currently active connections.
 
161
     *
 
162
     * \return The ID used to identify the asynchronous operation. The returned
 
163
     * object is invalid in case the object is not ready for use.
 
164
     *
 
165
     * \remarks This is an asynchronous method.
 
166
     *
 
167
     * \sa isReady(), getCurrentConnectionIDsCompleted()
 
168
     */
 
169
    HClientAdapterOp<QList<quint32> > getCurrentConnectionIDs();
 
170
 
 
171
    /*!
 
172
     * \brief Returns information of the specified connection.
 
173
     *
 
174
     * \param connectionId specifies the connection.
 
175
     *
 
176
     * \return The ID used to identify the asynchronous operation. The returned
 
177
     * object is invalid in case the object is not ready for use.
 
178
     *
 
179
     * \remarks This is an asynchronous method.
 
180
     *
 
181
     * \sa isReady(), getCurrentConnectionInfoCompleted()
 
182
     */
 
183
    HClientAdapterOp<HConnectionInfo> getCurrentConnectionInfo(qint32 connectionId);
 
184
 
 
185
Q_SIGNALS:
 
186
 
 
187
    /*!
 
188
     * \brief This signal is emitted when getProtocolInfo() has completed.
 
189
     *
 
190
     * \param source specifies the HConnectionManagerAdapter instance that
 
191
     * sent the event.
 
192
     *
 
193
     * \param op specifies the asynchronous operation previously started by
 
194
     * getProtocolInfo().
 
195
     *
 
196
     * \sa getProtocolInfo()
 
197
     */
 
198
    void getProtocolInfoCompleted(
 
199
        Herqq::Upnp::Av::HConnectionManagerAdapter* source,
 
200
        const Herqq::Upnp::HClientAdapterOp<Herqq::Upnp::Av::HProtocolInfoResult>& op);
 
201
 
 
202
    /*!
 
203
     * \brief This signal is emitted when prepareForConnection() has completed.
 
204
     *
 
205
     * \param source specifies the HConnectionManagerAdapter instance that
 
206
     * sent the event.
 
207
     *
 
208
     * \param op specifies the asynchronous operation previously started by
 
209
     * prepareForConnection().
 
210
     *
 
211
     * \sa prepareForConnection()
 
212
     */
 
213
    void prepareForConnectionCompleted(
 
214
        Herqq::Upnp::Av::HConnectionManagerAdapter* source,
 
215
        const Herqq::Upnp::HClientAdapterOp<Herqq::Upnp::Av::HPrepareForConnectionResult>& op);
 
216
 
 
217
    /*!
 
218
     * \brief This signal is emitted when connectionComplete() has completed.
 
219
     *
 
220
     * \param source specifies the HConnectionManagerAdapter instance that
 
221
     * sent the event.
 
222
     *
 
223
     * \param op specifies the asynchronous operation previously started by
 
224
     * connectionComplete().
 
225
     *
 
226
     * \sa connectionComplete()
 
227
     */
 
228
    void connectionCompleteCompleted(
 
229
        Herqq::Upnp::Av::HConnectionManagerAdapter* source,
 
230
        const Herqq::Upnp::HClientAdapterOpNull& op);
 
231
 
 
232
    /*!
 
233
     * \brief This signal is emitted when getCurrentConnectionIDs() has completed.
 
234
     *
 
235
     * \param source specifies the HConnectionManagerAdapter instance that
 
236
     * sent the event.
 
237
     *
 
238
     * \param op specifies the asynchronous operation previously started by
 
239
     * getCurrentConnectionIDs().
 
240
     *
 
241
     * \sa getCurrentConnectionIDs()
 
242
     */
 
243
    void getCurrentConnectionIDsCompleted(
 
244
        Herqq::Upnp::Av::HConnectionManagerAdapter* source,
 
245
        const Herqq::Upnp::HClientAdapterOp<QList<quint32> >& op);
 
246
 
 
247
    /*!
 
248
     * \brief This signal is emitted when getCurrentConnectionInfo() has completed.
 
249
     *
 
250
     * \param source specifies the HConnectionManagerAdapter instance that
 
251
     * sent the event.
 
252
     *
 
253
     * \param op specifies the asynchronous operation previously started by
 
254
     * getCurrentConnectionInfo().
 
255
     *
 
256
     * \sa getCurrentConnectionInfo()
 
257
     */
 
258
    void getCurrentConnectionInfoCompleted(
 
259
        Herqq::Upnp::Av::HConnectionManagerAdapter* source,
 
260
        const Herqq::Upnp::HClientAdapterOp<Herqq::Upnp::Av::HConnectionInfo>& op);
 
261
 
 
262
    /*!
 
263
     * \brief This signal is emitted when the SourceProtocolInfo state variable
 
264
     * changes at the server side.
 
265
     *
 
266
     * \param source specifies the HConnectionManagerAdapter instance that
 
267
     * sent the event.
 
268
     *
 
269
     * \param newValue specifies the new value of the SourceProtocolInfo state
 
270
     * variable.
 
271
     *
 
272
     * \sa sinkProtocolInfoChanged()
 
273
     */
 
274
    void sourceProtocolInfoChanged(
 
275
        Herqq::Upnp::Av::HConnectionManagerAdapter* source,
 
276
        const Herqq::Upnp::Av::HProtocolInfos& newValue);
 
277
 
 
278
    /*!
 
279
     * \brief This signal is emitted when the SinkProtocolInfo state variable
 
280
     * changes at the server side.
 
281
     *
 
282
     * \param source specifies the HConnectionManagerAdapter instance that
 
283
     * sent the event.
 
284
     *
 
285
     * \param newValue specifies the new value of the SinkProtocolInfo state
 
286
     * variable.
 
287
     *
 
288
     * \sa sourceProtocolInfoChanged()
 
289
     */
 
290
    void sinkProtocolInfoChanged(
 
291
        Herqq::Upnp::Av::HConnectionManagerAdapter* source,
 
292
        const Herqq::Upnp::Av::HProtocolInfos& newValue);
 
293
 
 
294
    /*!
 
295
     * \brief This signal is emitted when the CurrentConnectionIDs state variable
 
296
     * changes at the server-side.
 
297
     *
 
298
     * \param source specifies the HConnectionManagerAdapter instance that
 
299
     * sent the event.
 
300
     *
 
301
     * \param currentIds specifies the currently active connection ID values.
 
302
     */
 
303
    void currentConnectionIdsChanged(
 
304
        Herqq::Upnp::Av::HConnectionManagerAdapter* source,
 
305
        const QList<quint32>& currentIds);
 
306
};
 
307
 
 
308
}
 
309
}
 
310
}
 
311
 
 
312
#endif /* HCONNECTIONMANAGER_H_ */