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

#include "sipAPI_richtext.h"
        #include <wx/richtext/richtexthtml.h>
        #include <wx/richtext/richtextbuffer.h>
        #include <wx/stream.h>
        #include <wx/stream.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxRichTextHTMLHandler : public ::wxRichTextHTMLHandler
{
public:
    sipwxRichTextHTMLHandler(const ::wxString&, const ::wxString&, int);
    sipwxRichTextHTMLHandler(const ::wxRichTextHTMLHandler&);
    virtual ~sipwxRichTextHTMLHandler();

    /*
     * There is a public method for every protected method visible from
     * this class.
     */
    bool sipProtectVirt_DoLoadFile(bool, ::wxRichTextBuffer*, ::wxInputStream&);
    bool sipProtectVirt_DoSaveFile(bool, ::wxRichTextBuffer*, ::wxOutputStream&);

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    bool LoadFile(::wxRichTextBuffer*, const ::wxString&) SIP_OVERRIDE;
    bool SaveFile(::wxRichTextBuffer*, const ::wxString&) SIP_OVERRIDE;
    bool CanHandle(const ::wxString&) const SIP_OVERRIDE;
    bool CanSave() const SIP_OVERRIDE;
    bool CanLoad() const SIP_OVERRIDE;
    bool IsVisible() const SIP_OVERRIDE;
    void SetVisible(bool) SIP_OVERRIDE;
    bool DoLoadFile(::wxRichTextBuffer*, ::wxInputStream&) SIP_OVERRIDE;
    bool DoSaveFile(::wxRichTextBuffer*, ::wxOutputStream&) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[9];
};

sipwxRichTextHTMLHandler::sipwxRichTextHTMLHandler(const ::wxString& name, const ::wxString& ext, int type): ::wxRichTextHTMLHandler(name, ext, type), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

bool sipwxRichTextHTMLHandler::LoadFile(::wxRichTextBuffer*buffer, const ::wxString& filename)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::wxRichTextHTMLHandler::LoadFile(buffer, filename);

    extern bool sipVH__richtext_108(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxRichTextBuffer*, const ::wxString&);

    return sipVH__richtext_108(sipGILState, 0, sipPySelf, sipMeth, buffer, filename);
}

bool sipwxRichTextHTMLHandler::SaveFile(::wxRichTextBuffer*buffer, const ::wxString& filename)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[1], &sipPySelf, SIP_NULLPTR, sipName_SaveFile);

    if (!sipMeth)
        return ::wxRichTextHTMLHandler::SaveFile(buffer, filename);

    extern bool sipVH__richtext_108(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxRichTextBuffer*, const ::wxString&);

    return sipVH__richtext_108(sipGILState, 0, sipPySelf, sipMeth, buffer, filename);
}

bool sipwxRichTextHTMLHandler::CanHandle(const ::wxString& filename) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[2]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_CanHandle);

    if (!sipMeth)
        return ::wxRichTextHTMLHandler::CanHandle(filename);

    extern bool sipVH__richtext_96(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxString&);

    return sipVH__richtext_96(sipGILState, 0, sipPySelf, sipMeth, filename);
}

bool sipwxRichTextHTMLHandler::CanSave() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::wxRichTextHTMLHandler::CanSave();

    extern bool sipVH__richtext_9(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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

bool sipwxRichTextHTMLHandler::CanLoad() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::wxRichTextHTMLHandler::CanLoad();

    extern bool sipVH__richtext_9(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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

bool sipwxRichTextHTMLHandler::IsVisible() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::wxRichTextHTMLHandler::IsVisible();

    extern bool sipVH__richtext_9(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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

void sipwxRichTextHTMLHandler::SetVisible(bool visible)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[6], &sipPySelf, SIP_NULLPTR, sipName_SetVisible);

    if (!sipMeth)
    {
        ::wxRichTextHTMLHandler::SetVisible(visible);
        return;
    }

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

    sipVH__richtext_33(sipGILState, 0, sipPySelf, sipMeth, visible);
}

bool sipwxRichTextHTMLHandler::DoLoadFile(::wxRichTextBuffer*buffer, ::wxInputStream& stream)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[7], &sipPySelf, SIP_NULLPTR, sipName_DoLoadFile);

    if (!sipMeth)
        return ::wxRichTextHTMLHandler::DoLoadFile(buffer, stream);

    extern bool sipVH__richtext_109(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxRichTextBuffer*, ::wxInputStream&);

    return sipVH__richtext_109(sipGILState, 0, sipPySelf, sipMeth, buffer, stream);
}

