/*
 * This file contains D-Bus client proxy classes generated by qt4-client-gen.py.
 *
 * This file can be distributed under the same terms as the specification from
 * which it was generated.
 */

#include <TelepathyQt4/Connection>
#include "types.h"

#include <QtGlobal>

#include <QString>
#include <QObject>
#include <QVariant>

#include <QDBusPendingReply>

#include <TelepathyQt4/AbstractInterface>
#include <TelepathyQt4/DBusProxy>
#include <TelepathyQt4/Global>

// basically the same as GLib's G_GNUC_DEPRECATED
#ifndef TELEPATHY_GNUC_DEPRECATED
#   if defined(Q_CC_GNUC) && __GNUC__ >= 4
#       define TELEPATHY_GNUC_DEPRECATED __attribute__((__deprecated__))
#   else
#       define TELEPATHY_GNUC_DEPRECATED
#   endif
#endif
namespace Example
{
namespace Client
{

/**
 * \class ConnectionInterfaceHatsInterface
 * \headerfile ../cli-connection.h <../cli-connection.h>
 *
 * Proxy class providing a 1:1 mapping of the D-Bus interface "com.example.Telepathy.Connection.Interface.Hats."
 */
class  ConnectionInterfaceHatsInterface : public Tp::AbstractInterface
{
    Q_OBJECT

public:
    /**
     * Returns the name of the interface "com.example.Telepathy.Connection.Interface.Hats", which this class
     * represents.
     *
     * \return The D-Bus interface name.
     */
    static inline const char *staticInterfaceName()
    {
        return "com.example.Telepathy.Connection.Interface.Hats";
    }

    /**
     * Creates a ConnectionInterfaceHatsInterface associated with the given object on the session bus.
     *
     * \param busName Name of the service the object is on.
     * \param objectPath Path to the object on the service.
     * \param parent Passed to the parent class constructor.
     */
    ConnectionInterfaceHatsInterface(
        const QString& busName,
        const QString& objectPath,
        QObject* parent = 0
    );

    /**
     * Creates a ConnectionInterfaceHatsInterface associated with the given object on the given bus.
     *
     * \param connection The bus via which the object can be reached.
     * \param busName Name of the service the object is on.
     * \param objectPath Path to the object on the service.
     * \param parent Passed to the parent class constructor.
     */
    ConnectionInterfaceHatsInterface(
        const QDBusConnection& connection,
        const QString& busName,
        const QString& objectPath,
        QObject* parent = 0
    );

    /**
     * Creates a ConnectionInterfaceHatsInterface associated with the same object as the given proxy.
     *
     * \param proxy The proxy to use. It will also be the QObject::parent()
     *               for this object.
     */
    ConnectionInterfaceHatsInterface(Tp::DBusProxy *proxy);

    /**
     * Creates a ConnectionInterfaceHatsInterface associated with the same object as the given proxy.
     * Additionally, the created proxy will have the same parent as the given
     * proxy.
     *
     * \param mainInterface The proxy to use.
     */
    explicit ConnectionInterfaceHatsInterface(const Tp::Client::ConnectionInterface& mainInterface);

    /**
     * Creates a ConnectionInterfaceHatsInterface associated with the same object as the given proxy.
     * However, a different parent object can be specified.
     *
     * \param mainInterface The proxy to use.
     * \param parent Passed to the parent class constructor.
     */
    ConnectionInterfaceHatsInterface(const Tp::Client::ConnectionInterface& mainInterface, QObject* parent);

public Q_SLOTS:
    /**
     * Begins a call to the D-Bus method "GetHats" on the remote object.
     * 
     * Request a list of the hats worn by the given contacts.
     *
     * \param contact
     *     
     *     The handles of the contacts whose hats are requested
     *
     * \return
     *     
     *     A list of contacts and their hats.
     */
    inline QDBusPendingReply<Example::ContactHatList> GetHats(const Example::UIntList& contact)
    {
        if (!invalidationReason().isEmpty()) {
            return QDBusPendingReply<Example::ContactHatList>(QDBusMessage::createError(
                invalidationReason(),
                invalidationMessage()
            ));
        }


        QList<QVariant> argumentList;
        argumentList << QVariant::fromValue(contact);
        return asyncCallWithArgumentList(QLatin1String("GetHats"), argumentList);
    }

    /**
     * Begins a call to the D-Bus method "SetHat" on the remote object.
     * 
     * Indicate that the hat currently being worn by the local user has 
     * changed.
     *
     * \param color
     *     
     *     The color of the contact&apos;s hat.
     *
     * \param style
     *     
     *     The style of the contact&apos;s hat.
     *
     * \param properties
     *     
     *     There&apos;s always an a{sv}...
     */
    inline QDBusPendingReply<> SetHat(const QString& color, uint style, const QVariantMap& properties)
    {
        if (!invalidationReason().isEmpty()) {
            return QDBusPendingReply<>(QDBusMessage::createError(
                invalidationReason(),
                invalidationMessage()
            ));
        }


        QList<QVariant> argumentList;
        argumentList << QVariant::fromValue(color) << QVariant::fromValue(style) << QVariant::fromValue(properties);
        return asyncCallWithArgumentList(QLatin1String("SetHat"), argumentList);
    }

Q_SIGNALS:
    /**
     * Represents the signal "HatsChanged" on the remote object.
     * 
     * Emitted when the contact&apos;s hat has changed.
     *
     * \param contact
     *     
     *     The handle representing the contact&apos;s ID on the server
     *
     * \param color
     *     
     *     The color of the contact&apos;s hat.
     *
     * \param style
     *     
     *     The style of the contact&apos;s hat.
     *
     * \param properties
     *     
     *     There&apos;s always an a{sv}. Perhaps there&apos;s some special 
     *     religious reason.
     */
    void HatsChanged(uint contact, const QString& color, uint style, const QVariantMap& properties);

protected:
    virtual void invalidate(Tp::DBusProxy *, const QString &, const QString &);
};
}
}
