2
* Copyright (C) 2011 Tuomo Penttinen, all rights reserved.
4
* Author: Tuomo Penttinen <tp@herqq.org>
6
* This file is part of Herqq UPnP Av (HUPnPAv) library.
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.
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.
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/>.
22
#ifndef HABSTRACTCONNECTIONMANAGER_SERVICE_H_
23
#define HABSTRACTCONNECTIONMANAGER_SERVICE_H_
25
#include <HUpnpAv/HConnectionManagerInfo>
26
#include <HUpnpCore/HServerService>
37
class HAbstractConnectionManagerServicePrivate;
40
* \brief This is an abstract base class for implementing the standardized UPnP service type
41
* ConnectionManager:2.
43
* The main purpose of this class is to marshal UPnP action invocations into
44
* the virtual methods introduced in this class. It is an ideal choice for a
45
* base class when you wish to implement the ConnectionManager service in full.
47
* For more information, see the
48
* <a href=http://upnp.org/specs/av/UPnP-av-ConnectionManager-v2-Service.pdf>
49
* UPnP ConnectionManager:2 specification</a>.
51
* \headerfile habstractconnectionmanager_service.h HAbstractConnectionManagerService
53
* \ingroup hupnp_av_cm
55
* \remarks This class is not thread-safe.
57
class H_UPNP_AV_EXPORT HAbstractConnectionManagerService :
61
H_DECLARE_PRIVATE(HAbstractConnectionManagerService)
62
H_DISABLE_COPY(HAbstractConnectionManagerService)
67
* \brief Creates a new instance.
69
HAbstractConnectionManagerService();
74
HAbstractConnectionManagerService(HAbstractConnectionManagerServicePrivate& dd);
76
// Documented in HServerService
77
virtual HActionInvokes createActionInvokes();
82
* \brief Destroys the instance.
84
virtual ~HAbstractConnectionManagerService();
87
* \brief Returns the protocol related information this instance supports in its
90
* \param result contains the result of the operation.
92
* \retval Herqq::Upnp::UpnpErrorCode
94
virtual qint32 getProtocolInfo(HProtocolInfoResult* result) = 0;
97
* \brief Prepares the device for the purpose of sending or receiving data.
99
* \param remoteProtocolInfo specifies the protocol-related information
100
* that \b must be used to transfer the content.
102
* \param peerConnectionManager identifies the ConnectionManager service on
103
* the other side of the connection.
105
* \param peerConnectionId specifies the ID of the connection the peer
106
* ConnectionManager has allocated for this connection. This can be set to
107
* \c -1 if the ID is not known. This is the case if the peer does not
108
* implement this action or prepareForConnection() has not been invoked on
109
* that ConnectionManager yet.
111
* \param direction specifies the direction to which data will be sent
112
* using the new connection.
114
* \param result specifies a pointer to HPrepareForConnectionResult that
115
* will contain the result of the action.
117
* \retval Herqq::Upnp::UpnpErrorCode
118
* \retval HConnectionManagerInfo::ErrorCode
120
* \remarks This is an optional action, but if it is implemented, you
121
* \b have \b to implement connectionComplete() too. This is mandated by
122
* the ConnectionManager:2 specification.
124
virtual qint32 prepareForConnection(
125
const HProtocolInfo& remoteProtocolInfo,
126
const HConnectionManagerId& peerConnectionManager,
127
qint32 peerConnectionId,
128
HConnectionManagerInfo::Direction direction,
129
HPrepareForConnectionResult* result);
132
* \brief Informs the device that a previously \e prepared connection is no longer
135
* \param connectionId specifies the ID of the connection.
137
* \retval Herqq::Upnp::UpnpErrorCode
138
* \retval HConnectionManagerInfo::ErrorCode
140
* \remarks This is an optional action, but if it is implemented, you
141
* \b have \b to implement prepareForConnection() too. This is mandated by
142
* the ConnectionManager:2 specification.
144
virtual qint32 connectionComplete(qint32 connectionId);
147
* \brief Returns the IDs of currently active connections.
149
* \param outArg specifies a pointer to a list of connection IDs that represent
150
* the currently active connections.
152
* \retval Herqq::Upnp::UpnpErrorCode
154
virtual qint32 getCurrentConnectionIDs(QList<quint32>* outArg) = 0;
157
* \brief Returns information of the specified connection.
159
* \param connectionId specifies the connection.
161
* \param outArg specifies a pointer to HConnectionInfo that will contain
162
* information about the specified connection.
164
* \retval Herqq::Upnp::UpnpErrorCode
165
* \retval HConnectionManagerInfo::ErrorCode
167
virtual qint32 getCurrentConnectionInfo(
168
qint32 connectionId, HConnectionInfo* outArg) = 0;
175
#endif /* HABSTRACTCONNECTIONMANAGER_SERVICE_H_ */