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

#include "sipAPI_core.h"

        #include <wx/dataobj.h>

        #include <wx/dataobj.h>
        #include <wx/dataobj.h>
    PyObject* _wxHTMLDataObject_GetAllFormats(const wxHTMLDataObject* self, wxDataObject::Direction dir)
    {
        size_t count = self->GetFormatCount(dir);
        wxDataFormat* formats = new wxDataFormat[count];
        self->GetAllFormats(formats, dir);
        wxPyThreadBlocker blocker;
        PyObject* list = PyList_New(count);
        for (size_t i=0; i<count; i++) {
            wxDataFormat* format = new wxDataFormat(formats[i]);
            PyObject* obj = wxPyConstructObject((void*)format, wxT("wxDataFormat"), true);
            PyList_SET_ITEM(list, i, obj); // PyList_SET_ITEM steals a reference
        }
        delete [] formats;
        return list;
    }
    bool _wxHTMLDataObject_SetData(wxHTMLDataObject* self, const wxDataFormat* format, wxPyBuffer* buf)
    {
        return self->SetData(*format, buf->m_len, buf->m_ptr);
    }


class sipwxHTMLDataObject : public  ::wxHTMLDataObject
{
public:
    sipwxHTMLDataObject(const  ::wxString&);
    virtual ~sipwxHTMLDataObject();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    void SetHTML(const  ::wxString&) SIP_OVERRIDE;
     ::wxString GetHTML() const SIP_OVERRIDE;
    bool SetData(const  ::wxDataFormat&,size_t,const void*) SIP_OVERRIDE;
     ::wxDataFormat GetPreferredFormat( ::wxDataObject::Direction) const SIP_OVERRIDE;
    size_t GetFormatCount( ::wxDataObject::Direction) const SIP_OVERRIDE;
    void GetAllFormats( ::wxDataFormat*, ::wxDataObject::Direction) const SIP_OVERRIDE;
    bool GetDataHere(void*) const SIP_OVERRIDE;
    size_t GetDataSize() const SIP_OVERRIDE;
    bool SetData(size_t,const void*) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[9];
};

sipwxHTMLDataObject::sipwxHTMLDataObject(const  ::wxString& html):  ::wxHTMLDataObject(html), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

void sipwxHTMLDataObject::SetHTML(const  ::wxString& html)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,SIP_NULLPTR,sipName_SetHTML);

    if (!sipMeth)
    {
         ::wxHTMLDataObject::SetHTML(html);
        return;
    }

    extern void sipVH__core_56(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::wxString&);

    sipVH__core_56(sipGILState, 0, sipPySelf, sipMeth, html);
}

 ::wxString sipwxHTMLDataObject::GetHTML() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxHTMLDataObject::GetHTML();

    extern  ::wxString sipVH__core_11(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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

bool sipwxHTMLDataObject::SetData(const  ::wxDataFormat& format,size_t len,const void*buf)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[2],sipPySelf,SIP_NULLPTR,sipName_SetData);

    if (!sipMeth)
        return  ::wxHTMLDataObject::SetData(format,len,buf);

    extern bool sipVH__core_81(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::wxDataFormat&,size_t,const void*);

    return sipVH__core_81(sipGILState, 0, sipPySelf, sipMeth, format, len, buf);
}

 ::wxDataFormat sipwxHTMLDataObject::GetPreferredFormat( ::wxDataObject::Direction dir) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxHTMLDataObject::GetPreferredFormat(dir);

    extern  ::wxDataFormat sipVH__core_65(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxDataObject::Direction);

    return sipVH__core_65(sipGILState, 0, sipPySelf, sipMeth, dir);
}

size_t sipwxHTMLDataObject::GetFormatCount( ::wxDataObject::Direction dir) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxHTMLDataObject::GetFormatCount(dir);

    extern size_t sipVH__core_64(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxDataObject::Direction);

    return sipVH__core_64(sipGILState, 0, sipPySelf, sipMeth, dir);
}

void sipwxHTMLDataObject::GetAllFormats( ::wxDataFormat*formats, ::wxDataObject::Direction dir) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
         ::wxHTMLDataObject::GetAllFormats(formats,dir);
        return;
    }

    extern void sipVH__core_61(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxDataFormat*, ::wxDataObject::Direction);

    sipVH__core_61(sipGILState, 0, sipPySelf, sipMeth, formats, dir);
}

bool sipwxHTMLDataObject::GetDataHere(void*buf) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxHTMLDataObject::GetDataHere(buf);

    extern bool sipVH__core_73(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, void*);

    return sipVH__core_73(sipGILState, 0, sipPySelf, sipMeth, buf);
}

