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

#include "sipAPI_grid.h"
        #include <wx/grid.h>
        #include <wx/grid.h>
        #include <wx/grid.h>
        #include <wx/grid.h>
        #include <wx/control.h>
        #include <wx/window.h>
        #include <wx/event.h>
        #include <wx/grid.h>
        #include <wx/gdicmn.h>
        #include <wx/dc.h>
        #include <wx/event.h>
        #include <wx/grid.h>


class sipwxGridCellActivatableEditor : public ::wxGridCellActivatableEditor
{
public:
    sipwxGridCellActivatableEditor();
    virtual ~sipwxGridCellActivatableEditor();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    void BeginEdit(int, int, ::wxGrid*) SIP_OVERRIDE;
    ::wxGridCellEditor* Clone() const SIP_OVERRIDE;
    void Create(::wxWindow*, ::wxWindowID, ::wxEvtHandler*) SIP_OVERRIDE;
    void Destroy() SIP_OVERRIDE;
    bool EndEdit(int, int, const ::wxGrid*, const ::wxString&, ::wxString*) SIP_OVERRIDE;
    void ApplyEdit(int, int, ::wxGrid*) SIP_OVERRIDE;
    void HandleReturn(::wxKeyEvent&) SIP_OVERRIDE;
    void PaintBackground(::wxDC&, const ::wxRect&, const ::wxGridCellAttr&) SIP_OVERRIDE;
    void Reset() SIP_OVERRIDE;
    void SetSize(const ::wxRect&) SIP_OVERRIDE;
    void Show(bool, ::wxGridCellAttr*) SIP_OVERRIDE;
    void StartingClick() SIP_OVERRIDE;
    void StartingKey(::wxKeyEvent&) SIP_OVERRIDE;
    bool IsAcceptedKey(::wxKeyEvent&) SIP_OVERRIDE;
    ::wxString GetValue() const SIP_OVERRIDE;
    ::wxGridActivationResult TryActivate(int, int, ::wxGrid*, const ::wxGridActivationSource&) SIP_OVERRIDE;
    void DoActivate(int, int, ::wxGrid*) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[17];
};

sipwxGridCellActivatableEditor::sipwxGridCellActivatableEditor(): ::wxGridCellActivatableEditor(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

void sipwxGridCellActivatableEditor::BeginEdit(int row, int col, ::wxGrid*grid)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[0], &sipPySelf, sipName_GridCellActivatableEditor, sipName_BeginEdit);

    if (!sipMeth)
        return;

    extern void sipVH__grid_6(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, ::wxGrid*);

    sipVH__grid_6(sipGILState, 0, sipPySelf, sipMeth, row, col, grid);
}

::wxGridCellEditor* sipwxGridCellActivatableEditor::Clone() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return 0;

    extern ::wxGridCellEditor* sipVH__grid_7(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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

void sipwxGridCellActivatableEditor::Create(::wxWindow*parent, ::wxWindowID id, ::wxEvtHandler*evtHandler)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[2], &sipPySelf, sipName_GridCellActivatableEditor, sipName_Create);

    if (!sipMeth)
        return;

    extern void sipVH__grid_8(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxWindow*, ::wxWindowID, ::wxEvtHandler*);

    sipVH__grid_8(sipGILState, 0, sipPySelf, sipMeth, parent, id, evtHandler);
}

void sipwxGridCellActivatableEditor::Destroy()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[3], &sipPySelf, SIP_NULLPTR, sipName_Destroy);

    if (!sipMeth)
    {
        ::wxGridCellActivatableEditor::Destroy();
        return;
    }

    extern void sipVH__grid_9(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    sipVH__grid_9(sipGILState, 0, sipPySelf, sipMeth);
}

bool sipwxGridCellActivatableEditor::EndEdit(int row, int col, const ::wxGrid*grid, const ::wxString& oldval, ::wxString*newval)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[4], &sipPySelf, sipName_GridCellActivatableEditor, sipName_EndEdit);

    if (!sipMeth)
        return 0;

    extern bool sipVH__grid_10(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, const ::wxGrid*, const ::wxString&, ::wxString*);

    return sipVH__grid_10(sipGILState, 0, sipPySelf, sipMeth, row, col, grid, oldval, newval);
}

