| Home · All Classes · All Namespaces · Modules · Functions · Files

simple-text-observer.h

    00001
    00023 #ifndef _TelepathyQt_simple_text_observer_h_HEADER_GUARD_
    00024 #define _TelepathyQt_simple_text_observer_h_HEADER_GUARD_
    00025
    00026 #include <TelepathyQt/Constants>
    00027 #include <TelepathyQt/Types>
    00028
    00029 #include <QObject>
    00030
    00031 namespace Tp
    00032 {
    00033
    00034 class Message;
    00035 class PendingOperation;
    00036 class ReceivedMessage;
    00037
    00038 class TP_QT_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     TP_QT_NO_EXPORT void onNewChannels(const QList<Tp::ChannelPtr> &channels);
    00064     TP_QT_NO_EXPORT void onChannelInvalidated(const Tp::ChannelPtr &channel);
    00065
    00066 private:
    00067     TP_QT_NO_EXPORT static SimpleTextObserverPtr create(const AccountPtr &account,
    00068             const QString &contactIdentifier, bool requiresNormalization);
    00069
    00070     TP_QT_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