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

#include "sipAPI_html2.h"

        #include <wx/webview.h>



PyDoc_STRVAR(doc_wxWebViewHistoryItem_GetUrl, "GetUrl() -> String");

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

    {
         ::wxWebViewHistoryItem *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxWebViewHistoryItem, &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);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_WebViewHistoryItem, sipName_GetUrl, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxWebViewHistoryItem_GetTitle, "GetTitle() -> String");

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

    {
         ::wxWebViewHistoryItem *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_WebViewHistoryItem, sipName_GetTitle, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    delete reinterpret_cast< ::wxWebViewHistoryItem *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void dealloc_wxWebViewHistoryItem(sipSimpleWrapper *);}
static void dealloc_wxWebViewHistoryItem(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_wxWebViewHistoryItem(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_wxWebViewHistoryItem(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_wxWebViewHistoryItem(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
     ::wxWebViewHistoryItem *sipCpp = SIP_NULLPTR;

    {
        const  ::wxString* url;
        int urlState = 0;
        const  ::wxString* title;
        int titleState = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J1J1", sipType_wxString,&url, &urlState, sipType_wxString,&title, &titleState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new  ::wxWebViewHistoryItem(*url,*title);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(url),sipType_wxString,urlState);
            sipReleaseType(const_cast< ::wxString *>(title),sipType_wxString,titleState);

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

            return sipCpp;
        }
    }

    {
        const  ::wxWebViewHistoryItem* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxWebViewHistoryItem[] = {
    {SIP_MLNAME_CAST(sipName_GetTitle), meth_wxWebViewHistoryItem_GetTitle, METH_VARARGS, SIP_MLDOC_CAST(doc_wxWebViewHistoryItem_GetTitle)},
    {SIP_MLNAME_CAST(sipName_GetUrl), meth_wxWebViewHistoryItem_GetUrl, METH_VARARGS, SIP_MLDOC_CAST(doc_wxWebViewHistoryItem_GetUrl)}
};

sipVariableDef variables_wxWebViewHistoryItem[] = {
    {PropertyVariable, sipName_Url, &methods_wxWebViewHistoryItem[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_Title, &methods_wxWebViewHistoryItem[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxWebViewHistoryItem, "WebViewHistoryItem(url, title)\n"
"\n"
"A simple class that contains the URL and title of an element of the\n"
"history of a wxWebView.");


sipClassTypeDef sipTypeDef__html2_wxWebViewHistoryItem = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxWebViewHistoryItem,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_WebViewHistoryItem,
        {0, 0, 1},
        2, methods_wxWebViewHistoryItem,
        0, SIP_NULLPTR,
        2, variables_wxWebViewHistoryItem,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxWebViewHistoryItem,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxWebViewHistoryItem,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxWebViewHistoryItem,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxWebViewHistoryItem,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