void sipwxGridCellActivatableEditor::ApplyEdit(int row, int col, ::wxGrid*grid)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[5], &sipPySelf, sipName_GridCellActivatableEditor, sipName_ApplyEdit);

    if (!sipMeth)
        return;

    extern void sipVH__grid_6(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, ::wxGrid*);

    sipVH__grid_6(sipGILState, 0, sipPySelf, sipMeth, row, col, grid);
}

void sipwxGridCellActivatableEditor::HandleReturn(::wxKeyEvent& event)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
        ::wxGridCellActivatableEditor::HandleReturn(event);
        return;
    }

    extern void sipVH__grid_11(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxKeyEvent&);

    sipVH__grid_11(sipGILState, 0, sipPySelf, sipMeth, event);
}

void sipwxGridCellActivatableEditor::PaintBackground(::wxDC& dc, const ::wxRect& rectCell, const ::wxGridCellAttr& attr)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
        ::wxGridCellActivatableEditor::PaintBackground(dc, rectCell, attr);
        return;
    }

    extern void sipVH__grid_12(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxDC&, const ::wxRect&, const ::wxGridCellAttr&);

    sipVH__grid_12(sipGILState, 0, sipPySelf, sipMeth, dc, rectCell, attr);
}

void sipwxGridCellActivatableEditor::Reset()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[8], &sipPySelf, sipName_GridCellActivatableEditor, sipName_Reset);

    if (!sipMeth)
        return;

    extern void sipVH__grid_9(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    sipVH__grid_9(sipGILState, 0, sipPySelf, sipMeth);
}

void sipwxGridCellActivatableEditor::SetSize(const ::wxRect& rect)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[9], &sipPySelf, SIP_NULLPTR, sipName_SetSize);

    if (!sipMeth)
    {
        ::wxGridCellActivatableEditor::SetSize(rect);
        return;
    }

    extern void sipVH__grid_13(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxRect&);

    sipVH__grid_13(sipGILState, 0, sipPySelf, sipMeth, rect);
}

void sipwxGridCellActivatableEditor::Show(bool show, ::wxGridCellAttr*attr)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[10], &sipPySelf, SIP_NULLPTR, sipName_Show);

    if (!sipMeth)
    {
        ::wxGridCellActivatableEditor::Show(show, attr);
        return;
    }

    extern void sipVH__grid_14(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, bool, ::wxGridCellAttr*);

    sipVH__grid_14(sipGILState, 0, sipPySelf, sipMeth, show, attr);
}

void sipwxGridCellActivatableEditor::StartingClick()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[11], &sipPySelf, SIP_NULLPTR, sipName_StartingClick);

    if (!sipMeth)
    {
        ::wxGridCellActivatableEditor::StartingClick();
        return;
    }

    extern void sipVH__grid_9(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    sipVH__grid_9(sipGILState, 0, sipPySelf, sipMeth);
}

void sipwxGridCellActivatableEditor::StartingKey(::wxKeyEvent& event)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[12], &sipPySelf, SIP_NULLPTR, sipName_StartingKey);

    if (!sipMeth)
    {
        ::wxGridCellActivatableEditor::StartingKey(event);
        return;
    }

    extern void sipVH__grid_11(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxKeyEvent&);

    sipVH__grid_11(sipGILState, 0, sipPySelf, sipMeth, event);
}

bool sipwxGridCellActivatableEditor::IsAcceptedKey(::wxKeyEvent& event)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[13], &sipPySelf, SIP_NULLPTR, sipName_IsAcceptedKey);

    if (!sipMeth)
        return ::wxGridCellActivatableEditor::IsAcceptedKey(event);

    extern bool sipVH__grid_15(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxKeyEvent&);

    return sipVH__grid_15(sipGILState, 0, sipPySelf, sipMeth, event);
}

::wxString sipwxGridCellActivatableEditor::GetValue() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[14]), const_cast<sipSimpleWrapper **>(&sipPySelf), sipName_GridCellActivatableEditor, sipName_GetValue);

    if (!sipMeth)
        return ::wxString();

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

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

