23 #ifndef _TelepathyQt_stream_tube_client_h_HEADER_GUARD_
24 #define _TelepathyQt_stream_tube_client_h_HEADER_GUARD_
26 #include <TelepathyQt/AccountFactory>
27 #include <TelepathyQt/ChannelFactory>
28 #include <TelepathyQt/ConnectionFactory>
29 #include <TelepathyQt/ContactFactory>
30 #include <TelepathyQt/RefCounted>
31 #include <TelepathyQt/Types>
38 class PendingStreamTubeConnection;
53 nextSourceAddress(
const AccountPtr &account,
const IncomingStreamTubeChannelPtr &tube) = 0;
59 class Tube :
public QPair<AccountPtr, IncomingStreamTubeChannelPtr>
63 Tube(
const AccountPtr &account,
const IncomingStreamTubeChannelPtr &channel);
67 bool isValid()
const {
return mPriv.constData() != 0; }
76 const IncomingStreamTubeChannelPtr &
channel()
const
83 friend struct Private;
87 static StreamTubeClientPtr create(
91 bool monitorConnections =
false,
92 bool bypassApproval =
false,
93 const AccountFactoryConstPtr &accountFactory =
95 const ConnectionFactoryConstPtr &connectionFactory =
97 const ChannelFactoryConstPtr &channelFactory =
99 const ContactFactoryConstPtr &contactFactory =
102 static StreamTubeClientPtr create(
104 const AccountFactoryConstPtr &accountFactory,
105 const ConnectionFactoryConstPtr &connectionFactory,
106 const ChannelFactoryConstPtr &channelFactory,
107 const ContactFactoryConstPtr &contactFactory,
111 bool monitorConnections =
false,
112 bool bypassApproval =
false);
114 static StreamTubeClientPtr create(
115 const AccountManagerPtr &accountManager,
119 bool monitorConnections =
false,
120 bool bypassApproval =
false);
122 static StreamTubeClientPtr create(
123 const ClientRegistrarPtr ®istrar,
127 bool monitorConnections =
false,
128 bool bypassApproval =
false);
132 ClientRegistrarPtr registrar()
const;
134 bool isRegistered()
const;
135 bool monitorsConnections()
const;
137 bool acceptsAsTcp()
const;
139 bool acceptsAsUnix()
const;
142 void setToAcceptAsUnix(
bool requireCredentials =
false);
149 const Tp::AccountPtr &account,
150 const Tp::IncomingStreamTubeChannelPtr &tube);
152 const Tp::AccountPtr &account,
153 const Tp::IncomingStreamTubeChannelPtr &tube,
157 void tubeAcceptedAsTcp(
162 const Tp::AccountPtr &account,
163 const Tp::IncomingStreamTubeChannelPtr &tube);
164 void tubeAcceptedAsUnix(
166 bool requiresCredentials,
167 uchar credentialByte,
168 const Tp::AccountPtr &account,
169 const Tp::IncomingStreamTubeChannelPtr &tube);
172 const Tp::AccountPtr &account,
173 const Tp::IncomingStreamTubeChannelPtr &tube,
175 void connectionClosed(
176 const Tp::AccountPtr &account,
177 const Tp::IncomingStreamTubeChannelPtr &tube,
184 TP_QT_NO_EXPORT
void onInvokedForTube(
185 const Tp::AccountPtr &account,
186 const Tp::StreamTubeChannelPtr &tube,
193 TP_QT_NO_EXPORT
void onNewConnection(
194 TubeWrapper *wrapper,
196 TP_QT_NO_EXPORT
void onConnectionClosed(
197 TubeWrapper *wrapper,
204 const ClientRegistrarPtr ®istrar,
208 bool monitorConnections,
209 bool bypassApproval);
Definition: abstract-adaptor.cpp:31
The StreamTubeClient::TcpSourceAddressGenerator abstract interface allows using socket source address...
Definition: stream-tube-client.h:49
The DBusProxy class is a base class representing a remote object available over D-Bus.
Definition: dbus-proxy.h:42
QDBusConnection sessionBus()
The PendingStreamTubeConnection class represents an asynchronous operation for accepting an incoming ...
Definition: pending-stream-tube-connection.h:43
The ChannelRequestHints class represents a dictionary of metadata provided by the channel requester w...
Definition: channel-request.h:121
virtual ~TcpSourceAddressGenerator()
Definition: stream-tube-client.h:56
static ChannelFactoryPtr create(const QDBusConnection &bus)
Definition: channel-factory.cpp:86
static ContactFactoryPtr create(const Features &features=Features())
Definition: contact-factory.cpp:48
const IncomingStreamTubeChannelPtr & channel() const
Definition: stream-tube-client.h:76
The StreamTubeClient class is a Handler implementation for incoming Stream Tube channels, allowing an application to easily get notified about services they can connect to offered to them over Telepathy Tubes without worrying about the channel dispatching details.
Definition: stream-tube-client.h:40
static ConnectionFactoryPtr create(const QDBusConnection &bus, const Features &features=Features())
Definition: connection-factory.cpp:57
bool isValid() const
Definition: stream-tube-client.h:67
static AccountFactoryPtr create(const QDBusConnection &bus, const Features &features=Features())
Definition: account-factory.cpp:58
The StreamTubeClient::Tube class represents a tube being handled by the client.
Definition: stream-tube-client.h:59
const AccountPtr & account() const
Definition: stream-tube-client.h:71
The RefCounted class is a base class for shared objects used by SharedPtr.
Definition: shared-ptr.h:42