bool sipwxRichTextHTMLHandler::DoSaveFile(::wxRichTextBuffer*buffer, ::wxOutputStream& stream)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::wxRichTextHTMLHandler::DoSaveFile(buffer, stream);

    extern bool sipVH__richtext_110(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxRichTextBuffer*, ::wxOutputStream&);

    return sipVH__richtext_110(sipGILState, 0, sipPySelf, sipMeth, buffer, stream);
}

bool sipwxRichTextHTMLHandler::sipProtectVirt_DoLoadFile(bool sipSelfWasArg, ::wxRichTextBuffer*buffer, ::wxInputStream& stream)
{
    return (sipSelfWasArg ? ::wxRichTextHTMLHandler::DoLoadFile(buffer, stream) : DoLoadFile(buffer, stream));
}

bool sipwxRichTextHTMLHandler::sipProtectVirt_DoSaveFile(bool sipSelfWasArg, ::wxRichTextBuffer*buffer, ::wxOutputStream& stream)
{
    return (sipSelfWasArg ? ::wxRichTextHTMLHandler::DoSaveFile(buffer, stream) : DoSaveFile(buffer, stream));
}


PyDoc_STRVAR(doc_wxRichTextHTMLHandler_ClearTemporaryImageLocations, "ClearTemporaryImageLocations()\n"
"\n"
"Clears the image locations generated by the last operation.");

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

    {
        ::wxRichTextHTMLHandler *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_wxRichTextHTMLHandler, &sipCpp))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->ClearTemporaryImageLocations();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_RichTextHTMLHandler, sipName_ClearTemporaryImageLocations, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRichTextHTMLHandler_DeleteTemporaryImages, "DeleteTemporaryImages() -> bool\n"
