//*****************************************************************************
// Copyright (c) 2024 Autodesk, Inc.
// All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
//
//*****************************************************************************

// IMPORTANT: This file (not the template) is auto-generated by qt2mu.py script.
//            The prefered way to do a fix is to handrolled it or modify the
//            qt2mu.py script. If it is not possible, manual editing is ok but
//            it could be lost in future generations.

#ifndef __MuQt6__QTcpSocketType__h__
#define __MuQt6__QTcpSocketType__h__
#include <iostream>
#include <Mu/Class.h>
#include <Mu/MuProcess.h>
#include <QtCore/QtCore>
#include <QtGui/QtGui>
#include <QtWidgets/QtWidgets>
#include <QtNetwork/QtNetwork>
#include <QtWebEngineWidgets/QtWebEngineWidgets>
#include <QtQml/QtQml>
#include <QtQuick/QtQuick>
#include <QtQuickWidgets/QtQuickWidgets>
#include <QtSvg/QtSvg>
#include <QSvgWidget>
#include <MuQt6/Bridge.h>

namespace Mu
{
    class MuQt_QTcpSocket;

    class QTcpSocketType : public Class
    {
    public:
        typedef MuQt_QTcpSocket MuQtType;
        typedef QTcpSocket QtType;

        //
        //  Constructors
        //

        QTcpSocketType(Context* context, const char* name,
                       Class* superClass = 0, Class* superClass2 = 0);

        virtual ~QTcpSocketType();

        static bool isInheritable() { return true; }

        static inline ClassInstance* cachedInstance(const MuQtType*);

        //
        //  Class API
        //

        virtual void load();

        MemberFunction* _func[14];
    };

    // Inheritable object

    class MuQt_QTcpSocket : public QTcpSocket
    {
    public:
        virtual ~MuQt_QTcpSocket();
        MuQt_QTcpSocket(Pointer muobj, const CallEnvironment*, QObject* parent);
        virtual void disconnectFromHost();
        virtual void resume();
        virtual void setReadBufferSize(qint64 size);
        virtual void setSocketOption(QAbstractSocket::SocketOption option,
                                     const QVariant& value);
        virtual QVariant socketOption(QAbstractSocket::SocketOption option);
        virtual bool waitForConnected(int msecs);
        virtual bool waitForDisconnected(int msecs);
        virtual qint64 bytesAvailable() const;
        virtual qint64 bytesToWrite() const;
        virtual void close();
        virtual bool isSequential() const;
        virtual bool waitForBytesWritten(int msecs);
        virtual bool waitForReadyRead(int msecs);

    protected:
        virtual qint64 skipData(qint64 maxSize);

    public:
        qint64 skipData_pub(qint64 maxSize) { return skipData(maxSize); }

        qint64 skipData_pub_parent(qint64 maxSize)
        {
            return QTcpSocket::skipData(maxSize);
        }

    public:
        const QTcpSocketType* _baseType;
        ClassInstance* _obj;
        const CallEnvironment* _env;
    };

    inline ClassInstance*
    QTcpSocketType::cachedInstance(const QTcpSocketType::MuQtType* obj)
    {
        return obj->_obj;
    }

} // namespace Mu

#endif // __MuQt__QTcpSocketType__h__
