/*
 * 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/mimetype.h>
            #include <wx/mimetype.h>



class sipwxFileType_MessageParameters : public ::wxFileType::MessageParameters
{
public:
    sipwxFileType_MessageParameters();
    sipwxFileType_MessageParameters(const ::wxString&, const ::wxString&);
    sipwxFileType_MessageParameters(const ::wxFileType::MessageParameters&);
    virtual ~sipwxFileType_MessageParameters();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    ::wxString GetParamValue(const ::wxString&) const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[1];
};

sipwxFileType_MessageParameters::sipwxFileType_MessageParameters(): ::wxFileType::MessageParameters(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipwxFileType_MessageParameters::sipwxFileType_MessageParameters(const ::wxString& filename, const ::wxString& mimetype): ::wxFileType::MessageParameters(filename, mimetype), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipwxFileType_MessageParameters::sipwxFileType_MessageParameters(const ::wxFileType::MessageParameters& a0): ::wxFileType::MessageParameters(a0), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

::wxString sipwxFileType_MessageParameters::GetParamValue(const ::wxString& name) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::wxFileType::MessageParameters::GetParamValue(name);

    extern ::wxString sipVH__core_231(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::wxString&);

    return sipVH__core_231(sipGILState, 0, sipPySelf, sipMeth, name);
}


PyDoc_STRVAR(doc_wxFileType_MessageParameters_GetFileName, "GetFileName() -> str\n"
"\n"
"Return the filename.");

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

    {
        const ::wxFileType::MessageParameters *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_MessageParameters, sipName_GetFileName, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFileType_MessageParameters_GetMimeType, "GetMimeType() -> str\n"
"\n"
"Return the MIME type.");

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

    {
        const ::wxFileType::MessageParameters *sipCpp;

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

            PyErr_Clear();

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

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_MessageParameters, sipName_GetMimeType, SIP_NULLPTR);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_wxFileType_MessageParameters_GetParamValue, "GetParamValue(name) -> str\n"
"\n"
"Overridable method for derived classes. Returns empty string by\n"
"default.");

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

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

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ1", &sipSelf, sipType_wxFileType_MessageParameters, &sipCpp, sipType_wxString, &name, &nameState))
        {
            ::wxString*sipRes;

            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipRes = new ::wxString((sipSelfWasArg ? sipCpp->::wxFileType::MessageParameters::GetParamValue(*name) : sipCpp->GetParamValue(*name)));
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(name), sipType_wxString, nameState);

            if (PyErr_Occurred())
                return 0;

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

    sipNoMethod(sipParseErr, sipName_MessageParameters, sipName_GetParamValue, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipwxFileType_MessageParameters *>(sipCppV);
    else
        delete reinterpret_cast< ::wxFileType::MessageParameters *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void *array_wxFileType_MessageParameters(Py_ssize_t);}
static void *array_wxFileType_MessageParameters(Py_ssize_t sipNrElem)
{
    return new ::wxFileType::MessageParameters[sipNrElem];
}


extern "C" {static void array_delete_wxFileType_MessageParameters(void *);}
static void array_delete_wxFileType_MessageParameters(void *sipCpp)
{
    delete[] reinterpret_cast< ::wxFileType::MessageParameters *>(sipCpp);
}


extern "C" {static void assign_wxFileType_MessageParameters(void *, Py_ssize_t, void *);}
static void assign_wxFileType_MessageParameters(void *sipDst, Py_ssize_t sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::wxFileType::MessageParameters *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::wxFileType::MessageParameters *>(sipSrc);
}


extern "C" {static void *copy_wxFileType_MessageParameters(const void *, Py_ssize_t);}
static void *copy_wxFileType_MessageParameters(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new ::wxFileType::MessageParameters(reinterpret_cast<const ::wxFileType::MessageParameters *>(sipSrc)[sipSrcIdx]);
}


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

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


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

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

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxFileType_MessageParameters();
            Py_END_ALLOW_THREADS

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxString* filename;
        int filenameState = 0;
        const ::wxString& mimetypedef = wxEmptyString;
        const ::wxString* mimetype = &mimetypedef;
        int mimetypeState = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J1|J1", sipType_wxString, &filename, &filenameState, sipType_wxString, &mimetype, &mimetypeState))
        {
            PyErr_Clear();

            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipwxFileType_MessageParameters(*filename, *mimetype);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast< ::wxString *>(filename), sipType_wxString, filenameState);
            sipReleaseType(const_cast< ::wxString *>(mimetype), sipType_wxString, mimetypeState);

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::wxFileType::MessageParameters* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_wxFileType_MessageParameters[] = {
    {sipName_GetFileName, meth_wxFileType_MessageParameters_GetFileName, METH_VARARGS, doc_wxFileType_MessageParameters_GetFileName},
    {sipName_GetMimeType, meth_wxFileType_MessageParameters_GetMimeType, METH_VARARGS, doc_wxFileType_MessageParameters_GetMimeType},
    {sipName_GetParamValue, SIP_MLMETH_CAST(meth_wxFileType_MessageParameters_GetParamValue), METH_VARARGS|METH_KEYWORDS, doc_wxFileType_MessageParameters_GetParamValue}
};

sipVariableDef variables_wxFileType_MessageParameters[] = {
    {PropertyVariable, sipName_MimeType, &methods_wxFileType_MessageParameters[1], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    {PropertyVariable, sipName_FileName, &methods_wxFileType_MessageParameters[0], SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_wxFileType_MessageParameters, "MessageParameters() -> None\n"
"MessageParameters(filename, mimetype='') -> None\n"
"\n"
"Class representing message parameters.");


sipClassTypeDef sipTypeDef__core_wxFileType_MessageParameters = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_CLASS,
        sipNameNr_wxFileType__MessageParameters,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_MessageParameters,
        {191, 255, 0},
        3, methods_wxFileType_MessageParameters,
        0, SIP_NULLPTR,
        2, variables_wxFileType_MessageParameters,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_wxFileType_MessageParameters,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_wxFileType_MessageParameters,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_wxFileType_MessageParameters,
    assign_wxFileType_MessageParameters,
    array_wxFileType_MessageParameters,
    copy_wxFileType_MessageParameters,
    release_wxFileType_MessageParameters,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_wxFileType_MessageParameters,
    sizeof (::wxFileType::MessageParameters),
};