"DeleteTemporaryImages(flags, imageLocations) -> bool\n"
"\n"
"Deletes the in-memory or temporary files generated by the last\n"
"operation.\n"
"");

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

    {
        ::wxRichTextHTMLHandler *sipCpp;

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, SIP_NULLPTR, "B", &sipSelf, sipType_wxRichTextHTMLHandler, &sipCpp))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->DeleteTemporaryImages();
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    {
        int flags;
        const ::wxArrayString* imageLocations;
        int imageLocationsState = 0;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "iJ1", &flags, sipType_wxArrayString, &imageLocations, &imageLocationsState))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = ::wxRichTextHTMLHandler::DeleteTemporaryImages(flags, *imageLocations);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<::wxArrayString *>(imageLocations), sipType_wxArrayString, imageLocationsState);

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_RichTextHTMLHandler, sipName_DeleteTemporaryImages, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRichTextHTMLHandler_GetFontSizeMapping, "GetFontSizeMapping() -> ArrayInt\n"
"\n"
"Returns the mapping for converting point sizes to HTML font sizes.");

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

    {
        const ::wxRichTextHTMLHandler *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxArrayInt(sipCpp->GetFontSizeMapping());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_RichTextHTMLHandler, sipName_GetFontSizeMapping, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRichTextHTMLHandler_GetTempDir, "GetTempDir() -> String\n"
"\n"
"Returns the directory used to store temporary image files.");

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

    {
        const ::wxRichTextHTMLHandler *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_RichTextHTMLHandler, sipName_GetTempDir, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRichTextHTMLHandler_GetTemporaryImageLocations, "GetTemporaryImageLocations() -> ArrayString\n"
"\n"
"Returns the image locations for the last operation.");

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

    {
        const ::wxRichTextHTMLHandler *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxArrayString(sipCpp->GetTemporaryImageLocations());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_RichTextHTMLHandler, sipName_GetTemporaryImageLocations, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRichTextHTMLHandler_SetFontSizeMapping, "SetFontSizeMapping(fontSizeMapping)\n"
"\n"
"Sets the mapping for converting point sizes to HTML font sizes.");

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

    {
        const ::wxArrayInt* fontSizeMapping;
        int fontSizeMappingState = 0;
        ::wxRichTextHTMLHandler *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxRichTextHTMLHandler, &sipCpp, sipType_wxArrayInt, &fontSizeMapping, &fontSizeMappingState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetFontSizeMapping(*fontSizeMapping);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<::wxArrayInt *>(fontSizeMapping), sipType_wxArrayInt, fontSizeMappingState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_RichTextHTMLHandler, sipName_SetFontSizeMapping, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRichTextHTMLHandler_SetTempDir, "SetTempDir(tempDir)\n"
"\n"
"Sets the directory for storing temporary files.");

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

    {
        const ::wxString* tempDir;
        int tempDirState = 0;
        ::wxRichTextHTMLHandler *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxRichTextHTMLHandler, &sipCpp, sipType_wxString, &tempDir, &tempDirState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetTempDir(*tempDir);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<::wxString *>(tempDir), sipType_wxString, tempDirState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_RichTextHTMLHandler, sipName_SetTempDir, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRichTextHTMLHandler_SetTemporaryImageLocations, "SetTemporaryImageLocations(locations)\n"
"\n"
"Sets the list of image locations generated by the last operation.");

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

    {
        const ::wxArrayString* locations;
        int locationsState = 0;
        ::wxRichTextHTMLHandler *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxRichTextHTMLHandler, &sipCpp, sipType_wxArrayString, &locations, &locationsState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetTemporaryImageLocations(*locations);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<::wxArrayString *>(locations), sipType_wxArrayString, locationsState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_RichTextHTMLHandler, sipName_SetTemporaryImageLocations, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRichTextHTMLHandler_SetFileCounter, "SetFileCounter(counter)\n"
"\n"
"Reset the file counter, in case, for example, the same names are\n"
"required each time.");

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

    {
        int counter;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "i", &counter))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            ::wxRichTextHTMLHandler::SetFileCounter(counter);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_RichTextHTMLHandler, sipName_SetFileCounter, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRichTextHTMLHandler_DoLoadFile, "DoLoadFile(self, buffer: Optional[RichTextBuffer], stream: InputStream) -> bool");

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

    {
        ::wxRichTextBuffer* buffer;
        ::wxInputStream* stream;
        int streamState = 0;
        sipwxRichTextHTMLHandler *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8J1", &sipSelf, sipType_wxRichTextHTMLHandler, &sipCpp, sipType_wxRichTextBuffer, &buffer, sipType_wxInputStream, &stream, &streamState))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->sipProtectVirt_DoLoadFile(sipSelfWasArg, buffer, *stream);
            Py_END_ALLOW_THREADS
            sipReleaseType(stream, sipType_wxInputStream, streamState);

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_RichTextHTMLHandler, sipName_DoLoadFile, doc_wxRichTextHTMLHandler_DoLoadFile);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRichTextHTMLHandler_DoSaveFile, "DoSaveFile(self, buffer: Optional[RichTextBuffer], stream: OutputStream) -> bool");

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

    {
        ::wxRichTextBuffer* buffer;
        ::wxOutputStream* stream;
        int streamState = 0;
        sipwxRichTextHTMLHandler *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8J1", &sipSelf, sipType_wxRichTextHTMLHandler, &sipCpp, sipType_wxRichTextBuffer, &buffer, sipType_wxOutputStream, &stream, &streamState))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->sipProtectVirt_DoSaveFile(sipSelfWasArg, buffer, *stream);
            Py_END_ALLOW_THREADS
            sipReleaseType(stream, sipType_wxOutputStream, streamState);

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_RichTextHTMLHandler, sipName_DoSaveFile, doc_wxRichTextHTMLHandler_DoSaveFile);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxRichTextHTMLHandler)
        return sipCppV;

    sipCppV = ((const sipClassTypeDef *)sipType_wxRichTextFileHandler)->ctd_cast(static_cast<::wxRichTextFileHandler *>(sipCpp), targetType);
    if (sipCppV)
        return sipCppV;

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxRichTextHTMLHandler *>(sipCppV);
    else
        delete reinterpret_cast<::wxRichTextHTMLHandler *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


extern "C" {static void assign_wxRichTextHTMLHandler(void *, Py_ssize_t, void *);}
static void assign_wxRichTextHTMLHandler(void *sipDst, Py_ssize_t sipDstIdx, void *sipSrc)
{
    reinterpret_cast<::wxRichTextHTMLHandler *>(sipDst)[sipDstIdx] = *reinterpret_cast<::wxRichTextHTMLHandler *>(sipSrc);
}


