/*
 * 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.
 */

#ifndef IN_TELEPATHY_QT4_HEADER
#error IN_TELEPATHY_QT4_HEADER
#endif

#include <TelepathyQt4/Types>

#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 Tp
{
namespace Client
{

/**
 * \class AccountManagerInterface
 * \headerfile TelepathyQt4/account-manager.h <TelepathyQt4/AccountManager>
 * \ingroup clientam
 *
 * Proxy class providing a 1:1 mapping of the D-Bus interface "org.freedesktop.Telepathy.AccountManager."
 */
class TELEPATHY_QT4_EXPORT AccountManagerInterface : public Tp::AbstractInterface
{
    Q_OBJECT

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

    /**
     * Creates a AccountManagerInterface 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.
     */
    AccountManagerInterface(
        const QString& busName,
        const QString& objectPath,
        QObject* parent = 0
    );

    /**
     * Creates a AccountManagerInterface 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.
     */
    AccountManagerInterface(
        const QDBusConnection& connection,
        const QString& busName,
        const QString& objectPath,
        QObject* parent = 0
    );

    /**
     * Creates a AccountManagerInterface 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.
     */
    AccountManagerInterface(Tp::DBusProxy *proxy);

    /**
     * Represents property "Interfaces" on the remote object.
     * 
     * A list of the interfaces provided by the account manager object.
     */
    Q_PROPERTY(QStringList Interfaces READ Interfaces)

    /**
     * Getter for the remote object property "Interfaces".
     *
     * Don't use this: it blocks the main loop.
     *
     * \return The value of the property, or a default-constructed value
     *          if the property is not readable.
     */
    inline QStringList Interfaces() const TELEPATHY_GNUC_DEPRECATED
    {
        return qvariant_cast<QStringList>(internalPropGet("Interfaces"));
    }

    /**
     * Represents property "ValidAccounts" on the remote object.
     * 
     * A list of the valid (complete, usable) accounts. Change notification is 
     * via AccountValidityChanged. This split between valid and invalid 
     * accounts makes it easy to ignore the invalid ones. The only things that 
     * should be manipulating invalid accounts are account-editing UIs, which 
     * might be able to rescue them.
     */
    Q_PROPERTY(Tp::ObjectPathList ValidAccounts READ ValidAccounts)

    /**
     * Getter for the remote object property "ValidAccounts".
     *
     * Don't use this: it blocks the main loop.
     *
     * \return The value of the property, or a default-constructed value
     *          if the property is not readable.
     */
    inline Tp::ObjectPathList ValidAccounts() const TELEPATHY_GNUC_DEPRECATED
    {
        return qvariant_cast<Tp::ObjectPathList>(internalPropGet("ValidAccounts"));
    }

    /**
     * Represents property "InvalidAccounts" on the remote object.
     * 
     * A list of incomplete or otherwise unusable accounts. Change 
     * notification is via AccountValidityChanged.
     */
    Q_PROPERTY(Tp::ObjectPathList InvalidAccounts READ InvalidAccounts)

    /**
     * Getter for the remote object property "InvalidAccounts".
     *
     * Don't use this: it blocks the main loop.
     *
     * \return The value of the property, or a default-constructed value
     *          if the property is not readable.
     */
    inline Tp::ObjectPathList InvalidAccounts() const TELEPATHY_GNUC_DEPRECATED
    {
        return qvariant_cast<Tp::ObjectPathList>(internalPropGet("InvalidAccounts"));
    }

    /**
     * Represents property "SupportedAccountProperties" on the remote object.
     * 
     * <p>A list of the fully qualified names of properties that can be set
     *   via the Properties argument to
     *   <tp:member-ref>CreateAccount</tp:member-ref> when an account is
     *   created.</p>
     * 
     * <tp:rationale>
     *   <p>Examples of good properties to support here include
     *     <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">Icon</tp:dbus-ref>,
     *     <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">Enabled</tp:dbus-ref>,
     *     <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">Nickname</tp:dbus-ref>,
     *     <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">AutomaticPresence</tp:dbus-ref>,
     *     <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">ConnectAutomatically</tp:dbus-ref>,
     *     <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">RequestedPresence</tp:dbus-ref>
     *     and
     *     <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account.Interface.Avatar">Avatar</tp:dbus-ref>.
     *     </p>
     * 
     *   <p>Examples of properties that would make no sense here include
     *     <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">Valid</tp:dbus-ref>,
     *     <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">Connection</tp:dbus-ref>,
     *     <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">ConnectionStatus</tp:dbus-ref>,
     *     <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">ConnectionStatusReason</tp:dbus-ref>,
     *     <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">CurrentPresence</tp:dbus-ref>
     *     and
     *     <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">NormalizedName</tp:dbus-ref>.
     *   </p>
     * </tp:rationale>
     * 
     * <p>This property MUST NOT include include the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">DisplayName</tp:dbus-ref>
     *   and <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">Parameters</tp:dbus-ref>
     *   properties, which are set using separate arguments.</p>
     * 
     * <p>This property MAY include the names of properties that, after
     *   account creation, will be read-only: this indicates that the property
     *   can be set at account creation but not changed later.</p>
     * 
     * <tp:rationale>
     *   <p>For example, an account manager might support migration tools that
     *     use this to preserve the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">HasBeenOnline</tp:dbus-ref>
     *     property, even though that property is usually read-only.</p>
     * </tp:rationale>
     */
    Q_PROPERTY(QStringList SupportedAccountProperties READ SupportedAccountProperties)

    /**
     * Getter for the remote object property "SupportedAccountProperties".
     *
     * Don't use this: it blocks the main loop.
     *
     * \return The value of the property, or a default-constructed value
     *          if the property is not readable.
     */
    inline QStringList SupportedAccountProperties() const TELEPATHY_GNUC_DEPRECATED
    {
        return qvariant_cast<QStringList>(internalPropGet("SupportedAccountProperties"));
    }

public Q_SLOTS:
    /**
     * Begins a call to the D-Bus method "CreateAccount" on the remote object.
     * 
     * Request the creation of a new Account. The account manager SHOULD NOT 
     * allow invalid accounts to be created.
     *
     * \param connectionManager
     *     
     *     The name of the connection manager, e.g. &quot;salut&quot;.
     *
     * \param protocol
     *     
     *     The protocol, e.g. &quot;local-xmpp&quot;.
     *
     * \param displayName
     *     
     *     The initial value of the new account&apos;s DisplayName property. 
     *     The account manager SHOULD modify this to make it unique if an 
     *     Account already exists with the same display name, for instance by 
     *     appending a number or the &apos;account&apos; parameter. Account 
     *     manager implementations SHOULD accept an empty string, but account 
     *     editing user interfaces should avoid passing an empty string for 
     *     this parameter. The account creation UI may ask the user for a name 
     *     for the new account. If the author of the UI chooses not to do 
     *     this, the account creation UI is better able to suggest a default 
     *     display name because it has protocol-specific knowledge which the 
     *     account manager does not. The account manager always knows the 
     *     complete list of accounts so it can easily tell whether it should 
     *     append something to the display name to avoid presenting two 
     *     identically-named accounts to the user.
     *
     * \param parameters
     *     
     *     Initial parameter values, as would be passed to RequestConnection.
     *
     * \param properties
     *     
     *     <p>The values of any other properties to be set immediately on the
     *       new Account.</p>
     *     
     *     <p>Only the properties mentioned in
     *       <tp:member-ref>SupportedAccountProperties</tp:member-ref> are
     *       acceptable here. In particular, the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">DisplayName</tp:dbus-ref>
     *       and <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">Parameters</tp:dbus-ref>
     *       properties are never allowed here, since they are set using the other
     *       arguments to this method.</p>
     *     
     *     <p>Account manager implementations SHOULD support creating accounts
     *       with an empty value for this argument.</p>
     *
     * \return
     *     
     *     The new Account.
     */
    inline QDBusPendingReply<QDBusObjectPath> CreateAccount(const QString& connectionManager, const QString& protocol, const QString& displayName, const QVariantMap& parameters, const QVariantMap& properties)
    {
        if (!invalidationReason().isEmpty()) {
            return QDBusPendingReply<QDBusObjectPath>(QDBusMessage::createError(
                invalidationReason(),
                invalidationMessage()
            ));
        }


        QList<QVariant> argumentList;
        argumentList << QVariant::fromValue(connectionManager) << QVariant::fromValue(protocol) << QVariant::fromValue(displayName) << QVariant::fromValue(parameters) << QVariant::fromValue(properties);
        return asyncCallWithArgumentList(QLatin1String("CreateAccount"), argumentList);
    }

Q_SIGNALS:
    /**
     * Represents the signal "AccountRemoved" on the remote object.
     * 
     * The given account has been removed. This is effectively change 
     * notification for the valid and invalid accounts lists. On emission of 
     * this signal, the Account indicated will no longer be present in either 
     * of the lists.
     *
     * \param account
     *     
     *     An Account, which must not be used any more.
     */
    void AccountRemoved(const QDBusObjectPath& account);

    /**
     * Represents the signal "AccountValidityChanged" on the remote object.
     * 
     * The validity of the given account has changed. New accounts are also 
     * indicated by this signal, as an account validity change (usually to 
     * True) on an account that did not previously exist. This is effectively 
     * change notification for the valid and invalid accounts lists.
     *
     * \param account
     *     
     *     An Account.
     *
     * \param valid
     *     
     *     True if the account is now valid.
     */
    void AccountValidityChanged(const QDBusObjectPath& account, bool valid);

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