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

#include "sipAPI_propgrid.h"

        #include <wx/propgrid/props.h>

        #include <wx/window.h>
        #include <wx/object.h>
        #include <wx/event.h>
        #include <wx/eventfilter.h>
        #include <wx/event.h>
        #include <wx/object.h>
        #include <wx/object.h>


class sipwxNumericPropertyValidator : public  ::wxNumericPropertyValidator
{
public:
    sipwxNumericPropertyValidator( ::wxNumericPropertyValidator::NumericType,int);
    virtual ~sipwxNumericPropertyValidator();

    /*
     * There is a public method for every protected method visible from
     * this class.
     */
    bool sipProtectVirt_TryBefore(bool, ::wxEvent&);
    bool sipProtectVirt_TryAfter(bool, ::wxEvent&);

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    bool TryAfter( ::wxEvent&) SIP_OVERRIDE;
    bool TryBefore( ::wxEvent&) SIP_OVERRIDE;
    bool ProcessEvent( ::wxEvent&) SIP_OVERRIDE;
     ::wxObject* Clone() const SIP_OVERRIDE;
    bool TransferFromWindow() SIP_OVERRIDE;
    bool TransferToWindow() SIP_OVERRIDE;
    bool Validate( ::wxWindow*) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[7];
};

sipwxNumericPropertyValidator::sipwxNumericPropertyValidator( ::wxNumericPropertyValidator::NumericType numericType,int base):  ::wxNumericPropertyValidator(numericType,base), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

bool sipwxNumericPropertyValidator::TryAfter( ::wxEvent& event)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxNumericPropertyValidator::TryAfter(event);

    extern bool sipVH__propgrid_49(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxEvent&);

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

bool sipwxNumericPropertyValidator::TryBefore( ::wxEvent& event)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxNumericPropertyValidator::TryBefore(event);

    extern bool sipVH__propgrid_49(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxEvent&);

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

bool sipwxNumericPropertyValidator::ProcessEvent( ::wxEvent& event)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxNumericPropertyValidator::ProcessEvent(event);

    extern bool sipVH__propgrid_49(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxEvent&);

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

 ::wxObject* sipwxNumericPropertyValidator::Clone() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxNumericPropertyValidator::Clone();

    extern  ::wxObject* sipVH__propgrid_58(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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

bool sipwxNumericPropertyValidator::TransferFromWindow()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[4],sipPySelf,SIP_NULLPTR,sipName_TransferFromWindow);

    if (!sipMeth)
        return  ::wxNumericPropertyValidator::TransferFromWindow();

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

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

bool sipwxNumericPropertyValidator::TransferToWindow()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[5],sipPySelf,SIP_NULLPTR,sipName_TransferToWindow);

    if (!sipMeth)
        return  ::wxNumericPropertyValidator::TransferToWindow();

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

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

bool sipwxNumericPropertyValidator::Validate( ::wxWindow*parent)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxNumericPropertyValidator::Validate(parent);

    extern bool sipVH__propgrid_57(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *,  ::wxWindow*);

    return sipVH__propgrid_57(sipGILState, 0, sipPySelf, sipMeth, parent);
}

bool sipwxNumericPropertyValidator::sipProtectVirt_TryBefore(bool sipSelfWasArg, ::wxEvent& event)
{
    return (sipSelfWasArg ?  ::wxEvtHandler::TryBefore(event) : TryBefore(event));
}

bool sipwxNumericPropertyValidator::sipProtectVirt_TryAfter(bool sipSelfWasArg, ::wxEvent& event)
{
    return (sipSelfWasArg ?  ::wxEvtHandler::TryAfter(event) : TryAfter(event));
}