extern "C" {static void *copy_wxRichTextHTMLHandler(const void *, Py_ssize_t);}
static void *copy_wxRichTextHTMLHandler(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new ::wxRichTextHTMLHandler(reinterpret_cast<const ::wxRichTextHTMLHandler *>(sipSrc)[sipSrcIdx]);
}


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

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


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

    {
        const ::wxString& namedef = "HTML";
        const ::wxString* name = &namedef;
        int nameState = 0;
        const ::wxString& extdef = "html";
        const ::wxString* ext = &extdef;
        int extState = 0;
        int type = wxRICHTEXT_TYPE_HTML;

        static const char *sipKwdList[] = {
            sipName_name,
            sipName_ext,
            sipName_type,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|J1J1i", sipType_wxString, &name, &nameState, sipType_wxString, &ext, &extState, &type))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxRichTextHTMLHandler(*name, *ext, type);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<::wxString *>(name), sipType_wxString, nameState);
            sipReleaseType(const_cast<::wxString *>(ext), sipType_wxString, extState);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxRichTextHTMLHandler* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxRichTextHTMLHandler[] = {
    {sipName_ClearTemporaryImageLocations, meth_wxRichTextHTMLHandler_ClearTemporaryImageLocations, METH_VARARGS, doc_wxRichTextHTMLHandler_ClearTemporaryImageLocations},
    {sipName_DeleteTemporaryImages, SIP_MLMETH_CAST(meth_wxRichTextHTMLHandler_DeleteTemporaryImages), METH_VARARGS|METH_KEYWORDS, doc_wxRichTextHTMLHandler_DeleteTemporaryImages},
    {sipName_DoLoadFile, SIP_MLMETH_CAST(meth_wxRichTextHTMLHandler_DoLoadFile), METH_VARARGS|METH_KEYWORDS, doc_wxRichTextHTMLHandler_DoLoadFile},
    {sipName_DoSaveFile, SIP_MLMETH_CAST(meth_wxRichTextHTMLHandler_DoSaveFile), METH_VARARGS|METH_KEYWORDS, doc_wxRichTextHTMLHandler_DoSaveFile},
    {sipName_GetFontSizeMapping, meth_wxRichTextHTMLHandler_GetFontSizeMapping, METH_VARARGS, doc_wxRichTextHTMLHandler_GetFontSizeMapping},
    {sipName_GetTempDir, meth_wxRichTextHTMLHandler_GetTempDir, METH_VARARGS, doc_wxRichTextHTMLHandler_GetTempDir},
    {sipName_GetTemporaryImageLocations, meth_wxRichTextHTMLHandler_GetTemporaryImageLocations, METH_VARARGS, doc_wxRichTextHTMLHandler_GetTemporaryImageLocations},
    {sipName_SetFileCounter, SIP_MLMETH_CAST(meth_wxRichTextHTMLHandler_SetFileCounter), METH_VARARGS|METH_KEYWORDS, doc_wxRichTextHTMLHandler_SetFileCounter},
    {sipName_SetFontSizeMapping, SIP_MLMETH_CAST(meth_wxRichTextHTMLHandler_SetFontSizeMapping), METH_VARARGS|METH_KEYWORDS, doc_wxRichTextHTMLHandler_SetFontSizeMapping},
    {sipName_SetTempDir, SIP_MLMETH_CAST(meth_wxRichTextHTMLHandler_SetTempDir), METH_VARARGS|METH_KEYWORDS, doc_wxRichTextHTMLHandler_SetTempDir},
    {sipName_SetTemporaryImageLocations, SIP_MLMETH_CAST(meth_wxRichTextHTMLHandler_SetTemporaryImageLocations), METH_VARARGS|METH_KEYWORDS, doc_wxRichTextHTMLHandler_SetTemporaryImageLocations}
};

sipVariableDef variables_wxRichTextHTMLHandler[] = {
    {PropertyVariable, sipName_TemporaryImageLocations, &methods_wxRichTextHTMLHandler[6], &methods_wxRichTextHTMLHandler[10], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_TempDir, &methods_wxRichTextHTMLHandler[5], &methods_wxRichTextHTMLHandler[9], SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_FontSizeMapping, &methods_wxRichTextHTMLHandler[4], &methods_wxRichTextHTMLHandler[8], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxRichTextHTMLHandler, "RichTextHTMLHandler(name=\"HTML\", ext=\"html\", type=RICHTEXT_TYPE_HTML)\n"
"\n"
"Handles HTML output (only) for wxRichTextCtrl content.");


sipClassTypeDef sipTypeDef__richtext_wxRichTextHTMLHandler = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxRichTextHTMLHandler,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_RichTextHTMLHandler,
        {0, 0, 1},
        11, methods_wxRichTextHTMLHandler,
        0, SIP_NULLPTR,
        3, variables_wxRichTextHTMLHandler,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxRichTextHTMLHandler,
    -1,
    -1,
    supers_wxRichTextHTMLHandler,
    SIP_NULLPTR,
    init_type_wxRichTextHTMLHandler,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxRichTextHTMLHandler,
    assign_wxRichTextHTMLHandler,
    array_wxRichTextHTMLHandler,
    copy_wxRichTextHTMLHandler,
    release_wxRichTextHTMLHandler,
    cast_wxRichTextHTMLHandler,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};
