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_ChatChannel_H_
00024 #define TelepathyQt4_Prototype_ChatChannel_H_
00025
00026 #include <QObject>
00027 #include <QPointer>
00028 #include <QVariantMap>
00029
00030 #ifdef DEPRECATED_ENABLED__
00031 #define ATTRIBUTE_DEPRECATED __attribute__((deprecated))
00032 #else
00033 #define ATTRIBUTE_DEPRECATED
00034 #endif
00035
00036 namespace Telepathy {
00037 namespace Client{
00038 class ConnectionInterface;
00039 }
00040 }
00041
00042 namespace TpPrototype {
00043
00044 class ChatChannelPrivate;
00045 class Contact;
00046 class Account;
00047
00053 class ChatChannel : public QObject
00054 {
00055 Q_OBJECT
00056 public:
00061 bool isValid() const;
00062
00067 void sendTextMessage( const QString& text );
00068
00075 void pendingTextMessages();
00076
00081 ~ChatChannel();
00082
00083 signals:
00088 void signalTextMessageReceived( TpPrototype::ChatChannel* chatchannel, uint timestamp, uint type, uint flags, const QString& text );
00089
00094 void signalTextMessageSent( TpPrototype::ChatChannel* chatchannel, uint timestamp, uint type, const QString& text );
00095
00096 protected:
00101 ChatChannel( Contact* contact, Telepathy::Client::ConnectionInterface* connectionInterface , QObject* parent = NULL );
00102
00103 void requestTextChannel(uint handle);
00104 void openTextChannel(uint handle, uint handleType, const QString& channelPath, const QString& channelType );
00105
00106 protected slots:
00107 void slotSentText(uint timestamp, uint type, const QString& text );
00108 void slotLostMessage();
00109 void slotSendError(uint error, uint timestamp, uint type, const QString& text );
00110 void slotReceivedText(uint ID, uint timestamp, uint sender, uint type, uint flags, const QString& text);
00111 private:
00112 ChatChannelPrivate * const d;
00113 friend class ContactManager;
00114 friend class Contact;
00115 };
00116
00117 }
00118
00119 #endif // Header guard