PyDoc_STRVAR(doc_wxNumericPropertyValidator_TryBefore, "TryBefore(event) -> bool\n"
"\n"
"Method called by ProcessEvent() before examining this object event\n"
"tables.");

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

    {
         ::wxEvent* event;
        sipwxNumericPropertyValidator *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxNumericPropertyValidator, &sipCpp, sipType_wxEvent, &event))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->sipProtectVirt_TryBefore(sipSelfWasArg,*event);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxNumericPropertyValidator_TryAfter, "TryAfter(event) -> bool\n"
"\n"
"Method called by ProcessEvent() as last resort.");

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

    {
         ::wxEvent* event;
        sipwxNumericPropertyValidator *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxNumericPropertyValidator, &sipCpp, sipType_wxEvent, &event))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->sipProtectVirt_TryAfter(sipSelfWasArg,*event);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxNumericPropertyValidator_Validate, "Validate(parent) -> bool\n"
"\n"
"Validates the window contents against the include or exclude lists,\n"
"depending on the validator style.");

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

    {
         ::wxWindow* parent;
         ::wxNumericPropertyValidator *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ8", &sipSelf, sipType_wxNumericPropertyValidator, &sipCpp, sipType_wxWindow, &parent))
        {
            bool sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp-> ::wxNumericPropertyValidator::Validate(parent) : sipCpp->Validate(parent));
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            return PyBool_FromLong(sipRes);
        }
    }

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

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxValidator)
        return static_cast< ::wxValidator *>(sipCpp);

    if (targetType == sipType_wxEvtHandler)
        return static_cast< ::wxEvtHandler *>(sipCpp);

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

    if (targetType == sipType_wxTrackable)
        return static_cast< ::wxTrackable *>(sipCpp);

    return sipCppV;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxNumericPropertyValidator *>(sipCppV);
    else
        delete reinterpret_cast< ::wxNumericPropertyValidator *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
         ::wxNumericPropertyValidator::NumericType numericType;
        int base = 10;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "E|i", sipType_wxNumericPropertyValidator_NumericType, &numericType, &base))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxNumericPropertyValidator(numericType,base);
            Py_END_ALLOW_THREADS

            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_wxNumericPropertyValidator[] = {{33, 0, 1}};


static PyMethodDef methods_wxNumericPropertyValidator[] = {
    {SIP_MLNAME_CAST(sipName_TryAfter), SIP_MLMETH_CAST(meth_wxNumericPropertyValidator_TryAfter), METH_VARARGS|METH_KEYWORDS, SIP_NULLPTR},
    {SIP_MLNAME_CAST(sipName_TryBefore), SIP_MLMETH_CAST(meth_wxNumericPropertyValidator_TryBefore), METH_VARARGS|METH_KEYWORDS, SIP_NULLPTR},
    {SIP_MLNAME_CAST(sipName_Validate), SIP_MLMETH_CAST(meth_wxNumericPropertyValidator_Validate), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxNumericPropertyValidator_Validate)}
};

static sipEnumMemberDef enummembers_wxNumericPropertyValidator[] = {
    {sipName_Float, static_cast<int>( ::wxNumericPropertyValidator::Float), 20},
    {sipName_Signed, static_cast<int>( ::wxNumericPropertyValidator::Signed), 20},
    {sipName_Unsigned, static_cast<int>( ::wxNumericPropertyValidator::Unsigned), 20},
};

PyDoc_STRVAR(doc_wxNumericPropertyValidator, "NumericPropertyValidator(numericType, base=10)\n"
"\n"
"A more comprehensive numeric validator class.");


sipClassTypeDef sipTypeDef__propgrid_wxNumericPropertyValidator = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxNumericPropertyValidator,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_NumericPropertyValidator,
        {0, 0, 1},
        3, methods_wxNumericPropertyValidator,
        3, enummembers_wxNumericPropertyValidator,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxNumericPropertyValidator,
    -1,
    -1,
    supers_wxNumericPropertyValidator,
    SIP_NULLPTR,
    init_type_wxNumericPropertyValidator,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxNumericPropertyValidator,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxNumericPropertyValidator,
    cast_wxNumericPropertyValidator,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