size_t sipwxHTMLDataObject::GetDataSize() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxHTMLDataObject::GetDataSize();

    extern size_t sipVH__core_70(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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

bool sipwxHTMLDataObject::SetData(size_t len,const void*buf)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[8],sipPySelf,SIP_NULLPTR,sipName_SetData);

    if (!sipMeth)
        return  ::wxHTMLDataObject::SetData(len,buf);

    extern bool sipVH__core_72(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, size_t,const void*);

    return sipVH__core_72(sipGILState, 0, sipPySelf, sipMeth, len, buf);
}


PyDoc_STRVAR(doc_wxHTMLDataObject_GetHTML, "GetHTML() -> String\n"
"\n"
"Returns the HTML string.");

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

    {
        const  ::wxHTMLDataObject *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::wxString((sipSelfWasArg ? sipCpp-> ::wxHTMLDataObject::GetHTML() : sipCpp->GetHTML()));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_HTMLDataObject, sipName_GetHTML, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxHTMLDataObject_SetHTML, "SetHTML(html)\n"
"\n"
"Sets the HTML string.");

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

    {
        const  ::wxString* html;
        int htmlState = 0;
         ::wxHTMLDataObject *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxHTMLDataObject, &sipCpp, sipType_wxString,&html, &htmlState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp-> ::wxHTMLDataObject::SetHTML(*html) : sipCpp->SetHTML(*html));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(html),sipType_wxString,htmlState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_HTMLDataObject, sipName_SetHTML, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxHTMLDataObject_GetAllFormats, "GetAllFormats(dir=DataObject.Get)\n"
"\n"
"Returns a list of wx.DataFormat objects which this data object\n"
"supports transferring in the given direction.");

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

    {
         ::wxDataObject::Direction dir = wxDataObject::Get;
        const  ::wxHTMLDataObject *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|E", &sipSelf, sipType_wxHTMLDataObject, &sipCpp, sipType_wxDataObject_Direction, &dir))
        {
            PyObject * sipRes = SIP_NULLPTR;
            int sipIsErr = 0;

        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxHTMLDataObject_GetAllFormats(sipCpp, dir);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;

            if (sipIsErr)
                return 0;

            return sipRes;
        }
    }

    sipNoMethod(sipParseErr, sipName_HTMLDataObject, sipName_GetAllFormats, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxHTMLDataObject_SetData, "SetData(format, buf) -> bool\n"
"");

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

    {
        const  ::wxDataFormat* format;
         ::wxPyBuffer* buf;
        int bufState = 0;
         ::wxHTMLDataObject *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9J0", &sipSelf, sipType_wxHTMLDataObject, &sipCpp, sipType_wxDataFormat, &format, sipType_wxPyBuffer,&buf, &bufState))
        {
            bool sipRes = 0;
            int sipIsErr = 0;

        PyErr_Clear();
        Py_BEGIN_ALLOW_THREADS
        sipRes = _wxHTMLDataObject_SetData(sipCpp, format, buf);
        Py_END_ALLOW_THREADS
        if (PyErr_Occurred()) sipIsErr = 1;
            sipReleaseType(buf,sipType_wxPyBuffer,bufState);

            if (sipIsErr)
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    {
        size_t len;
        const void* buf;
         ::wxHTMLDataObject *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B=v", &sipSelf, sipType_wxHTMLDataObject, &sipCpp, &len, &buf))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp-> ::wxHTMLDataObject::SetData(len,buf) : sipCpp->SetData(len,buf));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_HTMLDataObject, sipName_SetData, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxHTMLDataObject_GetFormatCount, "GetFormatCount(self, dir: DataObject.Direction = wxDataObject.Get) -> int");

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

    {
         ::wxDataObject::Direction dir =  ::wxDataObject::Get;
        const  ::wxHTMLDataObject *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|E", &sipSelf, sipType_wxHTMLDataObject, &sipCpp, sipType_wxDataObject_Direction, &dir))
        {
            size_t sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp-> ::wxHTMLDataObject::GetFormatCount(dir) : sipCpp->GetFormatCount(dir));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromUnsignedLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_HTMLDataObject, sipName_GetFormatCount, doc_wxHTMLDataObject_GetFormatCount);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxHTMLDataObject_GetPreferredFormat, "GetPreferredFormat(self, dir: DataObject.Direction = wxDataObject.Get) -> DataFormat");

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

    {
         ::wxDataObject::Direction dir =  ::wxDataObject::Get;
        const  ::wxHTMLDataObject *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|E", &sipSelf, sipType_wxHTMLDataObject, &sipCpp, sipType_wxDataObject_Direction, &dir))
        {
             ::wxDataFormat*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new  ::wxDataFormat((sipSelfWasArg ? sipCpp-> ::wxHTMLDataObject::GetPreferredFormat(dir) : sipCpp->GetPreferredFormat(dir)));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_HTMLDataObject, sipName_GetPreferredFormat, doc_wxHTMLDataObject_GetPreferredFormat);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxHTMLDataObject_GetDataSize, "GetDataSize(self) -> int");

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

    {
        const  ::wxHTMLDataObject *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxHTMLDataObject, &sipCpp))
        {
            size_t sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp-> ::wxHTMLDataObject::GetDataSize() : sipCpp->GetDataSize());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyLong_FromUnsignedLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_HTMLDataObject, sipName_GetDataSize, doc_wxHTMLDataObject_GetDataSize);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxHTMLDataObject_GetDataHere, "GetDataHere(self, buf: sip.voidptr) -> bool");

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

    {
        void* buf;
        const  ::wxHTMLDataObject *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "Bv", &sipSelf, sipType_wxHTMLDataObject, &sipCpp, &buf))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp-> ::wxHTMLDataObject::GetDataHere(buf) : sipCpp->GetDataHere(buf));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_HTMLDataObject, sipName_GetDataHere, doc_wxHTMLDataObject_GetDataHere);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxDataObjectSimple)
        return static_cast< ::wxDataObjectSimple *>(sipCpp);

    if (targetType == sipType_wxDataObject)
        return static_cast< ::wxDataObject *>(sipCpp);

    return sipCppV;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxHTMLDataObject *>(sipCppV);
    else
        delete reinterpret_cast< ::wxHTMLDataObject *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void *array_wxHTMLDataObject(Py_ssize_t);}
