23 #ifndef _TelepathyQt_channel_factory_h_HEADER_GUARD_
24 #define _TelepathyQt_channel_factory_h_HEADER_GUARD_
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
30 #include <TelepathyQt/DBusProxyFactory>
31 #include <TelepathyQt/SharedPtr>
32 #include <TelepathyQt/Types>
37 #include <QVariantMap>
39 class QDBusConnection;
44 class ChannelClassSpec;
52 #ifndef DOXYGEN_SHOULD_SKIP_THIS
53 struct TP_QT_EXPORT Constructor :
public RefCounted
55 virtual ~Constructor() {}
57 virtual ChannelPtr construct(
const ConnectionPtr &conn,
const QString &objectPath,
58 const QVariantMap &immutableProperties)
const = 0;
64 static ChannelFactoryPtr create(
const QDBusConnection &bus);
68 Features featuresForTextChats(
const QVariantMap &additionalProps = QVariantMap())
const;
69 void addFeaturesForTextChats(
const Features &features,
70 const QVariantMap &additionalProps = QVariantMap());
72 ConstructorConstPtr constructorForTextChats(
73 const QVariantMap &additionalProps = QVariantMap())
const;
75 template<
typename Sub
class>
78 setConstructorForTextChats(SubclassCtor<Subclass>::create(), additionalProps);
81 void setConstructorForTextChats(
const ConstructorConstPtr &ctor,
82 const QVariantMap &additionalProps = QVariantMap());
84 Features featuresForTextChatrooms(
const QVariantMap &additionalProps = QVariantMap())
const;
85 void addFeaturesForTextChatrooms(
const Features &features,
86 const QVariantMap &additionalProps = QVariantMap());
88 ConstructorConstPtr constructorForTextChatrooms(
89 const QVariantMap &additionalProps = QVariantMap())
const;
91 template<
typename Sub
class>
94 setConstructorForTextChatrooms(SubclassCtor<Subclass>::create(), additionalProps);
97 void setConstructorForTextChatrooms(
const ConstructorConstPtr &ctor,
98 const QVariantMap &additionalProps = QVariantMap());
100 Features featuresForCalls(
const QVariantMap &additionalProps = QVariantMap())
const;
101 void addFeaturesForCalls(
const Features &features,
102 const QVariantMap &additionalProps = QVariantMap());
104 template<
typename Sub
class>
107 setConstructorForCalls(SubclassCtor<Subclass>::create(), additionalProps);
110 void setConstructorForCalls(
const ConstructorConstPtr &ctor,
111 const QVariantMap &additionalProps = QVariantMap());
113 TP_QT_DEPRECATED
Features featuresForStreamedMediaCalls(
const QVariantMap &additionalProps = QVariantMap())
const;
114 TP_QT_DEPRECATED
void addFeaturesForStreamedMediaCalls(
const Features &features,
115 const QVariantMap &additionalProps = QVariantMap());
117 TP_QT_DEPRECATED ConstructorConstPtr constructorForStreamedMediaCalls(
118 const QVariantMap &additionalProps = QVariantMap())
const;
120 template<
typename Sub
class>
123 setConstructorForStreamedMediaCalls(SubclassCtor<Subclass>::create(), additionalProps);
126 TP_QT_DEPRECATED
void setConstructorForStreamedMediaCalls(
const ConstructorConstPtr &ctor,
127 const QVariantMap &additionalProps = QVariantMap());
129 Features featuresForRoomLists(
const QVariantMap &additionalProps = QVariantMap())
const;
130 void addFeaturesForRoomLists(
const Features &features,
131 const QVariantMap &additionalProps = QVariantMap());
133 ConstructorConstPtr constructorForRoomLists(
134 const QVariantMap &additionalProps = QVariantMap())
const;
136 template<
typename Sub
class>
139 setConstructorForRoomLists(SubclassCtor<Subclass>::create(), additionalProps);
142 void setConstructorForRoomLists(
const ConstructorConstPtr &ctor,
143 const QVariantMap &additionalProps = QVariantMap());
145 Features featuresForOutgoingFileTransfers(
const QVariantMap &additionalProps = QVariantMap())
const;
146 void addFeaturesForOutgoingFileTransfers(
const Features &features,
147 const QVariantMap &additionalProps = QVariantMap());
149 ConstructorConstPtr constructorForOutgoingFileTransfers(
150 const QVariantMap &additionalProps = QVariantMap())
const;
152 template<
typename Sub
class>
155 setConstructorForOutgoingFileTransfers(SubclassCtor<Subclass>::create(), additionalProps);
158 void setConstructorForOutgoingFileTransfers(
const ConstructorConstPtr &ctor,
159 const QVariantMap &additionalProps = QVariantMap());
161 Features featuresForIncomingFileTransfers(
const QVariantMap &additionalProps = QVariantMap())
const;
162 void addFeaturesForIncomingFileTransfers(
const Features &features,
163 const QVariantMap &additionalProps = QVariantMap());
165 ConstructorConstPtr constructorForIncomingFileTransfers(
166 const QVariantMap &additionalProps = QVariantMap())
const;
168 template<
typename Sub
class>
171 setConstructorForIncomingFileTransfers(SubclassCtor<Subclass>::create(), additionalProps);
174 void setConstructorForIncomingFileTransfers(
const ConstructorConstPtr &ctor,
175 const QVariantMap &additionalProps = QVariantMap());
177 Features featuresForOutgoingStreamTubes(
const QVariantMap &additionalProps = QVariantMap())
const;
178 void addFeaturesForOutgoingStreamTubes(
const Features &features,
179 const QVariantMap &additionalProps = QVariantMap());
181 ConstructorConstPtr constructorForOutgoingStreamTubes(
182 const QVariantMap &additionalProps = QVariantMap())
const;
184 template<
typename Sub
class>
187 setConstructorForOutgoingStreamTubes(SubclassCtor<Subclass>::create(), additionalProps);
190 void setConstructorForOutgoingStreamTubes(
const ConstructorConstPtr &ctor,
191 const QVariantMap &additionalProps = QVariantMap());
193 Features featuresForIncomingStreamTubes(
const QVariantMap &additionalProps = QVariantMap())
const;
194 void addFeaturesForIncomingStreamTubes(
const Features &features,
195 const QVariantMap &additionalProps = QVariantMap());
197 ConstructorConstPtr constructorForIncomingStreamTubes(
198 const QVariantMap &additionalProps = QVariantMap())
const;
200 template<
typename Sub
class>
203 setConstructorForIncomingStreamTubes(SubclassCtor<Subclass>::create(), additionalProps);
206 void setConstructorForIncomingStreamTubes(
const ConstructorConstPtr &ctor,
207 const QVariantMap &additionalProps = QVariantMap());
209 Features featuresForOutgoingRoomStreamTubes(
const QVariantMap &additionalProps = QVariantMap())
const;
210 void addFeaturesForOutgoingRoomStreamTubes(
const Features &features,
211 const QVariantMap &additionalProps = QVariantMap());
213 ConstructorConstPtr constructorForOutgoingRoomStreamTubes(
214 const QVariantMap &additionalProps = QVariantMap())
const;
216 template<
typename Sub
class>
219 setConstructorForOutgoingRoomStreamTubes(SubclassCtor<Subclass>::create(), additionalProps);
222 void setConstructorForOutgoingRoomStreamTubes(
const ConstructorConstPtr &ctor,
223 const QVariantMap &additionalProps = QVariantMap());
225 Features featuresForIncomingRoomStreamTubes(
const QVariantMap &additionalProps = QVariantMap())
const;
226 void addFeaturesForIncomingRoomStreamTubes(
const Features &features,
227 const QVariantMap &additionalProps = QVariantMap());
229 ConstructorConstPtr constructorForIncomingRoomStreamTubes(
230 const QVariantMap &additionalProps = QVariantMap())
const;
232 template<
typename Sub
class>
235 setConstructorForIncomingRoomStreamTubes(SubclassCtor<Subclass>::create(), additionalProps);
238 void setConstructorForIncomingRoomStreamTubes(
const ConstructorConstPtr &ctor,
239 const QVariantMap &additionalProps = QVariantMap());
241 Features featuresForOutgoingDBusTubes(
const QVariantMap &additionalProps = QVariantMap())
const;
242 void addFeaturesForOutgoingDBusTubes(
const Features &features,
243 const QVariantMap &additionalProps = QVariantMap());
245 ConstructorConstPtr constructorForOutgoingDBusTubes(
246 const QVariantMap &additionalProps = QVariantMap())
const;
248 template<
typename Sub
class>
251 setConstructorForOutgoingDBusTubes(SubclassCtor<Subclass>::create(), additionalProps);
254 void setConstructorForOutgoingDBusTubes(
const ConstructorConstPtr &ctor,
255 const QVariantMap &additionalProps = QVariantMap());
257 Features featuresForIncomingDBusTubes(
const QVariantMap &additionalProps = QVariantMap())
const;
258 void addFeaturesForIncomingDBusTubes(
const Features &features,
259 const QVariantMap &additionalProps = QVariantMap());
261 ConstructorConstPtr constructorForIncomingDBusTubes(
262 const QVariantMap &additionalProps = QVariantMap())
const;
264 template<
typename Sub
class>
267 setConstructorForIncomingDBusTubes(SubclassCtor<Subclass>::create(), additionalProps);
270 void setConstructorForIncomingDBusTubes(
const ConstructorConstPtr &ctor,
271 const QVariantMap &additionalProps = QVariantMap());
273 Features featuresForOutgoingRoomDBusTubes(
const QVariantMap &additionalProps = QVariantMap())
const;
274 void addFeaturesForOutgoingRoomDBusTubes(
const Features &features,
275 const QVariantMap &additionalProps = QVariantMap());
277 ConstructorConstPtr constructorForOutgoingRoomDBusTubes(
278 const QVariantMap &additionalProps = QVariantMap())
const;
280 template<
typename Sub
class>
283 setConstructorForOutgoingRoomDBusTubes(SubclassCtor<Subclass>::create(), additionalProps);
286 void setConstructorForOutgoingRoomDBusTubes(
const ConstructorConstPtr &ctor,
287 const QVariantMap &additionalProps = QVariantMap());
289 Features featuresForIncomingRoomDBusTubes(
const QVariantMap &additionalProps = QVariantMap())
const;
290 void addFeaturesForIncomingRoomDBusTubes(
const Features &features,
291 const QVariantMap &additionalProps = QVariantMap());
293 ConstructorConstPtr constructorForIncomingRoomDBusTubes(
294 const QVariantMap &additionalProps = QVariantMap())
const;
296 template<
typename Sub
class>
299 setConstructorForIncomingRoomDBusTubes(SubclassCtor<Subclass>::create(), additionalProps);
302 void setConstructorForIncomingRoomDBusTubes(
const ConstructorConstPtr &ctor,
303 const QVariantMap &additionalProps = QVariantMap());
305 Features featuresForContactSearches(
const QVariantMap &additionalProps = QVariantMap())
const;
306 void addFeaturesForContactSearches(
const Features &features,
307 const QVariantMap &additionalProps = QVariantMap());
309 ConstructorConstPtr constructorForContactSearches(
310 const QVariantMap &additionalProps = QVariantMap())
const;
312 template<
typename Sub
class>
315 setConstructorForContactSearches(SubclassCtor<Subclass>::create(), additionalProps);
318 void setConstructorForContactSearches(
const ConstructorConstPtr &ctor,
319 const QVariantMap &additionalProps = QVariantMap());
321 Features featuresForServerAuthentication(
const QVariantMap &additionalProps = QVariantMap())
const;
322 void addFeaturesForServerAuthentication(
const Features &features,
323 const QVariantMap &additionalProps = QVariantMap());
325 ConstructorConstPtr constructorForServerAuthentication(
326 const QVariantMap &additionalProps = QVariantMap())
const;
328 template<
typename Sub
class>
331 setConstructorForServerAuthentication(SubclassCtor<Subclass>::create(), additionalProps);
334 void setConstructorForServerAuthentication(
const ConstructorConstPtr &ctor,
335 const QVariantMap &additionalProps = QVariantMap());
338 void addCommonFeatures(
const Features &features);
340 ConstructorConstPtr fallbackConstructor()
const;
342 template <
typename Sub
class>
345 setFallbackConstructor(SubclassCtor<Subclass>::create());
348 void setFallbackConstructor(
const ConstructorConstPtr &ctor);
353 template <
typename Sub
class>
356 setConstructorFor(channelClass, SubclassCtor<Subclass>::create());
359 ConstructorConstPtr constructorFor(
const ChannelClassSpec &channelClass)
const;
360 void setConstructorFor(
const ChannelClassSpec &channelClass,
const ConstructorConstPtr &ctor);
362 PendingReady *proxy(
const ConnectionPtr &connection,
const QString &channelPath,
363 const QVariantMap &immutableProperties)
const;
368 #ifndef DOXYGEN_SHOULD_SKIP_THIS
369 template <
typename Sub
class>
370 struct SubclassCtor :
public Constructor
372 static ConstructorPtr create()
374 return ConstructorPtr(
new SubclassCtor<Subclass>());
377 virtual ~SubclassCtor() {}
379 ChannelPtr construct(
const ConnectionPtr &conn,
const QString &objectPath,
380 const QVariantMap &immutableProperties)
const
382 return Subclass::create(conn, objectPath, immutableProperties);
387 virtual QString finalBusNameFrom(
const QString &uniqueOrWellKnown)
const;
389 virtual Features featuresFor(
const DBusProxyPtr &proxy)
const;
void setSubclassForOutgoingRoomDBusTubes(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:281
void setSubclassForCalls(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:105
void setSubclassForTextChatrooms(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:92
The DBusProxyFactory class is a base class for all D-Bus proxy factory classes. Handles proxy caching...
Definition: dbus-proxy-factory.h:48
void setSubclassForIncomingDBusTubes(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:265
The ChannelClassSpec class represents a Telepathy channel class.
Definition: channel-class-spec.h:42
void setSubclassForIncomingRoomStreamTubes(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:233
The Features class represents a list of Feature.
Definition: feature.h:61
The SharedPtr class is a pointer to an explicitly shared object.
Definition: shared-ptr.h:39
The RefCounted class is a base class for shared objects used by SharedPtr.
Definition: shared-ptr.h:42
void setSubclassForOutgoingRoomStreamTubes(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:217
void setSubclassForServerAuthentication(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:329
The PendingReady class represents the features requested and the reply to a request for an object to ...
Definition: pending-ready.h:40
void setSubclassFor(const ChannelClassSpec &channelClass)
Definition: channel-factory.h:354
void setSubclassForOutgoingDBusTubes(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:249
void setSubclassForIncomingFileTransfers(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:169
void setSubclassForStreamedMediaCalls(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:121
The ChannelFactory class is responsible for constructing Channel objects according to application-def...
Definition: channel-factory.h:46
void setFallbackSubclass()
Definition: channel-factory.h:343
void setSubclassForIncomingStreamTubes(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:201
void setSubclassForOutgoingFileTransfers(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:153
void setSubclassForTextChats(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:76
void setSubclassForOutgoingStreamTubes(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:185
void setSubclassForRoomLists(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:137
void setSubclassForContactSearches(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:313
void setSubclassForIncomingRoomDBusTubes(const QVariantMap &additionalProps=QVariantMap())
Definition: channel-factory.h:297