#ifndef REP_SIMPLESWITCH_SOURCE_H
#define REP_SIMPLESWITCH_SOURCE_H

// This is an autogenerated file.
// Do not edit this file, any changes made will be lost the next time it is generated.

#include <QtCore/qobject.h>
#include <QtCore/qdatastream.h>
#include <QtCore/qvariant.h>
#include <QtCore/qmetatype.h>

#include <QtRemoteObjects/qremoteobjectnode.h>
#include <QtRemoteObjects/qremoteobjectsource.h>

#include <QtCore>

class SimpleSwitchSource : public QObject
{
    Q_OBJECT
    Q_CLASSINFO(QCLASSINFO_REMOTEOBJECT_TYPE, "SimpleSwitch")
    Q_CLASSINFO(QCLASSINFO_REMOTEOBJECT_SIGNATURE, "848df11717af2d8be5106a80a701bfc5723baba7")
    Q_PROPERTY(bool currState READ currState WRITE setCurrState NOTIFY currStateChanged)

public:
    explicit SimpleSwitchSource(QObject *parent = nullptr) : QObject(parent)
    {
    }

public:
    virtual ~SimpleSwitchSource() {}

    virtual bool currState() const = 0;
    virtual void setCurrState(bool currState) = 0;

Q_SIGNALS:
    void currStateChanged(bool);

public Q_SLOTS:
    virtual void pushCurrState(bool currState)
    {
        setCurrState(currState);
    }
    virtual void server_slot(bool clientState) = 0;

private:
    friend class QT_PREPEND_NAMESPACE(QRemoteObjectNode);
};

#if (QT_VERSION < QT_VERSION_CHECK(5, 5, 0))
#endif


class SimpleSwitchSimpleSource : public QObject
{
    Q_OBJECT
    Q_CLASSINFO(QCLASSINFO_REMOTEOBJECT_TYPE, "SimpleSwitch")
    Q_CLASSINFO(QCLASSINFO_REMOTEOBJECT_SIGNATURE, "848df11717af2d8be5106a80a701bfc5723baba7")
    Q_PROPERTY(bool currState READ currState WRITE setCurrState NOTIFY currStateChanged)

public:
    explicit SimpleSwitchSimpleSource(QObject *parent = nullptr) : QObject(parent)
        , _currState(false)
    {
    }

public:
    virtual ~SimpleSwitchSimpleSource() {}

    virtual bool currState() const { return _currState; }
    virtual void setCurrState(bool currState)
    {
        if (currState != _currState) { 
            _currState = currState;
            Q_EMIT currStateChanged(_currState);
        }
    }

Q_SIGNALS:
    void currStateChanged(bool);

public Q_SLOTS:
    virtual void pushCurrState(bool currState)
    {
        setCurrState(currState);
    }
    virtual void server_slot(bool clientState) = 0;

private:
    bool _currState;

private:
    friend class QT_PREPEND_NAMESPACE(QRemoteObjectNode);
};

#if (QT_VERSION < QT_VERSION_CHECK(5, 5, 0))
#endif


template <class ObjectType>
struct SimpleSwitchSourceAPI : public SourceApiMap
{
    SimpleSwitchSourceAPI(ObjectType *object)
        : SourceApiMap()
    {
        Q_UNUSED(object);
        _properties[0] = 1;
        _properties[1] = qtro_prop_index<ObjectType>(&ObjectType::currState, static_cast<bool (QObject::*)()>(0),"currState");
        qtro_method_test<ObjectType>(&ObjectType::currStateChanged, static_cast<void (QObject::*)()>(0));
        _signals[0] = 1;
        _signals[1] = qtro_signal_index<ObjectType>(&ObjectType::currStateChanged, static_cast<void (QObject::*)()>(0),signalArgCount+0,&signalArgTypes[0]);
        _methods[0] = 2;
        _methods[1] = qtro_method_index<ObjectType>(&ObjectType::pushCurrState, static_cast<void (QObject::*)(bool)>(0),"pushCurrState(bool)",methodArgCount+0,&methodArgTypes[0]);
        _methods[2] = qtro_method_index<ObjectType>(&ObjectType::server_slot, static_cast<void (QObject::*)(bool)>(0),"server_slot(bool)",methodArgCount+1,&methodArgTypes[1]);
        _modelCount = 0;
    }

    QString name() const override { return QStringLiteral("SimpleSwitch"); }
    QString typeName() const override { return QStringLiteral("SimpleSwitch"); }
    int propertyCount() const override { return _properties[0]; }
    int signalCount() const override { return _signals[0]; }
    int methodCount() const override { return _methods[0]; }
    int modelCount() const override { return _modelCount; }
    int sourcePropertyIndex(int index) const override
    {
        if (index < 0 || index >= _properties[0])
            return -1;
        return _properties[index+1];
    }
    int sourceSignalIndex(int index) const override
    {
        if (index < 0 || index >= _signals[0])
            return -1;
        return _signals[index+1];
    }
    int sourceMethodIndex(int index) const override
    {
        if (index < 0 || index >= _methods[0])
            return -1;
        return _methods[index+1];
    }
    int signalParameterCount(int index) const override
    {
        if (index < 0 || index >= _signals[0])
            return -1;
        return signalArgCount[index];
    }
    int signalParameterType(int sigIndex, int paramIndex) const override
    {
        if (sigIndex < 0 || sigIndex >= _signals[0] || paramIndex < 0 || paramIndex >= signalArgCount[sigIndex])
            return -1;
        return signalArgTypes[sigIndex][paramIndex];
    }
    int methodParameterCount(int index) const override
    {
        if (index < 0 || index >= _methods[0])
            return -1;
        return methodArgCount[index];
    }
    int methodParameterType(int methodIndex, int paramIndex) const override
    {
        if (methodIndex < 0 || methodIndex >= _methods[0] || paramIndex < 0 || paramIndex >= methodArgCount[methodIndex])
            return -1;
        return methodArgTypes[methodIndex][paramIndex];
    }
    int propertyIndexFromSignal(int index) const override
    {
        switch (index) {
        case 0: return _properties[1];
        }
        return -1;
    }
    int propertyRawIndexFromSignal(int index) const override
    {
        switch (index) {
        case 0: return 1;
        }
        return -1;
    }
    const QByteArray signalSignature(int index) const override
    {
        switch (index) {
        case 0: return QByteArrayLiteral("currStateChanged()");
        }
        return QByteArrayLiteral("");
    }
    const QByteArray methodSignature(int index) const override
    {
        switch (index) {
        case 0: return QByteArrayLiteral("pushCurrState(bool)");
        case 1: return QByteArrayLiteral("server_slot(bool)");
        }
        return QByteArrayLiteral("");
    }
    QMetaMethod::MethodType methodType(int) const override
    {
        return QMetaMethod::Slot;
    }
    const QByteArray typeName(int index) const override
    {
        switch (index) {
        case 0: return QByteArrayLiteral("void");
        case 1: return QByteArrayLiteral("void");
        }
        return QByteArrayLiteral("");
    }
    QByteArray objectSignature() const override { return QByteArray{"848df11717af2d8be5106a80a701bfc5723baba7"}; }

    int _properties[2];
    int _signals[2];
    int _methods[3];
    int signalArgCount[1];
    const int* signalArgTypes[1];
    int methodArgCount[2];
    const int* methodArgTypes[2];
    int _modelCount;
};
QT_BEGIN_NAMESPACE
QT_END_NAMESPACE


#endif // REP_SIMPLESWITCH_SOURCE_H