::wxGridActivationResult sipwxGridCellActivatableEditor::TryActivate(int row, int col, ::wxGrid*grid, const ::wxGridActivationSource& actSource)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[15], &sipPySelf, sipName_GridCellActivatableEditor, sipName_TryActivate);

    if (!sipMeth)
    {
        static ::wxGridActivationResult *sipCpp = SIP_NULLPTR;

        if (!sipCpp)
        {
        wxGridActivationResult result = wxGridActivationResult::DoNothing();
        sipCpp = &result;
        }

        return *sipCpp;
    }

    extern ::wxGridActivationResult sipVH__grid_17(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, ::wxGrid*, const ::wxGridActivationSource&);

    return sipVH__grid_17(sipGILState, 0, sipPySelf, sipMeth, row, col, grid, actSource);
}

void sipwxGridCellActivatableEditor::DoActivate(int row, int col, ::wxGrid*grid)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[16], &sipPySelf, sipName_GridCellActivatableEditor, sipName_DoActivate);

    if (!sipMeth)
        return;

    extern void sipVH__grid_6(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, int, ::wxGrid*);

    sipVH__grid_6(sipGILState, 0, sipPySelf, sipMeth, row, col, grid);
}


PyDoc_STRVAR(doc_wxGridCellActivatableEditor_TryActivate, "TryActivate(row, col, grid, actSource) -> GridActivationResult\n"
"\n"
"Same method as in wxGridCellEditor, but pure virtual.");

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

    {
        int row;
        int col;
        ::wxGrid* grid;
        const ::wxGridActivationSource* actSource;
        ::wxGridCellActivatableEditor *sipCpp;

        static const char *sipKwdList[] = {
            sipName_row,
            sipName_col,
            sipName_grid,
            sipName_actSource,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BiiJ8J9", &sipSelf, sipType_wxGridCellActivatableEditor, &sipCpp, &row, &col, sipType_wxGrid, &grid, sipType_wxGridActivationSource, &actSource))
        {
            ::wxGridActivationResult*sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_GridCellActivatableEditor, sipName_TryActivate);
                return SIP_NULLPTR;
            }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxGridActivationResult(sipCpp->TryActivate(row, col, grid, *actSource));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_GridCellActivatableEditor, sipName_TryActivate, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxGridCellActivatableEditor_DoActivate, "DoActivate(row, col, grid)\n"
"\n"
"Same method as in wxGridCellEditor, but pure virtual.");

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

    {
        int row;
        int col;
        ::wxGrid* grid;
        ::wxGridCellActivatableEditor *sipCpp;

        static const char *sipKwdList[] = {
            sipName_row,
            sipName_col,
            sipName_grid,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BiiJ8", &sipSelf, sipType_wxGridCellActivatableEditor, &sipCpp, &row, &col, sipType_wxGrid, &grid))
        {
            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_GridCellActivatableEditor, sipName_DoActivate);
                return SIP_NULLPTR;
            }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->DoActivate(row, col, grid);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_GridCellActivatableEditor, sipName_DoActivate, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxGridCellActivatableEditor)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxGridCellActivatableEditor *>(sipCppV);
    else
        delete reinterpret_cast<::wxGridCellActivatableEditor *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxGridCellActivatableEditor();
            Py_END_ALLOW_THREADS

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxGridCellActivatableEditor[] = {
    {sipName_DoActivate, SIP_MLMETH_CAST(meth_wxGridCellActivatableEditor_DoActivate), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellActivatableEditor_DoActivate},
    {sipName_TryActivate, SIP_MLMETH_CAST(meth_wxGridCellActivatableEditor_TryActivate), METH_VARARGS|METH_KEYWORDS, doc_wxGridCellActivatableEditor_TryActivate}
};

PyDoc_STRVAR(doc_wxGridCellActivatableEditor, "Base class for activatable editors.");


sipClassTypeDef sipTypeDef__grid_wxGridCellActivatableEditor = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_CLASS,
        sipNameNr_wxGridCellActivatableEditor,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_GridCellActivatableEditor,
        {0, 0, 1},
        2, methods_wxGridCellActivatableEditor,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxGridCellActivatableEditor,
    -1,
    -1,
    supers_wxGridCellActivatableEditor,
    SIP_NULLPTR,
    init_type_wxGridCellActivatableEditor,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxGridCellActivatableEditor,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxGridCellActivatableEditor,
    cast_wxGridCellActivatableEditor,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
};
