/* * Copyright (C) 2012 Canonical, Ltd. * * Authors: * Gustavo Pichorim Boiko * * This file is part of phone-app. * * phone-app is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 3. * * phone-app is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef TEXTCHANNELOBSERVER_H #define TEXTCHANNELOBSERVER_H #include #include #include #include #include class TextChannelObserver : public QObject, public Tp::AbstractClientObserver { Q_OBJECT public: explicit TextChannelObserver(QObject *parent = 0); Tp::ChannelClassSpecList channelFilters() const; void observeChannels(const Tp::MethodInvocationContextPtr<> &context, const Tp::AccountPtr &account, const Tp::ConnectionPtr &connection, const QList &channels, const Tp::ChannelDispatchOperationPtr &dispatchOperation, const QList &requestsSatisfied, const Tp::AbstractClientObserver::ObserverInfo &observerInfo); protected: void showNotificationForMessage(const Tp::ReceivedMessage &message); Tp::TextChannelPtr channelFromPath(const QString &path); protected Q_SLOTS: void onTextChannelReady(Tp::PendingOperation *op); void onTextChannelInvalidated(); void onMessageReceived(const Tp::ReceivedMessage &message); void onPendingMessageRemoved(const Tp::ReceivedMessage &message); private: QMap > mContexts; QMap mReadyMap; QList mChannels; }; #endif // TEXTCHANNELOBSERVER_H