/*
 * Interface wrapper code.
 *
 * Generated by SIP 4.19.24
 *
 *     Copyright: (c) 2020 by Total Control Software
 *     License:   wxWindows License
 */

#include "sipAPI_webkit.h"

        #include <wx/html/webkit.h>

        #include <wx/window.h>
        #include <wx/event.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxWebKitBeforeLoadEvent : public  ::wxWebKitBeforeLoadEvent
{
public:
    sipwxWebKitBeforeLoadEvent( ::wxWindow*);
    sipwxWebKitBeforeLoadEvent(const  ::wxWebKitBeforeLoadEvent&);
    virtual ~sipwxWebKitBeforeLoadEvent();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
     ::wxEventCategory GetEventCategory() const SIP_OVERRIDE;
     ::wxEvent* Clone() const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipwxWebKitBeforeLoadEvent(const sipwxWebKitBeforeLoadEvent &);
    sipwxWebKitBeforeLoadEvent &operator = (const sipwxWebKitBeforeLoadEvent &);

    char sipPyMethods[2];
};

sipwxWebKitBeforeLoadEvent::sipwxWebKitBeforeLoadEvent( ::wxWindow*win):  ::wxWebKitBeforeLoadEvent(win), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipwxWebKitBeforeLoadEvent::sipwxWebKitBeforeLoadEvent(const  ::wxWebKitBeforeLoadEvent& a0):  ::wxWebKitBeforeLoadEvent(a0), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipwxWebKitBeforeLoadEvent::~sipwxWebKitBeforeLoadEvent()
{
    sipInstanceDestroyedEx(&sipPySelf);
}

 ::wxEventCategory sipwxWebKitBeforeLoadEvent::GetEventCategory() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[0]),sipPySelf,SIP_NULLPTR,sipName_GetEventCategory);

    if (!sipMeth)
        return  ::wxWebKitBeforeLoadEvent::GetEventCategory();

    extern  ::wxEventCategory sipVH__webkit_19(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    return sipVH__webkit_19(sipGILState, 0, sipPySelf, sipMeth);
}

 ::wxEvent* sipwxWebKitBeforeLoadEvent::Clone() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,const_cast<char *>(&sipPyMethods[1]),sipPySelf,SIP_NULLPTR,sipName_Clone);

    if (!sipMeth)
        return  ::wxWebKitBeforeLoadEvent::Clone();

    extern  ::wxEvent* sipVH__webkit_18(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    return sipVH__webkit_18(sipGILState, 0, sipPySelf, sipMeth);
}


PyDoc_STRVAR(doc_wxWebKitBeforeLoadEvent_IsCancelled, "IsCancelled() -> bool");

extern "C" {static PyObject *meth_wxWebKitBeforeLoadEvent_IsCancelled(PyObject *, PyObject *);}
static PyObject *meth_wxWebKitBeforeLoadEvent_IsCancelled(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::wxWebKitBeforeLoadEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxWebKitBeforeLoadEvent, &sipCpp))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->IsCancelled();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_WebKitBeforeLoadEvent, sipName_IsCancelled, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxWebKitBeforeLoadEvent_Cancel, "Cancel(cancel=True)");

