
// Auto generated

#ifndef QIODEVICE_H_WRAPPER
#define QIODEVICE_H_WRAPPER

// include header:
//#include "header_h.h"

#include "../RJSHelper.h"


#include "RJSWrapperObj.h"

#include <QByteArray>

#include <QDebug>

#include <QQmlEngine>

#include "RJSType.h"

#include <QIODevice>

// singleton class wrapper for static functions:
class QTJSAPI_EXPORT QIODevice_WrapperSingleton: public QObject {
    Q_OBJECT
    QML_INTERFACE

    // constants:


    // static properties:


public:
    //Q_INVOKABLE
    QIODevice_WrapperSingleton(RJSApi& h)
        : QObject(),
          handler(h)

    {}



    // static functions:

    // Class: QIODevice
    // Function: tr
    // Source: QObject
    // Static: true
    // Parameters: 3
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    tr
    (


        const QJSValue&
        a1
        = QJSValue()
          ,
        const QJSValue&
        a2
        = QJSValue()
          ,
        const QJSValue&
        a3
        = QJSValue()

    )

    ;

#ifndef QT_NO_QOBJECT

#endif


private:
    RJSApi& handler;
    //static QIODevice_WrapperSingleton* _singleInstance;

    // constants:

};

// static functions implementation in singleton wrapper:

// wrapper class for QIODevice
class QTJSAPI_EXPORT QIODevice_Wrapper : public RJSWrapperObj {


    Q_OBJECT
    QML_INTERFACE

    Q_PROPERTY(

        QJSValue
        objectName READ objectName WRITE setObjectName
    )


private:
    // disable copy constructor:
    QIODevice_Wrapper(const QIODevice_Wrapper&);

public:
    // initialization of QIODevice:
    static void init(RJSApi& handler);


    static QIODevice* castToBase(void* vp, /*RJSType ID*/ int t) {

        // check if pointer points to derrived type:

        if (t==RJSType_QBuffer::getIdStatic()) {
            return (QIODevice*)(QBuffer*)vp;
        }

        if (t==RJSType_QFileDevice::getIdStatic()) {
            return (QIODevice*)(QFileDevice*)vp;
        }

        if (t==RJSType_QFile::getIdStatic()) {
            return (QIODevice*)(QFile*)vp;
        }

        if (t==RJSType_QProcess::getIdStatic()) {
            return (QIODevice*)(QProcess*)vp;
        }


        // hook for modules to cast from other types to base QIODevice:
        for (int i=0; i<basecasters_QIODevice.length(); i++) {
            RJSBasecaster_QIODevice* basecaster = basecasters_QIODevice[i];
            QIODevice* ret = basecaster->castToBase(t, vp);
            if (ret!=nullptr) {
                return ret;
            }
        }

        // object is a pointer to base class QIODevice:
        if (t==RJSType_QIODevice::getIdStatic()) {
            return (QIODevice*)vp;
        }

        qWarning() << "QIODevice_Wrapper::castToBase: type not found: " << RJSHelper::getTypeName(t);

        return nullptr;

    }

    static QIODevice* getWrappedBase(RJSWrapper* wrapper) {
        int t = wrapper->getWrappedType();
        void* vp = wrapper->getWrappedVoid();
        if (vp==nullptr) {
            //qWarning() << "getWrapped_QIODevice*: wrapper wraps NULL";
        }

        QIODevice* ret = castToBase(vp, t);
        if (ret==nullptr && vp!=nullptr) {
            qWarning() << "QIODevice*_Wrapper::getWrappedBase: extracted type " << t << "from wrapper is NULL";
        }
        return ret;
    }

    // enums:

    enum OpenModeFlag {
        NotOpen = QIODevice::NotOpen,
        ReadOnly = QIODevice::ReadOnly,
        WriteOnly = QIODevice::WriteOnly,
        ReadWrite = QIODevice::ReadWrite,
        Append = QIODevice::Append,
        Truncate = QIODevice::Truncate,
        Text = QIODevice::Text,
        Unbuffered = QIODevice::Unbuffered,
        NewOnly = QIODevice::NewOnly,
        ExistingOnly = QIODevice::ExistingOnly,

    };
    Q_ENUM(OpenModeFlag)

    /*
    // special constructor used as prototype:

          Q_INVOKABLE
          QIODevice_Wrapper(QJSEngine* e);

    */


    // special constructor to wrap existing object:

    //Q_INVOKABLE
    QIODevice_Wrapper(RJSApi& h, QIODevice* o, bool wrappedCreated);


    // destructor:

    virtual ~QIODevice_Wrapper();

    // initialization of signal forwarding

    void initConnections();


    // constructors:

#ifndef QT_NO_QOBJECT

#endif


    // non-static functions:

    // Class: QIODevice
    // Function: objectName
    // Source: QObject
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    objectName
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: setObjectName
    // Source: QObject
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    setObjectName
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: isWidgetType
    // Source: QObject
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    isWidgetType
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: isWindowType
    // Source: QObject
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    isWindowType
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: signalsBlocked
    // Source: QObject
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    signalsBlocked
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: blockSignals
    // Source: QObject
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    blockSignals
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: findChild
    // Source: QObject
    // Static: false
    // Parameters: 2
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    findChild
    (


        const QJSValue&
        a1
        = QJSValue()
          ,
        const QJSValue&
        a2
        = QJSValue()

    )

    const

    ;

    // Class: QIODevice
    // Function: children
    // Source: QObject
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    children
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: setParent
    // Source: QObject
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    setParent
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: installEventFilter
    // Source: QObject
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    installEventFilter
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: removeEventFilter
    // Source: QObject
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    removeEventFilter
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: dumpObjectTree
    // Source: QObject
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    dumpObjectTree
    (


    )

    ;

    // Class: QIODevice
    // Function: dumpObjectInfo
    // Source: QObject
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    dumpObjectInfo
    (


    )

    ;

