/** * Copyright (C) 2013 Canonical, Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License version 3, as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * * Authors: Tiago Salem Herrmann */ #ifndef OFONOVOICEMAILIFACE_H #define OFONOVOICEMAILIFACE_H // telepathy-qt #include #include #include #include #include class BaseConnectionVoicemailInterface; typedef Tp::SharedPtr BaseConnectionVoicemailInterfacePtr; #define TP_QT_IFACE_CONNECTION_VOICEMAIL "com.canonical.Telephony.Voicemail" class TP_QT_EXPORT BaseConnectionVoicemailInterface : public Tp::AbstractConnectionInterface { Q_OBJECT Q_DISABLE_COPY(BaseConnectionVoicemailInterface) public: static BaseConnectionVoicemailInterfacePtr create() { return BaseConnectionVoicemailInterfacePtr(new BaseConnectionVoicemailInterface()); } template static Tp::SharedPtr create() { return Tp::SharedPtr( new BaseConnectionVoicemailInterfaceSubclass()); } QVariantMap immutableProperties() const; virtual ~BaseConnectionVoicemailInterface(); typedef Tp::Callback1 VoicemailCountCallback; void setVoicemailCountCallback(const VoicemailCountCallback &cb); typedef Tp::Callback1 VoicemailIndicatorCallback; void setVoicemailIndicatorCallback(const VoicemailIndicatorCallback &cb); typedef Tp::Callback1 VoicemailNumberCallback; void setVoicemailNumberCallback(const VoicemailNumberCallback &cb); public Q_SLOTS: void setVoicemailCount(int count); void setVoicemailIndicator(bool active); void setVoicemailNumber(const QString &voicemailNumber); protected: BaseConnectionVoicemailInterface(); private: void createAdaptor(); class Adaptee; friend class Adaptee; struct Private; friend struct Private; Private *mPriv; }; class TP_QT_EXPORT ConnectionInterfaceVoicemailAdaptor : public Tp::AbstractAdaptor { Q_OBJECT Q_CLASSINFO("D-Bus Interface", TP_QT_IFACE_CONNECTION_VOICEMAIL) Q_CLASSINFO("D-Bus Introspection", "" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" "") public: ConnectionInterfaceVoicemailAdaptor(const QDBusConnection& dbusConnection, QObject* adaptee, QObject* parent); virtual ~ConnectionInterfaceVoicemailAdaptor(); typedef Tp::MethodInvocationContextPtr< bool > VoicemailIndicatorContextPtr; typedef Tp::MethodInvocationContextPtr< QString > VoicemailNumberContextPtr; typedef Tp::MethodInvocationContextPtr< uint > VoicemailCountContextPtr; public Q_SLOTS: // METHODS bool VoicemailIndicator(const QDBusMessage& dbusMessage); QString VoicemailNumber(const QDBusMessage& dbusMessage); uint VoicemailCount(const QDBusMessage& dbusMessage); Q_SIGNALS: // SIGNALS void VoicemailCountChanged(uint count); void VoicemailIndicatorChanged(bool active); void VoicemailNumberChanged(const QString &voicemailNumber); }; class TP_QT_NO_EXPORT BaseConnectionVoicemailInterface::Adaptee : public QObject { Q_OBJECT public: Adaptee(BaseConnectionVoicemailInterface *interface); ~Adaptee(); private Q_SLOTS: void voicemailIndicator(const ConnectionInterfaceVoicemailAdaptor::VoicemailIndicatorContextPtr &context); void voicemailNumber(const ConnectionInterfaceVoicemailAdaptor::VoicemailNumberContextPtr &context); void voicemailCount(const ConnectionInterfaceVoicemailAdaptor::VoicemailCountContextPtr &context); Q_SIGNALS: void voicemailCountChanged(uint count); void voicemailIndicatorChanged(bool active); void voicemailNumberChanged(const QString &voicemailNumber); public: BaseConnectionVoicemailInterface *mInterface; }; #endif