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

#include "sipAPI_core.h"
        #include <wx/filedlgcustomize.h>
        #include <wx/filedlgcustomize.h>


class sipwxFileDialogCustomizeHook : public ::wxFileDialogCustomizeHook
{
public:
    sipwxFileDialogCustomizeHook();
    sipwxFileDialogCustomizeHook(const ::wxFileDialogCustomizeHook&);
    virtual ~sipwxFileDialogCustomizeHook();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    void TransferDataFromCustomControls() SIP_OVERRIDE;
    void UpdateCustomControls() SIP_OVERRIDE;
    void AddCustomControls(::wxFileDialogCustomize&) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[3];
};

sipwxFileDialogCustomizeHook::sipwxFileDialogCustomizeHook(): ::wxFileDialogCustomizeHook(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

void sipwxFileDialogCustomizeHook::TransferDataFromCustomControls()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
        ::wxFileDialogCustomizeHook::TransferDataFromCustomControls();
        return;
    }

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

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

void sipwxFileDialogCustomizeHook::UpdateCustomControls()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
        ::wxFileDialogCustomizeHook::UpdateCustomControls();
        return;
    }

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

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

void sipwxFileDialogCustomizeHook::AddCustomControls(::wxFileDialogCustomize& customizer)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[2], &sipPySelf, sipName_FileDialogCustomizeHook, sipName_AddCustomControls);

    if (!sipMeth)
        return;

    extern void sipVH__core_192(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::wxFileDialogCustomize&);

    sipVH__core_192(sipGILState, 0, sipPySelf, sipMeth, customizer);
}


PyDoc_STRVAR(doc_wxFileDialogCustomizeHook_AddCustomControls, "AddCustomControls(customizer) -> None\n"
"\n"
"Must be overridden to add custom controls to the dialog using the\n"
"provided customizer object.");

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

    {
        ::wxFileDialogCustomize* customizer;
        ::wxFileDialogCustomizeHook *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9", &sipSelf, sipType_wxFileDialogCustomizeHook, &sipCpp, sipType_wxFileDialogCustomize, &customizer))
        {
            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_FileDialogCustomizeHook, sipName_AddCustomControls);
                return SIP_NULLPTR;
            }

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp->AddCustomControls(*customizer);
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_FileDialogCustomizeHook, sipName_AddCustomControls, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFileDialogCustomizeHook_UpdateCustomControls, "UpdateCustomControls() -> None\n"
"\n"
"May be overridden to update the custom controls whenever something\n"
"changes in the dialog.");

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

    {
        ::wxFileDialogCustomizeHook *sipCpp;

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

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxFileDialogCustomizeHook::UpdateCustomControls() : sipCpp->UpdateCustomControls());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_FileDialogCustomizeHook, sipName_UpdateCustomControls, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFileDialogCustomizeHook_TransferDataFromCustomControls, "TransferDataFromCustomControls() -> None\n"
"\n"
"Should typically be overridden to save the values of the custom\n"
"controls when the dialog is accepted.");

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

    {
        ::wxFileDialogCustomizeHook *sipCpp;

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

            Py_BEGIN_ALLOW_THREADS
            (sipSelfWasArg ? sipCpp->::wxFileDialogCustomizeHook::TransferDataFromCustomControls() : sipCpp->TransferDataFromCustomControls());
            Py_END_ALLOW_THREADS

            if (PyErr_Occurred())
                return 0;

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_FileDialogCustomizeHook, sipName_TransferDataFromCustomControls, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxFileDialogCustomizeHook *>(sipCppV);
    else
        delete reinterpret_cast< ::wxFileDialogCustomizeHook *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxFileDialogCustomizeHook* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxFileDialogCustomizeHook[] = {
    {sipName_AddCustomControls, SIP_MLMETH_CAST(meth_wxFileDialogCustomizeHook_AddCustomControls), METH_VARARGS|METH_KEYWORDS, doc_wxFileDialogCustomizeHook_AddCustomControls},
    {sipName_TransferDataFromCustomControls, meth_wxFileDialogCustomizeHook_TransferDataFromCustomControls, METH_VARARGS, doc_wxFileDialogCustomizeHook_TransferDataFromCustomControls},
    {sipName_UpdateCustomControls, meth_wxFileDialogCustomizeHook_UpdateCustomControls, METH_VARARGS, doc_wxFileDialogCustomizeHook_UpdateCustomControls}
};

PyDoc_STRVAR(doc_wxFileDialogCustomizeHook, "Base class for customization hooks used with wxFileDialog.");


sipClassTypeDef sipTypeDef__core_wxFileDialogCustomizeHook = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_CLASS,
        sipNameNr_wxFileDialogCustomizeHook,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_FileDialogCustomizeHook,
        {0, 0, 1},
        3, methods_wxFileDialogCustomizeHook,
        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_wxFileDialogCustomizeHook,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxFileDialogCustomizeHook,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxFileDialogCustomizeHook,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_wxFileDialogCustomizeHook,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::wxFileDialogCustomizeHook),
};
