#ifndef SBK_WEBPAGEWRAPPER_H
#define SBK_WEBPAGEWRAPPER_H

#include <webpage.h>


// Argument includes
#include <QString>
#include <QStringList>
#include <qcoreevent.h>
#include <qmetaobject.h>
#include <qobject.h>
#include <qobjectdefs.h>
#include <qpoint.h>
#include <qprinter.h>
#include <qurl.h>
#include <qvariant.h>
#include <qwebenginecertificateerror.h>
#include <qwebenginefullscreenrequest.h>
#include <qwebenginepage.h>
#include <webhittestresult.h>
#include <webview.h>
#include <sbkpython.h>

#include <array>
namespace Shiboken { struct AutoDecRef; class GilState; }

namespace PySide { class DynamicQMetaObject; }

class WebPageWrapper : public WebPage
{
public:
    WebPageWrapper(::QObject * parent = nullptr);
    WebPageWrapper(const WebPageWrapper &) = delete;
    WebPageWrapper& operator=(const WebPageWrapper &) = delete;
    WebPageWrapper(WebPageWrapper &&) = delete;
    WebPageWrapper& operator=(WebPageWrapper &&) = delete;
    ~WebPageWrapper() override;

    void childEvent_protected(::QChildEvent * event) { QObject::childEvent(event); }
    void childEvent(::QChildEvent * event) override;
    void connectNotify_protected(const ::QMetaMethod & signal) { QObject::connectNotify(signal); }
    void connectNotify(const ::QMetaMethod & signal) override;
    ::QWebEnginePage * createWindow_protected(::QWebEnginePage::WebWindowType type) { return QWebEnginePage::createWindow(QWebEnginePage::WebWindowType(type)); }
    ::QWebEnginePage * createWindow(::QWebEnginePage::WebWindowType type) override;
    static ::QWebEnginePage * sbk_o_createWindow([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] ::QWebEnginePage::WebWindowType type);
    void customEvent_protected(::QEvent * event) { QObject::customEvent(event); }
    void customEvent(::QEvent * event) override;
    void disconnectNotify_protected(const ::QMetaMethod & signal) { QObject::disconnectNotify(signal); }
    void disconnectNotify(const ::QMetaMethod & signal) override;
    bool event(::QEvent * arg__1) override;
    bool eventFilter(::QObject * watched, ::QEvent * event) override;
    void finished_protected() { WebPage::finished(); }
    void javaScriptAlert(const ::QUrl & securityOrigin, const ::QString & msg) override;
    static void sbk_o_javaScriptAlert([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QUrl & securityOrigin, [[maybe_unused]] const ::QString & msg);
    bool javaScriptConfirm(const ::QUrl & securityOrigin, const ::QString & msg) override;
    static bool sbk_o_javaScriptConfirm([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QUrl & securityOrigin, [[maybe_unused]] const ::QString & msg);
    void javaScriptConsoleMessage(::QWebEnginePage::JavaScriptConsoleMessageLevel level, const ::QString & message, int lineNumber, const ::QString & sourceID) override;
    static void sbk_o_javaScriptConsoleMessage([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] ::QWebEnginePage::JavaScriptConsoleMessageLevel level, [[maybe_unused]] const ::QString & message, [[maybe_unused]] int lineNumber, [[maybe_unused]] const ::QString & sourceID);
    bool javaScriptPrompt_protected(const ::QUrl & securityOrigin, const ::QString & msg, const ::QString & defaultValue, ::QString * result) { return QWebEnginePage::javaScriptPrompt(securityOrigin, msg, defaultValue, result); }
    bool javaScriptPrompt(const ::QUrl & securityOrigin, const ::QString & msg, const ::QString & defaultValue, ::QString * result) override;
    static bool sbk_o_javaScriptPrompt([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QUrl & securityOrigin, [[maybe_unused]] const ::QString & msg, [[maybe_unused]] const ::QString & defaultValue, [[maybe_unused]] ::QString * result);
    void progress_protected(int prog) { WebPage::progress(prog); }
    void timerEvent_protected(::QTimerEvent * event) { QObject::timerEvent(event); }
    void timerEvent(::QTimerEvent * event) override;
    void triggerAction(::QWebEnginePage::WebAction action, bool checked = false) override;
    static void sbk_o_triggerAction([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] ::QWebEnginePage::WebAction action, [[maybe_unused]] bool checked = false);

    const ::QMetaObject * metaObject() const override;
    int qt_metacall(QMetaObject::Call call, int id, void **args) override;
    void *qt_metacast(const char *_clname) override;
    static void pysideInitQtMetaTypes();

    void resetPyMethodCache();

private:
    static ::std::pair<bool,QString> javaScriptPromptPyOverride([[maybe_unused]] Shiboken::GilState &gil, PyObject *pyOverride, ::QUrl securityOrigin, ::QString msg, ::QString defaultValue);

    mutable std::array<PyObject *, 13> m_PyMethodCache = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
};

#  ifndef SBK_QWEBENGINEPAGEWRAPPER_H
#  define SBK_QWEBENGINEPAGEWRAPPER_H

// Inherited base class:
class QWebEnginePageWrapper : public QWebEnginePage
{
public:
    QWebEnginePageWrapper(::QObject * parent = nullptr);
    QWebEnginePageWrapper(::QWebEngineProfile * profile, ::QObject * parent = nullptr);
    QWebEnginePageWrapper(const QWebEnginePageWrapper &) = delete;
    QWebEnginePageWrapper& operator=(const QWebEnginePageWrapper &) = delete;
    QWebEnginePageWrapper(QWebEnginePageWrapper &&) = delete;
    QWebEnginePageWrapper& operator=(QWebEnginePageWrapper &&) = delete;
    ~QWebEnginePageWrapper() override;

    bool acceptNavigationRequest_protected(const ::QUrl & url, ::QWebEnginePage::NavigationType type, bool isMainFrame) { return QWebEnginePage::acceptNavigationRequest(url, QWebEnginePage::NavigationType(type), isMainFrame); }
    bool acceptNavigationRequest(const ::QUrl & url, ::QWebEnginePage::NavigationType type, bool isMainFrame) override;
    static bool sbk_o_acceptNavigationRequest([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QUrl & url, [[maybe_unused]] ::QWebEnginePage::NavigationType type, [[maybe_unused]] bool isMainFrame);
    void childEvent_protected(::QChildEvent * event) { QObject::childEvent(event); }
    void childEvent(::QChildEvent * event) override;
    ::QStringList chooseFiles_protected(::QWebEnginePage::FileSelectionMode mode, const ::QStringList & oldFiles, const ::QStringList & acceptedMimeTypes) { return QWebEnginePage::chooseFiles(QWebEnginePage::FileSelectionMode(mode), oldFiles, acceptedMimeTypes); }
    ::QStringList chooseFiles(::QWebEnginePage::FileSelectionMode mode, const ::QStringList & oldFiles, const ::QStringList & acceptedMimeTypes) override;
    static ::QStringList sbk_o_chooseFiles([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] ::QWebEnginePage::FileSelectionMode mode, [[maybe_unused]] const ::QStringList & oldFiles, [[maybe_unused]] const ::QStringList & acceptedMimeTypes);
    void connectNotify_protected(const ::QMetaMethod & signal) { QObject::connectNotify(signal); }
    void connectNotify(const ::QMetaMethod & signal) override;
    ::QWebEnginePage * createWindow_protected(::QWebEnginePage::WebWindowType type) { return QWebEnginePage::createWindow(QWebEnginePage::WebWindowType(type)); }
    ::QWebEnginePage * createWindow(::QWebEnginePage::WebWindowType type) override;
    void customEvent_protected(::QEvent * event) { QObject::customEvent(event); }
    void customEvent(::QEvent * event) override;
    void disconnectNotify_protected(const ::QMetaMethod & signal) { QObject::disconnectNotify(signal); }
    void disconnectNotify(const ::QMetaMethod & signal) override;
    bool event(::QEvent * arg__1) override;
    bool eventFilter(::QObject * watched, ::QEvent * event) override;
    void javaScriptAlert_protected(const ::QUrl & securityOrigin, const ::QString & msg) { QWebEnginePage::javaScriptAlert(securityOrigin, msg); }
    void javaScriptAlert(const ::QUrl & securityOrigin, const ::QString & msg) override;
    bool javaScriptConfirm_protected(const ::QUrl & securityOrigin, const ::QString & msg) { return QWebEnginePage::javaScriptConfirm(securityOrigin, msg); }
    bool javaScriptConfirm(const ::QUrl & securityOrigin, const ::QString & msg) override;
    void javaScriptConsoleMessage_protected(::QWebEnginePage::JavaScriptConsoleMessageLevel level, const ::QString & message, int lineNumber, const ::QString & sourceID) { QWebEnginePage::javaScriptConsoleMessage(QWebEnginePage::JavaScriptConsoleMessageLevel(level), message, lineNumber, sourceID); }
    void javaScriptConsoleMessage(::QWebEnginePage::JavaScriptConsoleMessageLevel level, const ::QString & message, int lineNumber, const ::QString & sourceID) override;
    bool javaScriptPrompt_protected(const ::QUrl & securityOrigin, const ::QString & msg, const ::QString & defaultValue, ::QString * result) { return QWebEnginePage::javaScriptPrompt(securityOrigin, msg, defaultValue, result); }
    bool javaScriptPrompt(const ::QUrl & securityOrigin, const ::QString & msg, const ::QString & defaultValue, ::QString * result) override;
    static bool sbk_o_javaScriptPrompt([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QUrl & securityOrigin, [[maybe_unused]] const ::QString & msg, [[maybe_unused]] const ::QString & defaultValue, [[maybe_unused]] ::QString * result);
    void timerEvent_protected(::QTimerEvent * event) { QObject::timerEvent(event); }
    void timerEvent(::QTimerEvent * event) override;
    void triggerAction(::QWebEnginePage::WebAction action, bool checked = false) override;

    const ::QMetaObject * metaObject() const override;
    int qt_metacall(QMetaObject::Call call, int id, void **args) override;
    void *qt_metacast(const char *_clname) override;
    static void pysideInitQtMetaTypes();

    void resetPyMethodCache();

private:
    static ::std::pair<bool,QString> javaScriptPromptPyOverride([[maybe_unused]] Shiboken::GilState &gil, PyObject *pyOverride, ::QUrl securityOrigin, ::QString msg, ::QString defaultValue);

    mutable std::array<PyObject *, 15> m_PyMethodCache = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
};

#  endif // SBK_QWEBENGINEPAGEWRAPPER_H

#  ifndef SBK_QOBJECTWRAPPER_H
#  define SBK_QOBJECTWRAPPER_H

// Inherited base class:
class QObjectWrapper : public QObject
{
public:
    QObjectWrapper(::QObject * parent = nullptr);
    QObjectWrapper(const QObjectWrapper &) = delete;
    QObjectWrapper& operator=(const QObjectWrapper &) = delete;
    QObjectWrapper(QObjectWrapper &&) = delete;
    QObjectWrapper& operator=(QObjectWrapper &&) = delete;
    ~QObjectWrapper() override;

    void childEvent_protected(::QChildEvent * event) { QObject::childEvent(event); }
    void childEvent(::QChildEvent * event) override;
    static void sbk_o_childEvent([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] ::QChildEvent * event);
    void connectNotify_protected(const ::QMetaMethod & signal) { QObject::connectNotify(signal); }
    void connectNotify(const ::QMetaMethod & signal) override;
    void customEvent_protected(::QEvent * event) { QObject::customEvent(event); }
    void customEvent(::QEvent * event) override;
    static void sbk_o_customEvent([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] ::QEvent * event);
    void disconnectNotify_protected(const ::QMetaMethod & signal) { QObject::disconnectNotify(signal); }
    void disconnectNotify(const ::QMetaMethod & signal) override;
    bool event(::QEvent * event) override;
    static bool sbk_o_event([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] ::QEvent * event);
    bool eventFilter(::QObject * watched, ::QEvent * event) override;
    static bool sbk_o_eventFilter([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] ::QObject * watched, [[maybe_unused]] ::QEvent * event);
    bool isSignalConnected_protected(const ::QMetaMethod & signal) const { return QObject::isSignalConnected(signal); }
    int receivers_protected(const char * signal) const { return QObject::receivers(signal); }
    ::QObject * sender_protected() const { return QObject::sender(); }
    int senderSignalIndex_protected() const { return QObject::senderSignalIndex(); }
    void timerEvent_protected(::QTimerEvent * event) { QObject::timerEvent(event); }
    void timerEvent(::QTimerEvent * event) override;
    static void sbk_o_timerEvent([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] ::QTimerEvent * event);

    const ::QMetaObject * metaObject() const override;
    int qt_metacall(QMetaObject::Call call, int id, void **args) override;
    void *qt_metacast(const char *_clname) override;
    static void pysideInitQtMetaTypes();

    void resetPyMethodCache();

private:
    mutable std::array<PyObject *, 7> m_PyMethodCache = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
};

#  endif // SBK_QOBJECTWRAPPER_H

#endif // SBK_WEBPAGEWRAPPER_H
