/* Generated from Extensions for 'extended' examples */

#include <TelepathyQt4/Types>

#include <QtGlobal>

#include <QByteArray>
#include <QString>
#include <QStringList>
#include <QVariantList>
#include <QVariantMap>

#include <QDBusArgument>
#include <QDBusMetaType>
#include <QDBusObjectPath>
#include <QDBusSignature>
#include <QDBusVariant>

#include <TelepathyQt4/Global>

/**
 * \addtogroup typesconstants Types and constants
 *
 * Enumerated, flag, structure, list and mapping types and utility constants.
 */

/**
 * \defgroup struct Structure types
 * \ingroup typesconstants
 *
 * Structure types generated from the specification.
 */

/**
 * \defgroup list List types
 * \ingroup typesconstants
 *
 * List types generated from the specification.
 */

/**
 * \defgroup mapping Mapping types
 * \ingroup typesconstants
 *
 * Mapping types generated from the specification.
 */


namespace Example
{
/**
 * \struct UIntList
 * \ingroup list
 * \headerfile types.h <types.h>
 *
 * Generic list type with uint elements. Convertible with
 * QList<uint>, but needed to have a discrete type in the Qt4 type system.
 */
struct  UIntList : public QList<uint>
{
    inline UIntList() : QList<uint>() {}
    inline UIntList(const QList<uint>& a) : QList<uint>(a) {}

    inline UIntList& operator=(const QList<uint>& a)
    {
        *(static_cast<QList<uint>*>(this)) = a;
        return *this;
    }
};

/**
 * \struct ContactHat
 * \ingroup struct
 * \headerfile types.h <types.h>
 *
 * Structure type generated from the specification.
 * 
 * A data structure representing a contact and their hat.
 */
struct  ContactHat
{
    /**
     * The contact wearing the hat.
     */
    uint contact;
    /**
     * The color of the hat
     */
    QString color;
    /**
     * The style of the hat
     */
    uint style;
    /**
     * Optional key-value pairs describing extended properties of the hat.
     */
    QVariantMap properties;
};

 bool operator==(const ContactHat& v1, const ContactHat& v2);
inline bool operator!=(const ContactHat& v1, const ContactHat& v2)
{
    return !operator==(v1, v2);
}
 QDBusArgument& operator<<(QDBusArgument& arg, const ContactHat& val);
 const QDBusArgument& operator>>(const QDBusArgument& arg, ContactHat& val);

/**
 * \ingroup list
 * \headerfile types.h <types.h>
 *
 * Array of ContactHat values.
 */
typedef QList<ContactHat> ContactHatList;

/**
 * \ingroup types
 * \headerfile types.h <types.h>
 *
 * Register the types used by the library with the QtDBus type system.
 *
 * Call this function to register the types used before using anything else in
 * the library.
 */
 void registerTypes();
}

Q_DECLARE_METATYPE(Example::ContactHat)
Q_DECLARE_METATYPE(Example::ContactHatList)
Q_DECLARE_METATYPE(Example::UIntList)