static void *array_wxHTMLDataObject(Py_ssize_t sipNrElem)
{
    return new  ::wxHTMLDataObject[sipNrElem];
}


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

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


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

    {
        const  ::wxString& htmldef = wxEmptyString;
        const  ::wxString* html = &htmldef;
        int htmlState = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|J1", sipType_wxString,&html, &htmlState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxHTMLDataObject(*html);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(html),sipType_wxString,htmlState);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxHTMLDataObject[] = {
    {SIP_MLNAME_CAST(sipName_GetAllFormats), SIP_MLMETH_CAST(meth_wxHTMLDataObject_GetAllFormats), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxHTMLDataObject_GetAllFormats)},
    {SIP_MLNAME_CAST(sipName_GetDataHere), SIP_MLMETH_CAST(meth_wxHTMLDataObject_GetDataHere), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxHTMLDataObject_GetDataHere)},
    {SIP_MLNAME_CAST(sipName_GetDataSize), meth_wxHTMLDataObject_GetDataSize, METH_VARARGS, SIP_MLDOC_CAST(doc_wxHTMLDataObject_GetDataSize)},
    {SIP_MLNAME_CAST(sipName_GetFormatCount), SIP_MLMETH_CAST(meth_wxHTMLDataObject_GetFormatCount), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxHTMLDataObject_GetFormatCount)},
    {SIP_MLNAME_CAST(sipName_GetHTML), meth_wxHTMLDataObject_GetHTML, METH_VARARGS, SIP_MLDOC_CAST(doc_wxHTMLDataObject_GetHTML)},
    {SIP_MLNAME_CAST(sipName_GetPreferredFormat), SIP_MLMETH_CAST(meth_wxHTMLDataObject_GetPreferredFormat), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxHTMLDataObject_GetPreferredFormat)},
    {SIP_MLNAME_CAST(sipName_SetData), SIP_MLMETH_CAST(meth_wxHTMLDataObject_SetData), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxHTMLDataObject_SetData)},
    {SIP_MLNAME_CAST(sipName_SetHTML), SIP_MLMETH_CAST(meth_wxHTMLDataObject_SetHTML), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxHTMLDataObject_SetHTML)}
};

sipVariableDef variables_wxHTMLDataObject[] = {
    {PropertyVariable, sipName_HTML, &methods_wxHTMLDataObject[4], &methods_wxHTMLDataObject[7], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_AllFormats, &methods_wxHTMLDataObject[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxHTMLDataObject, "HTMLDataObject(html=EmptyString)\n"
"\n"
"wxHTMLDataObject is used for working with HTML-formatted text.");


sipClassTypeDef sipTypeDef__core_wxHTMLDataObject = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxHTMLDataObject,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_HTMLDataObject,
        {0, 0, 1},
        8, methods_wxHTMLDataObject,
        0, SIP_NULLPTR,
        2, variables_wxHTMLDataObject,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxHTMLDataObject,
    -1,
    -1,
    supers_wxHTMLDataObject,
    SIP_NULLPTR,
    init_type_wxHTMLDataObject,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxHTMLDataObject,
    SIP_NULLPTR,
    array_wxHTMLDataObject,
    SIP_NULLPTR,
    release_wxHTMLDataObject,
    cast_wxHTMLDataObject,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
