23 #ifndef _TelepathyQt_stream_tube_server_h_HEADER_GUARD_
24 #define _TelepathyQt_stream_tube_server_h_HEADER_GUARD_
27 #include <QSharedDataPointer>
29 #include <TelepathyQt/AccountFactory>
30 #include <TelepathyQt/ChannelFactory>
31 #include <TelepathyQt/ConnectionFactory>
32 #include <TelepathyQt/ContactFactory>
33 #include <TelepathyQt/RefCounted>
34 #include <TelepathyQt/Types>
55 nextParameters(
const AccountPtr &account,
const OutgoingStreamTubeChannelPtr &tube,
66 RemoteContact(
const AccountPtr &account,
const ContactPtr &contact);
70 bool isValid()
const {
return mPriv.constData() != 0; }
86 friend struct Private;
90 class Tube :
public QPair<AccountPtr, OutgoingStreamTubeChannelPtr>
94 Tube(
const AccountPtr &account,
const OutgoingStreamTubeChannelPtr &channel);
98 bool isValid()
const {
return mPriv.constData() != 0; }
107 const OutgoingStreamTubeChannelPtr &
channel()
const
114 friend struct Private;
118 static StreamTubeServerPtr create(
122 bool monitorConnections =
false,
123 const AccountFactoryConstPtr &accountFactory =
125 const ConnectionFactoryConstPtr &connectionFactory =
127 const ChannelFactoryConstPtr &channelFactory =
129 const ContactFactoryConstPtr &contactFactory =
132 static StreamTubeServerPtr create(
134 const AccountFactoryConstPtr &accountFactory,
135 const ConnectionFactoryConstPtr &connectionFactory,
136 const ChannelFactoryConstPtr &channelFactory,
137 const ContactFactoryConstPtr &contactFactory,
141 bool monitorConnections =
false);
143 static StreamTubeServerPtr create(
144 const AccountManagerPtr &accountManager,
148 bool monitorConnections =
false);
150 static StreamTubeServerPtr create(
151 const ClientRegistrarPtr ®istrar,
155 bool monitorConnections =
false);
159 ClientRegistrarPtr registrar()
const;
161 bool isRegistered()
const;
162 bool monitorsConnections()
const;
165 QVariantMap exportedParameters()
const;
167 void exportTcpSocket(
170 const QVariantMap ¶meters = QVariantMap());
171 void exportTcpSocket(
173 const QVariantMap ¶meters = QVariantMap());
175 void exportTcpSocket(
179 void exportTcpSocket(
190 const Tp::AccountPtr &account,
191 const Tp::OutgoingStreamTubeChannelPtr &tube,
195 const Tp::AccountPtr &account,
196 const Tp::OutgoingStreamTubeChannelPtr &tube,
200 void newTcpConnection(
203 const Tp::AccountPtr &account,
204 const Tp::ContactPtr &contact,
205 const Tp::OutgoingStreamTubeChannelPtr &tube);
206 void tcpConnectionClosed(
209 const Tp::AccountPtr &account,
210 const Tp::ContactPtr &contact,
213 const Tp::OutgoingStreamTubeChannelPtr &tube);
216 TP_QT_NO_EXPORT
void onInvokedForTube(
217 const Tp::AccountPtr &account,
218 const Tp::StreamTubeChannelPtr &tube,
222 TP_QT_NO_EXPORT
void onOfferFinished(
223 TubeWrapper *wrapper,
225 TP_QT_NO_EXPORT
void onTubeInvalidated(
230 TP_QT_NO_EXPORT
void onNewConnection(
231 TubeWrapper *wrapper,
233 TP_QT_NO_EXPORT
void onConnectionClosed(
234 TubeWrapper *wrapper,
241 const ClientRegistrarPtr ®istrar,
245 bool monitorConnections);
The StreamTubeServer::Tube class represents a tube being handled by the server.
Definition: stream-tube-server.h:90
The StreamTubeServer::ParametersGenerator abstract interface allows sending a different set of parame...
Definition: stream-tube-server.h:51
The PendingOperation class is a base class for pending asynchronous operations.
Definition: pending-operation.h:45
The RefCounted class is a base class for shared objects used by SharedPtr.
Definition: shared-ptr.h:42
Definition: abstract-adaptor.cpp:31
bool isValid() const
Definition: stream-tube-server.h:70
const AccountPtr & account() const
Definition: stream-tube-server.h:102
QDBusConnection sessionBus()
const OutgoingStreamTubeChannelPtr & channel() const
Definition: stream-tube-server.h:107
The DBusProxy class is a base class representing a remote object available over D-Bus.
Definition: dbus-proxy.h:42
The StreamTubeServer::RemoteContact class represents a contact from which a socket connection to our ...
Definition: stream-tube-server.h:62
const AccountPtr & account() const
Definition: stream-tube-server.h:74
The ChannelRequestHints class represents a dictionary of metadata provided by the channel requester w...
Definition: channel-request.h:121
bool isValid() const
Definition: stream-tube-server.h:98
The StreamTubeServer class is a Handler implementation for outgoing Stream Tube channels, allowing an application to easily export a TCP network server over Telepathy Tubes without worrying about the channel dispatching details.
Definition: stream-tube-server.h:42
const ContactPtr & contact() const
Definition: stream-tube-server.h:79
static AccountFactoryPtr create(const QDBusConnection &bus, const Features &features=Features())
Definition: account-factory.cpp:58
static ChannelFactoryPtr create(const QDBusConnection &bus)
Definition: channel-factory.cpp:86
static ConnectionFactoryPtr create(const QDBusConnection &bus, const Features &features=Features())
Definition: connection-factory.cpp:57
virtual ~ParametersGenerator()
Definition: stream-tube-server.h:59
static ContactFactoryPtr create(const Features &features=Features())
Definition: contact-factory.cpp:48