    // Class: QIODevice
    // Function: setProperty
    // Source: QObject
    // Static: false
    // Parameters: 2
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    setProperty
    (


        const QJSValue&
        a1
        = QJSValue()
          ,
        const QJSValue&
        a2
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: property
    // Source: QObject
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    property
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    const

    ;

    // Class: QIODevice
    // Function: dynamicPropertyNames
    // Source: QObject
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    dynamicPropertyNames
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: parent
    // Source: QObject
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    parent
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: deleteLater
    // Source: QObject
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    deleteLater
    (


    )

    ;

    // Class: QIODevice
    // Function: openMode
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    openMode
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: setTextModeEnabled
    // Source:
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    setTextModeEnabled
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: isTextModeEnabled
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    isTextModeEnabled
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: isOpen
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    isOpen
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: isReadable
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    isReadable
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: isWritable
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    isWritable
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: isSequential
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    isSequential
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: readChannelCount
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    readChannelCount
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: writeChannelCount
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    writeChannelCount
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: currentReadChannel
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    currentReadChannel
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: setCurrentReadChannel
    // Source:
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    setCurrentReadChannel
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: currentWriteChannel
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    currentWriteChannel
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: setCurrentWriteChannel
    // Source:
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    setCurrentWriteChannel
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: open
    // Source:
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    open
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: close
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    close
    (


    )

    ;

    // Class: QIODevice
    // Function: pos
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    pos
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: size
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    size
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: seek
    // Source:
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    seek
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: atEnd
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    atEnd
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: reset
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    reset
    (


    )

    ;

    // Class: QIODevice
    // Function: bytesAvailable
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    bytesAvailable
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: bytesToWrite
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    bytesToWrite
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: readAll
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    readAll
    (


    )

    ;

    // Class: QIODevice
    // Function: canReadLine
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    canReadLine
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: startTransaction
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    startTransaction
    (


    )

    ;

    // Class: QIODevice
    // Function: commitTransaction
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    commitTransaction
    (


    )

    ;

    // Class: QIODevice
    // Function: rollbackTransaction
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    rollbackTransaction
    (


    )

    ;

    // Class: QIODevice
    // Function: isTransactionStarted
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    isTransactionStarted
    (


    )

    const

    ;

    // Class: QIODevice
    // Function: write
    // Source:
    // Static: false
    // Parameters: 2
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    write
    (


        const QJSValue&
        a1
        = QJSValue()
          ,
        const QJSValue&
        a2
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: skip
    // Source:
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    skip
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: waitForReadyRead
    // Source:
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    waitForReadyRead
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: waitForBytesWritten
    // Source:
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    waitForBytesWritten
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: ungetChar
    // Source:
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    ungetChar
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: putChar
    // Source:
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    putChar
    (


        const QJSValue&
        a1
        = QJSValue()

    )

    ;

    // Class: QIODevice
    // Function: errorString
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

public:
    Q_INVOKABLE

    QJSValue
    errorString
    (


    )

    const

    ;

#ifndef QT_NO_QOBJECT

    // Class: QIODevice
    // Function: readyRead
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

    // signal forwarded from wrapped class:
signals:
    void readyRead(

    );

    // called when signal is emitted from wrapped class:
public slots:
    void readyReadEmitter(

    );

    // Class: QIODevice
    // Function: channelReadyRead
    // Source:
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

    // signal forwarded from wrapped class:
signals:
    void channelReadyRead(

        const QJSValue&
        a1
    );

    // called when signal is emitted from wrapped class:
public slots:
    void channelReadyReadEmitter(
        int channel
    );

    // Class: QIODevice
    // Function: bytesWritten
    // Source:
    // Static: false
    // Parameters: 1
    // preceding Parameters: -1

    // signal forwarded from wrapped class:
signals:
    void bytesWritten(

        const QJSValue&
        a1
    );

    // called when signal is emitted from wrapped class:
public slots:
    void bytesWrittenEmitter(
        qint64 bytes
    );

    // Class: QIODevice
    // Function: channelBytesWritten
    // Source:
    // Static: false
    // Parameters: 2
    // preceding Parameters: -1

    // signal forwarded from wrapped class:
signals:
    void channelBytesWritten(

        const QJSValue&
        a1,
        const QJSValue&
        a2
    );

    // called when signal is emitted from wrapped class:
public slots:
    void channelBytesWrittenEmitter(
        int channel, qint64 bytes
    );

    // Class: QIODevice
    // Function: aboutToClose
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

    // signal forwarded from wrapped class:
signals:
    void aboutToClose(

    );

    // called when signal is emitted from wrapped class:
public slots:
    void aboutToCloseEmitter(

    );

    // Class: QIODevice
    // Function: readChannelFinished
    // Source:
    // Static: false
    // Parameters: 0
    // preceding Parameters: -1

    // signal forwarded from wrapped class:
signals:
    void readChannelFinished(

    );

    // called when signal is emitted from wrapped class:
public slots:
    void readChannelFinishedEmitter(

    );

#endif

    // destroy function for non-copyable objects:
    Q_INVOKABLE void destr() {
        if (wrapped!=nullptr) {

            delete wrapped;

            wrapped = nullptr;
        }

    }


    //public:
    // set engine:
    //Q_INVOKABLE void setHandler(RJSApi* h) {
    //  RJSWrapperObj::setHandler(h);
    //}


    // member functions for static properties, forward to static function



    // protected overwritten functions / events and their public invokable counterparts:

public:

    // get type of wrapped object:
    Q_INVOKABLE
    virtual /*RJSType ID*/ int getWrappedType() const {
        return RJSType_QIODevice::getIdStatic();
    }

    // return true if wrapped object is owned by C++ (not deleted):
    Q_INVOKABLE
    virtual bool isCppOwnership() const {

        return true;

    }

    // get wrapped object:
    QIODevice* getWrapped() {
        if (wrapped!=nullptr) {
            return wrapped;
        }

        return nullptr;
    }

    // get wrapped object (const):
    QIODevice* getWrapped() const {
        if (wrapped!=nullptr) {
            return wrapped;
        }

        return nullptr;
    }

    // get wrapped object as void*:
    virtual void* getWrappedVoid() {
        if (wrapped!=nullptr) {
            return wrapped;
        }

        return nullptr;
    }



    bool hasWrapped() const {
        return wrapped!=nullptr

               ;
    }

    Q_INVOKABLE
    bool isNullWrapper() const {
        return !hasWrapped();
    }

    Q_INVOKABLE
    unsigned long long int getAddress() const {
        if (wrapped!=nullptr) {
            return (unsigned long long int)wrapped;
        }

        return (unsigned long long int)0;
    }



    //public slots:
    //void slotDestroyed(QObject* obj) {
    //  qDebug() << "destroying QObject:" << (long int)obj;
    //}



private:
    // wrapped object:
    QIODevice* wrapped;



    bool wrappedCreated;

private:
    // list of registered base casters for this wrapper class:
    static QList<RJSBasecaster_QIODevice*> basecasters_QIODevice;

public:
    static void registerBasecaster_QIODevice(RJSBasecaster_QIODevice* bc) {
        basecasters_QIODevice.append(bc);
    }

};

Q_DECLARE_METATYPE(QIODevice_Wrapper*)

Q_DECLARE_INTERFACE(QIODevice_Wrapper, "org.qcad.QIODevice_Wrapper")


#endif

