Home · All Classes · All Namespaces · Modules · Functions · Files
simple-text-observer.h
00001 
00023 #ifndef _TelepathyQt4_simple_text_observer_h_HEADER_GUARD_
00024 #define _TelepathyQt4_simple_text_observer_h_HEADER_GUARD_
00025 
00026 #include <TelepathyQt4/Constants>
00027 #include <TelepathyQt4/Types>
00028 
00029 #include <QObject>
00030 
00031 namespace Tp
00032 {
00033 
00034 class Message;
00035 class PendingOperation;
00036 class ReceivedMessage;
00037 
00038 class TELEPATHY_QT4_EXPORT SimpleTextObserver : public QObject, public RefCounted
00039 {
00040     Q_OBJECT
00041     Q_DISABLE_COPY(SimpleTextObserver)
00042 
00043 public:
00044     static SimpleTextObserverPtr create(const AccountPtr &account);
00045     static SimpleTextObserverPtr create(const AccountPtr &account,
00046             const ContactPtr &contact);
00047     static SimpleTextObserverPtr create(const AccountPtr &account,
00048             const QString &contactIdentifier);
00049 
00050     virtual ~SimpleTextObserver();
00051 
00052     AccountPtr account() const;
00053     QString contactIdentifier() const;
00054 
00055     QList<TextChannelPtr> textChats() const;
00056 
00057 Q_SIGNALS:
00058     void messageSent(const Tp::Message &message, Tp::MessageSendingFlags flags,
00059             const QString &sentMessageToken, const Tp::TextChannelPtr &channel);
00060     void messageReceived(const Tp::ReceivedMessage &message, const Tp::TextChannelPtr &channel);
00061 
00062 private Q_SLOTS:
00063     TELEPATHY_QT4_NO_EXPORT void onNewChannels(const QList<Tp::ChannelPtr> &channels);
00064     TELEPATHY_QT4_NO_EXPORT void onChannelInvalidated(const Tp::ChannelPtr &channel);
00065 
00066 private:
00067     TELEPATHY_QT4_NO_EXPORT static SimpleTextObserverPtr create(const AccountPtr &account,
00068             const QString &contactIdentifier, bool requiresNormalization);
00069 
00070     TELEPATHY_QT4_NO_EXPORT SimpleTextObserver(const AccountPtr &account,
00071             const QString &contactIdentifier, bool requiresNormalization);
00072 
00073     struct Private;
00074     friend struct Private;
00075     Private *mPriv;
00076 };
00077 
00078 } // Tp
00079 
00080 #endif


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt4 0.8.0