//*****************************************************************************
// 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__QWebEnginePageType__h__
#define __MuQt6__QWebEnginePageType__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_QWebEnginePage;

    class QWebEnginePageType : public Class
    {
    public:
        typedef MuQt_QWebEnginePage MuQtType;
        typedef QWebEnginePage QtType;

        //
        //  Constructors
        //

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

        virtual ~QWebEnginePageType();

        static bool isInheritable() { return true; }

        static inline ClassInstance* cachedInstance(const MuQtType*);

        //
        //  Class API
        //

        virtual void load();

        MemberFunction* _func[11];
    };

    // Inheritable object

    class MuQt_QWebEnginePage : public QWebEnginePage
    {
    public:
        virtual ~MuQt_QWebEnginePage();
        MuQt_QWebEnginePage(Pointer muobj, const CallEnvironment*,
                            QObject* parent);
        MuQt_QWebEnginePage(Pointer muobj, const CallEnvironment*,
                            QWebEngineProfile* profile, QObject* parent);
        virtual void triggerAction(QWebEnginePage::WebAction action,
                                   bool checked);
        virtual bool event(QEvent* e);

    protected:
        virtual bool
        acceptNavigationRequest(const QUrl& url,
                                QWebEnginePage::NavigationType type,
                                bool isMainFrame);
        virtual QStringList chooseFiles(QWebEnginePage::FileSelectionMode mode,
                                        const QStringList& oldFiles,
                                        const QStringList& acceptedMimeTypes);
        virtual QWebEnginePage*
        createWindow(QWebEnginePage::WebWindowType type);
        virtual void javaScriptAlert(const QUrl& securityOrigin,
                                     const QString& msg);
        virtual bool javaScriptConfirm(const QUrl& securityOrigin,
                                       const QString& msg);
        virtual void javaScriptConsoleMessage(
            QWebEnginePage::JavaScriptConsoleMessageLevel level,
            const QString& message, int lineNumber, const QString& sourceID);

    public:
        virtual bool eventFilter(QObject* watched, QEvent* event);

    protected:
        virtual void customEvent(QEvent* event);
        virtual void timerEvent(QTimerEvent* event);

    public:
        bool acceptNavigationRequest_pub(const QUrl& url,
                                         QWebEnginePage::NavigationType type,
                                         bool isMainFrame)
        {
            return acceptNavigationRequest(url, type, isMainFrame);
        }

        bool
        acceptNavigationRequest_pub_parent(const QUrl& url,
                                           QWebEnginePage::NavigationType type,
                                           bool isMainFrame)
        {
            return QWebEnginePage::acceptNavigationRequest(url, type,
                                                           isMainFrame);
        }

        QStringList chooseFiles_pub(QWebEnginePage::FileSelectionMode mode,
                                    const QStringList& oldFiles,
                                    const QStringList& acceptedMimeTypes)
        {
            return chooseFiles(mode, oldFiles, acceptedMimeTypes);
        }

        QStringList
        chooseFiles_pub_parent(QWebEnginePage::FileSelectionMode mode,
                               const QStringList& oldFiles,
                               const QStringList& acceptedMimeTypes)
        {
            return QWebEnginePage::chooseFiles(mode, oldFiles,
                                               acceptedMimeTypes);
        }

        QWebEnginePage* createWindow_pub(QWebEnginePage::WebWindowType type)
        {
            return createWindow(type);
        }

        QWebEnginePage*
        createWindow_pub_parent(QWebEnginePage::WebWindowType type)
        {
            return QWebEnginePage::createWindow(type);
        }

        void javaScriptAlert_pub(const QUrl& securityOrigin, const QString& msg)
        {
            javaScriptAlert(securityOrigin, msg);
        }

        void javaScriptAlert_pub_parent(const QUrl& securityOrigin,
                                        const QString& msg)
        {
            QWebEnginePage::javaScriptAlert(securityOrigin, msg);
        }

        bool javaScriptConfirm_pub(const QUrl& securityOrigin,
                                   const QString& msg)
        {
            return javaScriptConfirm(securityOrigin, msg);
        }

        bool javaScriptConfirm_pub_parent(const QUrl& securityOrigin,
                                          const QString& msg)
        {
            return QWebEnginePage::javaScriptConfirm(securityOrigin, msg);
        }

        void javaScriptConsoleMessage_pub(
            QWebEnginePage::JavaScriptConsoleMessageLevel level,
            const QString& message, int lineNumber, const QString& sourceID)
        {
            javaScriptConsoleMessage(level, message, lineNumber, sourceID);
        }

        void javaScriptConsoleMessage_pub_parent(
            QWebEnginePage::JavaScriptConsoleMessageLevel level,
            const QString& message, int lineNumber, const QString& sourceID)
        {
            QWebEnginePage::javaScriptConsoleMessage(level, message, lineNumber,
                                                     sourceID);
        }

        void customEvent_pub(QEvent* event) { customEvent(event); }

        void customEvent_pub_parent(QEvent* event)
        {
            QWebEnginePage::customEvent(event);
        }

        void timerEvent_pub(QTimerEvent* event) { timerEvent(event); }

        void timerEvent_pub_parent(QTimerEvent* event)
        {
            QWebEnginePage::timerEvent(event);
        }

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

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

} // namespace Mu

#endif // __MuQt__QWebEnginePageType__h__
