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

#include "sipAPI_core.h"

        #include <wx/filepicker.h>

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


class sipwxFileDirPickerEvent : public  ::wxFileDirPickerEvent
{
public:
    sipwxFileDirPickerEvent();
    sipwxFileDirPickerEvent( ::wxEventType, ::wxObject*,int,const  ::wxString&);
    sipwxFileDirPickerEvent(const  ::wxFileDirPickerEvent&);
    virtual ~sipwxFileDirPickerEvent();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
     ::wxEventCategory GetEventCategory() const SIP_OVERRIDE;
     ::wxEvent* Clone() const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[2];
};

sipwxFileDirPickerEvent::sipwxFileDirPickerEvent():  ::wxFileDirPickerEvent(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipwxFileDirPickerEvent::sipwxFileDirPickerEvent( ::wxEventType type, ::wxObject*generator,int id,const  ::wxString& path):  ::wxFileDirPickerEvent(type,generator,id,path), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

 ::wxEventCategory sipwxFileDirPickerEvent::GetEventCategory() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::wxFileDirPickerEvent::GetEventCategory();

    extern  ::wxEventCategory sipVH__core_92(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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

 ::wxEvent* sipwxFileDirPickerEvent::Clone() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

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

    extern  ::wxEvent* sipVH__core_91(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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


PyDoc_STRVAR(doc_wxFileDirPickerEvent_GetPath, "GetPath() -> String\n"
"\n"
"Retrieve the absolute path of the file/directory the user has just\n"
"selected.");

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

    {
        const  ::wxFileDirPickerEvent *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFileDirPickerEvent_SetPath, "SetPath(path)\n"
"\n"
"Set the absolute path of the file/directory associated with the event.");

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

    {
        const  ::wxString* path;
        int pathState = 0;
         ::wxFileDirPickerEvent *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxFileDirPickerEvent, &sipCpp, sipType_wxString,&path, &pathState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->SetPath(*path);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(path),sipType_wxString,pathState);

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFileDirPickerEvent_Clone, "Clone(self) -> Event");

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

    {
        const  ::wxFileDirPickerEvent *sipCpp;

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

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = (sipSelfWasArg ? sipCpp-> ::wxFileDirPickerEvent::Clone() : sipCpp->Clone());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

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

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_FileDirPickerEvent, sipName_Clone, doc_wxFileDirPickerEvent_Clone);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_wxCommandEvent)
        return static_cast< ::wxCommandEvent *>(sipCpp);

    if (targetType == sipType_wxEvent)
        return static_cast< ::wxEvent *>(sipCpp);

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

    return sipCppV;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxFileDirPickerEvent *>(sipCppV);
    else
        delete reinterpret_cast< ::wxFileDirPickerEvent *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxFileDirPickerEvent();
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
         ::wxEventType type;
         ::wxObject* generator;
        int id;
        const  ::wxString* path;
        int pathState = 0;

        static const char *sipKwdList[] = {
            sipName_type,
            sipName_generator,
            sipName_id,
            sipName_path,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "iJ8iJ1", &type, sipType_wxObject, &generator, &id, sipType_wxString,&path, &pathState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxFileDirPickerEvent(type,generator,id,*path);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(path),sipType_wxString,pathState);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::wxFileDirPickerEvent* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


static PyMethodDef methods_wxFileDirPickerEvent[] = {
    {SIP_MLNAME_CAST(sipName_Clone), meth_wxFileDirPickerEvent_Clone, METH_VARARGS, SIP_MLDOC_CAST(doc_wxFileDirPickerEvent_Clone)},
    {SIP_MLNAME_CAST(sipName_GetPath), meth_wxFileDirPickerEvent_GetPath, METH_VARARGS, SIP_MLDOC_CAST(doc_wxFileDirPickerEvent_GetPath)},
    {SIP_MLNAME_CAST(sipName_SetPath), SIP_MLMETH_CAST(meth_wxFileDirPickerEvent_SetPath), METH_VARARGS|METH_KEYWORDS, SIP_MLDOC_CAST(doc_wxFileDirPickerEvent_SetPath)}
};

sipVariableDef variables_wxFileDirPickerEvent[] = {
    {PropertyVariable, sipName_Path, &methods_wxFileDirPickerEvent[1], &methods_wxFileDirPickerEvent[2], SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxFileDirPickerEvent, "FileDirPickerEvent()\n"
"FileDirPickerEvent(type, generator, id, path)\n"
"\n"
"This event class is used for the events generated by wxFilePickerCtrl\n"
"and by wxDirPickerCtrl.");


sipClassTypeDef sipTypeDef__core_wxFileDirPickerEvent = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_wxFileDirPickerEvent,
        {SIP_NULLPTR},
        SIP_NULLPTR
    },
    {
        sipNameNr_FileDirPickerEvent,
        {0, 0, 1},
        3, methods_wxFileDirPickerEvent,
        0, SIP_NULLPTR,
        1, variables_wxFileDirPickerEvent,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxFileDirPickerEvent,
    -1,
    -1,
    supers_wxFileDirPickerEvent,
    SIP_NULLPTR,
    init_type_wxFileDirPickerEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
#if PY_MAJOR_VERSION >= 3
    SIP_NULLPTR,
    SIP_NULLPTR,
#else
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
#endif
    dealloc_wxFileDirPickerEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxFileDirPickerEvent,
    cast_wxFileDirPickerEvent,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR
};