extern "C" {static PyObject *meth_wxWebKitBeforeLoadEvent_Cancel(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxWebKitBeforeLoadEvent_Cancel(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        bool cancel = 1;
         ::wxWebKitBeforeLoadEvent *sipCpp;

        static const char *sipKwdList[] = {
            sipName_cancel,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|b", &sipSelf, sipType_wxWebKitBeforeLoadEvent, &sipCpp, &cancel))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->Cancel(cancel);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_WebKitBeforeLoadEvent, sipName_Cancel, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxWebKitBeforeLoadEvent_GetURL, "GetURL() -> String");

extern "C" {static PyObject *meth_wxWebKitBeforeLoadEvent_GetURL(PyObject *, PyObject *);}
static PyObject *meth_wxWebKitBeforeLoadEvent_GetURL(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::wxWebKitBeforeLoadEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxWebKitBeforeLoadEvent, &sipCpp))
        {
             ::wxString*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::wxString(sipCpp->GetURL());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromNewType(sipRes,sipType_wxString,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_WebKitBeforeLoadEvent, sipName_GetURL, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxWebKitBeforeLoadEvent_SetURL, "SetURL(url)");

extern "C" {static PyObject *meth_wxWebKitBeforeLoadEvent_SetURL(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxWebKitBeforeLoadEvent_SetURL(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::wxString* url;
        int urlState = 0;
         ::wxWebKitBeforeLoadEvent *sipCpp;

        static const char *sipKwdList[] = {
            sipName_url,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxWebKitBeforeLoadEvent, &sipCpp, sipType_wxString,&url, &urlState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetURL(*url);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(url),sipType_wxString,urlState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_WebKitBeforeLoadEvent, sipName_SetURL, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxWebKitBeforeLoadEvent_SetNavigationType, "SetNavigationType(navType)");

extern "C" {static PyObject *meth_wxWebKitBeforeLoadEvent_SetNavigationType(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_wxWebKitBeforeLoadEvent_SetNavigationType(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        int navType;
         ::wxWebKitBeforeLoadEvent *sipCpp;

        static const char *sipKwdList[] = {
            sipName_navType,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bi", &sipSelf, sipType_wxWebKitBeforeLoadEvent, &sipCpp, &navType))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetNavigationType(navType);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_WebKitBeforeLoadEvent, sipName_SetNavigationType, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxWebKitBeforeLoadEvent_GetNavigationType, "GetNavigationType() -> int");

extern "C" {static PyObject *meth_wxWebKitBeforeLoadEvent_GetNavigationType(PyObject *, PyObject *);}
static PyObject *meth_wxWebKitBeforeLoadEvent_GetNavigationType(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
         ::wxWebKitBeforeLoadEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxWebKitBeforeLoadEvent, &sipCpp))
        {
            int sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->GetNavigationType();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return SIPLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_WebKitBeforeLoadEvent, sipName_GetNavigationType, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxWebKitBeforeLoadEvent_Clone, "Clone(self) -> Event");

extern "C" {static PyObject *meth_wxWebKitBeforeLoadEvent_Clone(PyObject *, PyObject *);}
static PyObject *meth_wxWebKitBeforeLoadEvent_Clone(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        const  ::wxWebKitBeforeLoadEvent *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxWebKitBeforeLoadEvent, &sipCpp))
        {
             ::wxEvent*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp-> ::wxWebKitBeforeLoadEvent::Clone() : sipCpp->Clone());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return sipConvertFromNewType(sipRes,sipType_wxEvent,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_WebKitBeforeLoadEvent, sipName_Clone, doc_wxWebKitBeforeLoadEvent_Clone);

    return SIP_NULLPTR;
}


/* Cast a pointer to a type somewhere in its inheritance hierarchy. */
extern "C" {static void *cast_wxWebKitBeforeLoadEvent(void *, const sipTypeDef *);}
static void *cast_wxWebKitBeforeLoadEvent(void *sipCppV, const sipTypeDef *targetType)
{
     ::wxWebKitBeforeLoadEvent *sipCpp = reinterpret_cast< ::wxWebKitBeforeLoadEvent *>(sipCppV);

    if (targetType == sipType_wxCommandEvent)
        return static_cast< ::wxCommandEvent *>(sipCpp);

    if (targetType == sipType_wxEvent)
        return static_cast< ::wxEvent *>(sipCpp);

    if (targetType == sipType_wxObject)
        return static_cast< ::wxObject *>(sipCpp);

    return sipCppV;
}


/* Call the instance's destructor. */
extern "C" {static void release_wxWebKitBeforeLoadEvent(void *, int);}
static void release_wxWebKitBeforeLoadEvent(void *sipCppV, int sipState)
{
    Py_BEGIN_ALLOW_THREADS

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxWebKitBeforeLoadEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxWebKitBeforeLoadEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void dealloc_wxWebKitBeforeLoadEvent(sipSimpleWrapper *);}
static void dealloc_wxWebKitBeforeLoadEvent(sipSimpleWrapper *sipSelf)
{
    if (sipIsDerivedClass(sipSelf))
        reinterpret_cast<sipwxWebKitBeforeLoadEvent *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;

    if (sipIsOwnedByPython(sipSelf))
    {
        release_wxWebKitBeforeLoadEvent(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
    }
}


extern "C" {static void *init_type_wxWebKitBeforeLoadEvent(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_wxWebKitBeforeLoadEvent(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    sipwxWebKitBeforeLoadEvent *sipCpp = SIP_NULLPTR;

    {
         ::wxWindow* win = 0;

        static const char *sipKwdList[] = {
            sipName_win,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|J8", sipType_wxWindow, &win))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxWebKitBeforeLoadEvent(win);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
            {
                delete sipCpp;
                return SIP_NULLPTR;
            }

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxWebKitBeforeLoadEvent* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_wxWebKitBeforeLoadEvent, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxWebKitBeforeLoadEvent(*a0);
            Py_END_ALLOW_THREADS

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_wxWebKitBeforeLoadEvent[] = {{1, 0, 1}};


static PyMethodDef methods_wxWebKitBeforeLoadEvent[] = {
    {SIP_MLNAME_CAST(sipName_Cancel), SIP_MLMETH_CAST(meth_wxWebKitBeforeLoadEvent_Cancel), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxWebKitBeforeLoadEvent_Cancel)},
    {SIP_MLNAME_CAST(sipName_Clone), meth_wxWebKitBeforeLoadEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxWebKitBeforeLoadEvent_Clone)},
    {SIP_MLNAME_CAST(sipName_GetNavigationType), meth_wxWebKitBeforeLoadEvent_GetNavigationType, METH_VARARGS, SIP_MLDOC_CAST(doc_wxWebKitBeforeLoadEvent_GetNavigationType)},
    {SIP_MLNAME_CAST(sipName_GetURL), meth_wxWebKitBeforeLoadEvent_GetURL, METH_VARARGS, SIP_MLDOC_CAST(doc_wxWebKitBeforeLoadEvent_GetURL)},
    {SIP_MLNAME_CAST(sipName_IsCancelled), meth_wxWebKitBeforeLoadEvent_IsCancelled, METH_VARARGS, SIP_MLDOC_CAST(doc_wxWebKitBeforeLoadEvent_IsCancelled)},
    {SIP_MLNAME_CAST(sipName_SetNavigationType), SIP_MLMETH_CAST(meth_wxWebKitBeforeLoadEvent_SetNavigationType), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxWebKitBeforeLoadEvent_SetNavigationType)},
    {SIP_MLNAME_CAST(sipName_SetURL), SIP_MLMETH_CAST(meth_wxWebKitBeforeLoadEvent_SetURL), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxWebKitBeforeLoadEvent_SetURL)}
};

sipVariableDef variables_wxWebKitBeforeLoadEvent[] = {
    {PropertyVariable, sipName_URL, &methods_wxWebKitBeforeLoadEvent[3], &methods_wxWebKitBeforeLoadEvent[6], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_NavigationType, &methods_wxWebKitBeforeLoadEvent[2], &methods_wxWebKitBeforeLoadEvent[5], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxWebKitBeforeLoadEvent, "WebKitBeforeLoadEvent(win=0)");


sipClassTypeDef sipTypeDef__webkit_wxWebKitBeforeLoadEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxWebKitBeforeLoadEvent,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_WebKitBeforeLoadEvent,
        {0, 0, 1},
        7, methods_wxWebKitBeforeLoadEvent,
        0, SIP_NULLPTR,
        2, variables_wxWebKitBeforeLoadEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxWebKitBeforeLoadEvent,
    -1,
    -1,
    supers_wxWebKitBeforeLoadEvent,
    SIP_NULLPTR,
    init_type_wxWebKitBeforeLoadEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxWebKitBeforeLoadEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxWebKitBeforeLoadEvent,
    cast_wxWebKitBeforeLoadEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
