00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef TelepathyQt4_Prototype_ContactManager_H_
00024 #define TelepathyQt4_Prototype_ContactManager_H_
00025
00026 #include <TelepathyQt4/Types>
00027 #include <TelepathyQt4/Constants>
00028
00029 #include <QObject>
00030 #include <QDBusObjectPath>
00031 #include <QPointer>
00032
00033 #ifdef DEPRECATED_ENABLED__
00034 #define ATTRIBUTE_DEPRECATED __attribute__((deprecated))
00035 #else
00036 #define ATTRIBUTE_DEPRECATED
00037 #endif
00038
00047 namespace Telepathy
00048 {
00049 namespace Client
00050 {
00051 class ConnectionInterface;
00052 class ChannelInterfaceGroupInterface;
00053
00054 }
00055 }
00056
00057 namespace TpPrototype {
00058
00059 class ContactManagerPrivate;
00060 class Contact;
00061 class Connection;
00062 class ChatChannel;
00063 class StreamedMediaChannel;
00064
00073 class ContactManager : public QObject
00074 {
00075 Q_OBJECT
00076 public:
00081 bool isValid();
00082
00087 int count();
00088
00094 QList<QPointer<TpPrototype ::Contact> > contactList();
00095
00103 QList<QPointer<TpPrototype ::Contact> > toAuthorizeList();
00104
00112 QList<QPointer<TpPrototype ::Contact> > remoteAuthorizationPendingList();
00113
00118 QList<QPointer<TpPrototype::Contact> > blockedContacts();
00119
00126 bool requestContact( const QString& id );
00127
00134 bool authorizeContact( const Contact* contact );
00135
00141 bool removeContact( const TpPrototype ::Contact* contactToRemove );
00142
00151 bool blockContact( const Contact* contactToBlock );
00152
00161 bool unblockContact( const Contact* contactToUnblock );
00162
00168 QPointer<TpPrototype ::Contact> contactForHandle( uint handle );
00169
00175 uint localHandle();
00176
00177 signals:
00184 void signalTextChannelOpenedForContact( TpPrototype ::Contact* contact );
00185
00194 void signalStreamedMediaChannelOpenedForContact( TpPrototype ::Contact* contact );
00195
00201 void signalContactAdded( TpPrototype ::ContactManager* contactManager, TpPrototype ::Contact* contact );
00202
00208 void signalContactLocalPending( TpPrototype ::ContactManager* contactManager, TpPrototype ::Contact* contact );
00209
00215 void signalContactRemotePending( TpPrototype ::ContactManager* contactManager, TpPrototype ::Contact* contact );
00216
00221 void signalContactSubscribed( TpPrototype ::ContactManager* contactManager, TpPrototype ::Contact* contact );
00222
00232 void signalAboutToRemoveContact( TpPrototype ::ContactManager* contactManager, TpPrototype ::Contact* contact );
00233
00239 void signalContactRemoved( TpPrototype ::ContactManager* contactManager );
00240
00244 void signalContactKnown( TpPrototype ::ContactManager* contactManager, TpPrototype ::Contact* contact );
00245
00251 void signalContactBlocked( TpPrototype::ContactManager* contactManager, TpPrototype::Contact* contact );
00252
00257 void signalContactUnblocked( TpPrototype::ContactManager* contactManager, TpPrototype::Contact* contact );
00258
00270 void signalMembersChanged( TpPrototype ::ContactManager* contactManager,
00271 const QString& message,
00272 QList<QPointer<TpPrototype ::Contact> > members,
00273 QList<QPointer<TpPrototype ::Contact> > localPending,
00274 QList<QPointer<TpPrototype ::Contact> > remotePending,
00275 TpPrototype ::Contact* actor,
00276 Telepathy::ChannelGroupChangeReason reason );
00277
00278 protected:
00282 ContactManager( Telepathy::Client::ConnectionInterface* connection,
00283 QObject* parent = NULL );
00284 ~ContactManager();
00285
00286
00287 void openSubscribedContactsChannel(uint handle, const QDBusObjectPath& objectPath, const QString& channelType);
00288
00292 void openPublishContactsChannel(uint handle, const QDBusObjectPath& objectPath, const QString& channelType);
00293
00297 void openKnownContactsChannel(uint handle, const QDBusObjectPath& objectPath, const QString& channelType);
00298
00302 void openDenyContactsChannel(uint handle, const QDBusObjectPath& objectPath, const QString& channelType);
00303
00304 void openTextChannel( uint handle, uint handleType, const QString& channelPath, const QString& channelType );
00305
00306 void openStreamedMediaChannel( uint handle, uint handleType, const QString& channelPath, const QString& channelType );
00307
00308 protected slots:
00309
00310 void slotMembersChanged(const QString& message,
00311 const Telepathy::UIntList& members_added,
00312 const Telepathy::UIntList& members_removed,
00313 const Telepathy::UIntList& local_pending,
00314 const Telepathy::UIntList& remote_pending,
00315 uint actor, uint reason);
00316 void slotKnownMembersChanged(const QString& message,
00317 const Telepathy::UIntList& members_added,
00318 const Telepathy::UIntList& members_removed,
00319 const Telepathy::UIntList& local_pending,
00320 const Telepathy::UIntList& remote_pending,
00321 uint actor, uint reason);
00322 void slotPublishedMembersChanged(const QString& message,
00323 const Telepathy::UIntList& members_added,
00324 const Telepathy::UIntList& members_removed,
00325 const Telepathy::UIntList& local_pending,
00326 const Telepathy::UIntList& remote_pending,
00327 uint actor, uint reason);
00328 void slotSubscribedMembersChanged(const QString& message,
00329 const Telepathy::UIntList& members_added,
00330 const Telepathy::UIntList& members_removed,
00331 const Telepathy::UIntList& local_pending,
00332 const Telepathy::UIntList& remote_pending,
00333 uint actor, uint reason);
00334 void slotDeniedMembersChanged(const QString& message,
00335 const Telepathy::UIntList& members_added,
00336 const Telepathy::UIntList& members_removed,
00337 const Telepathy::UIntList& local_pending,
00338 const Telepathy::UIntList& remote_pending,
00339 uint actor, uint reason);
00340 private:
00341 void init( Telepathy::Client::ConnectionInterface* connection );
00342
00343 ContactManagerPrivate * const d;
00344 friend class Connection;
00345 friend class ConnectionPrivate;
00346 friend class Contact;
00347 };
00348
00349 }
00350
00351 #endif