/*
 * This file was generated by qdbusxml2cpp version 0.8
 * Command line was: qdbusxml2cpp -c DBusMonitor -p dbusmonitor1 org.deepin.dde.Display1.Monitor.xml
 *
 * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
 *
 * This is an auto-generated file.
 * Do not edit! All changes made to it will be lost.
 */

#ifndef DBUSMONITOR1_H
#define DBUSMONITOR1_H

#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>

/*
 * Proxy class for interface org.deepin.dde.Display1.Monitor
 */
class DBusMonitor: public QDBusAbstractInterface
{
    Q_OBJECT
    Q_SLOT void __propertyChanged__(const QDBusMessage& msg)
    {
        QList<QVariant> arguments = msg.arguments();
        if (3 != arguments.count())
            return;
        QString interfaceName = msg.arguments().at(0).toString();
        if (interfaceName != "org.deepin.dde.Display1.Monitor")
            return;
        QVariantMap changedProps = qdbus_cast<QVariantMap>(arguments.at(1).value<QDBusArgument>());
        QStringList keys = changedProps.keys();
        foreach(const QString &prop, keys) {
        const QMetaObject* self = metaObject();
            for (int i=self->propertyOffset(); i < self->propertyCount(); ++i) {
                QMetaProperty p = self->property(i);
                if (p.name() == prop) {
                Q_EMIT p.notifySignal().invoke(this);
                }
            }
        }
   }
public:
    static inline const char *staticServiceName()
    { return "org.deepin.dde.Display1"; }
    static inline const char *staticInterfaceName()
    { return "org.deepin.dde.Display1.Monitor"; }

public:
    explicit DBusMonitor(const QString &objectPath, QObject *parent = nullptr);

    ~DBusMonitor();

    Q_PROPERTY(bool Connected READ connected)
    inline bool connected() const
    { return qvariant_cast< bool >(property("Connected")); }

    Q_PROPERTY(bool Enabled READ enabled NOTIFY monitorEnabledChanged)
    inline bool enabled() const
    { return qvariant_cast< bool >(property("Enabled")); }

    Q_PROPERTY(ushort Height READ height NOTIFY monitorRectChanged)
    inline ushort height() const
    { return qvariant_cast< ushort >(property("Height")); }

    Q_PROPERTY(uint ID READ iD)
    inline uint iD() const
    { return qvariant_cast< uint >(property("ID")); }

    Q_PROPERTY(QString Name READ name)
    inline QString name() const
    { return qvariant_cast< QString >(property("Name")); }

    Q_PROPERTY(ushort Width READ width NOTIFY monitorRectChanged)
    inline ushort width() const
    { return qvariant_cast< ushort >(property("Width")); }

    Q_PROPERTY(short X READ x NOTIFY monitorRectChanged)
    inline short x() const
    { return qvariant_cast< short >(property("X")); }

    Q_PROPERTY(short Y READ y NOTIFY monitorRectChanged)
    inline short y() const
    { return qvariant_cast< short >(property("Y")); }

public Q_SLOTS: // METHODS
    inline QDBusPendingReply<> Enable(bool enabled)
    {
        QList<QVariant> argumentList;
        argumentList << QVariant::fromValue(enabled);
        return asyncCallWithArgumentList(QStringLiteral("Enable"), argumentList);
    }

    inline QDBusPendingReply<> SetMode(uint mode)
    {
        QList<QVariant> argumentList;
        argumentList << QVariant::fromValue(mode);
        return asyncCallWithArgumentList(QStringLiteral("SetMode"), argumentList);
    }

    inline QDBusPendingReply<> SetModeBySize(ushort width, ushort height)
    {
        QList<QVariant> argumentList;
        argumentList << QVariant::fromValue(width) << QVariant::fromValue(height);
        return asyncCallWithArgumentList(QStringLiteral("SetModeBySize"), argumentList);
    }

    inline QDBusPendingReply<> SetPosition(short X, short y)
    {
        QList<QVariant> argumentList;
        argumentList << QVariant::fromValue(X) << QVariant::fromValue(y);
        return asyncCallWithArgumentList(QStringLiteral("SetPosition"), argumentList);
    }

    inline QDBusPendingReply<> SetReflect(ushort value)
    {
        QList<QVariant> argumentList;
        argumentList << QVariant::fromValue(value);
        return asyncCallWithArgumentList(QStringLiteral("SetReflect"), argumentList);
    }

    inline QDBusPendingReply<> SetRefreshRate(double value)
    {
        QList<QVariant> argumentList;
        argumentList << QVariant::fromValue(value);
        return asyncCallWithArgumentList(QStringLiteral("SetRefreshRate"), argumentList);
    }

    inline QDBusPendingReply<> SetRotation(ushort value)
    {
        QList<QVariant> argumentList;
        argumentList << QVariant::fromValue(value);
        return asyncCallWithArgumentList(QStringLiteral("SetRotation"), argumentList);
    }

Q_SIGNALS: // SIGNALS
    void monitorRectChanged();
    void monitorEnabledChanged();
public:
    QRect rect() const;
};

#endif
