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

#include "sipAPI_richtext.h"

        #include <wx/richtext/richtextstyles.h>

        #include <wx/richtext/richtextbuffer.h>
        #include <wx/richtext/richtextbuffer.h>
        #include <wx/richtext/richtextstyles.h>
        #include <wx/object.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxRichTextParagraphStyleDefinition : public  ::wxRichTextParagraphStyleDefinition
{
public:
    sipwxRichTextParagraphStyleDefinition(const  ::wxString&);
    sipwxRichTextParagraphStyleDefinition(const  ::wxRichTextParagraphStyleDefinition&);
    virtual ~sipwxRichTextParagraphStyleDefinition();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
     ::wxRichTextAttr GetStyleMergedWithBase(const  ::wxRichTextStyleSheet*) const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[1];
};

sipwxRichTextParagraphStyleDefinition::sipwxRichTextParagraphStyleDefinition(const  ::wxString& name):  ::wxRichTextParagraphStyleDefinition(name), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

 ::wxRichTextAttr sipwxRichTextParagraphStyleDefinition::GetStyleMergedWithBase(const  ::wxRichTextStyleSheet*sheet) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxRichTextParagraphStyleDefinition::GetStyleMergedWithBase(sheet);

    extern  ::wxRichTextAttr sipVH__richtext_158(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::wxRichTextStyleSheet*);

    return sipVH__richtext_158(sipGILState, 0, sipPySelf, sipMeth, sheet);
}


PyDoc_STRVAR(doc_wxRichTextParagraphStyleDefinition_GetNextStyle, "GetNextStyle() -> String\n"
"\n"
"Returns the style that should normally follow this style.");

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

    {
        const  ::wxRichTextParagraphStyleDefinition *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_RichTextParagraphStyleDefinition, sipName_GetNextStyle, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxRichTextParagraphStyleDefinition_SetNextStyle, "SetNextStyle(name)\n"
"\n"
"Sets the style that should normally follow this style.");

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

    {
        const  ::wxString* name;
        int nameState = 0;
         ::wxRichTextParagraphStyleDefinition *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxRichTextParagraphStyleDefinition, &sipCpp, sipType_wxString,&name, &nameState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetNextStyle(*name);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(name),sipType_wxString,nameState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_RichTextParagraphStyleDefinition, sipName_SetNextStyle, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxRichTextStyleDefinition)
        return static_cast< ::wxRichTextStyleDefinition *>(sipCpp);

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

    return sipCppV;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxRichTextParagraphStyleDefinition *>(sipCppV);
    else
        delete reinterpret_cast< ::wxRichTextParagraphStyleDefinition *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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


extern "C" {static void assign_wxRichTextParagraphStyleDefinition(void *, SIP_SSIZE_T, void *);}
static void assign_wxRichTextParagraphStyleDefinition(void *sipDst, SIP_SSIZE_T sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::wxRichTextParagraphStyleDefinition *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxRichTextParagraphStyleDefinition *>(sipSrc);
}


extern "C" {static void *copy_wxRichTextParagraphStyleDefinition(const void *, SIP_SSIZE_T);}
static void *copy_wxRichTextParagraphStyleDefinition(const void *sipSrc, SIP_SSIZE_T sipSrcIdx)
{
    return new  ::wxRichTextParagraphStyleDefinition(reinterpret_cast<const  ::wxRichTextParagraphStyleDefinition *>(sipSrc)[sipSrcIdx]);
}


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

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


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

    {
        const  ::wxString& namedef = wxEmptyString;
        const  ::wxString* name = &namedef;
        int nameState = 0;

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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxRichTextParagraphStyleDefinition(*name);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(name),sipType_wxString,nameState);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxRichTextParagraphStyleDefinition* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxRichTextParagraphStyleDefinition[] = {
    {SIP_MLNAME_CAST(sipName_GetNextStyle), meth_wxRichTextParagraphStyleDefinition_GetNextStyle, METH_VARARGS, SIP_MLDOC_CAST(doc_wxRichTextParagraphStyleDefinition_GetNextStyle)},
    {SIP_MLNAME_CAST(sipName_SetNextStyle), SIP_MLMETH_CAST(meth_wxRichTextParagraphStyleDefinition_SetNextStyle), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxRichTextParagraphStyleDefinition_SetNextStyle)}
};

sipVariableDef variables_wxRichTextParagraphStyleDefinition[] = {
    {PropertyVariable, sipName_NextStyle, &methods_wxRichTextParagraphStyleDefinition[0], &methods_wxRichTextParagraphStyleDefinition[1], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxRichTextParagraphStyleDefinition, "RichTextParagraphStyleDefinition(name=wx.EmptyString)\n"
"\n"
"This class represents a paragraph style definition, usually added to a\n"
"wxRichTextStyleSheet.");


sipClassTypeDef sipTypeDef__richtext_wxRichTextParagraphStyleDefinition = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxRichTextParagraphStyleDefinition,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_RichTextParagraphStyleDefinition,
        {0, 0, 1},
        2, methods_wxRichTextParagraphStyleDefinition,
        0, SIP_NULLPTR,
        1, variables_wxRichTextParagraphStyleDefinition,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxRichTextParagraphStyleDefinition,
    -1,
    -1,
    supers_wxRichTextParagraphStyleDefinition,
    SIP_NULLPTR,
    init_type_wxRichTextParagraphStyleDefinition,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxRichTextParagraphStyleDefinition,
    assign_wxRichTextParagraphStyleDefinition,
    array_wxRichTextParagraphStyleDefinition,
    copy_wxRichTextParagraphStyleDefinition,
    release_wxRichTextParagraphStyleDefinition,
    cast_wxRichTextParagraphStyleDefinition,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
