/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.14.0
 *
 * Copyright (c) 2024 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt5.
 * 
 * This file may be used under the terms of the GNU General Public License
 * version 3.0 as published by the Free Software Foundation and appearing in
 * the file LICENSE included in the packaging of this file.  Please review the
 * following information to ensure the GNU General Public License version 3.0
 * requirements will be met: http://www.gnu.org/copyleft/gpl.html.
 * 
 * If you do not wish to use this file under the terms of the GPL version 3.0
 * then you may purchase a commercial license.  For more information contact
 * info@riverbankcomputing.com.
 * 
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include "sipAPIQtPrintSupport.h"

#line 28 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtPrintSupport/qprintengine.sip"
#include <qprintengine.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.11/build/QtPrintSupport/sipQtPrintSupportQPrintEngine.cpp"

#line 28 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtPrintSupport/qprinter.sip"
#include <qprinter.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.11/build/QtPrintSupport/sipQtPrintSupportQPrintEngine.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtGui/qpaintdevice.sip"
#include <qpaintdevice.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.11/build/QtPrintSupport/sipQtPrintSupportQPrintEngine.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qvariant.sip"
#include <qvariant.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.11/build/QtPrintSupport/sipQtPrintSupportQPrintEngine.cpp"


class sipQPrintEngine : public ::QPrintEngine
{
public:
    sipQPrintEngine();
    sipQPrintEngine(const ::QPrintEngine&);
    virtual ~sipQPrintEngine();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    ::QPrinter::PrinterState printerState() const SIP_OVERRIDE;
    int metric(::QPaintDevice::PaintDeviceMetric) const SIP_OVERRIDE;
    bool abort() SIP_OVERRIDE;
    bool newPage() SIP_OVERRIDE;
    ::QVariant property(::QPrintEngine::PrintEnginePropertyKey) const SIP_OVERRIDE;
    void setProperty(::QPrintEngine::PrintEnginePropertyKey, const ::QVariant&) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[6];
};

sipQPrintEngine::sipQPrintEngine(): ::QPrintEngine(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

::QPrinter::PrinterState sipQPrintEngine::printerState() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return ::QPrinter::Idle;

    extern ::QPrinter::PrinterState sipVH_QtPrintSupport_40(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    return sipVH_QtPrintSupport_40(sipGILState, sipImportedVirtErrorHandlers_QtPrintSupport_QtCore[0].iveh_handler, sipPySelf, sipMeth);
}

int sipQPrintEngine::metric(::QPaintDevice::PaintDeviceMetric a0) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return 0;

    extern int sipVH_QtPrintSupport_9(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::QPaintDevice::PaintDeviceMetric);

    return sipVH_QtPrintSupport_9(sipGILState, sipImportedVirtErrorHandlers_QtPrintSupport_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0);
}

bool sipQPrintEngine::abort()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[2], &sipPySelf, sipName_QPrintEngine, sipName_abort);

    if (!sipMeth)
        return 0;

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

    return sipVH_QtPrintSupport_34(sipGILState, sipImportedVirtErrorHandlers_QtPrintSupport_QtCore[0].iveh_handler, sipPySelf, sipMeth);
}

bool sipQPrintEngine::newPage()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[3], &sipPySelf, sipName_QPrintEngine, sipName_newPage);

    if (!sipMeth)
        return 0;

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

    return sipVH_QtPrintSupport_34(sipGILState, sipImportedVirtErrorHandlers_QtPrintSupport_QtCore[0].iveh_handler, sipPySelf, sipMeth);
}

::QVariant sipQPrintEngine::property(::QPrintEngine::PrintEnginePropertyKey a0) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[4]), const_cast<sipSimpleWrapper **>(&sipPySelf), sipName_QPrintEngine, sipName_property);

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

    extern ::QVariant sipVH_QtPrintSupport_39(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::QPrintEngine::PrintEnginePropertyKey);

    return sipVH_QtPrintSupport_39(sipGILState, sipImportedVirtErrorHandlers_QtPrintSupport_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0);
}

void sipQPrintEngine::setProperty(::QPrintEngine::PrintEnginePropertyKey a0, const ::QVariant& a1)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[5], &sipPySelf, sipName_QPrintEngine, sipName_setProperty);

    if (!sipMeth)
        return;

    extern void sipVH_QtPrintSupport_38(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::QPrintEngine::PrintEnginePropertyKey, const ::QVariant&);

    sipVH_QtPrintSupport_38(sipGILState, sipImportedVirtErrorHandlers_QtPrintSupport_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0, a1);
}


PyDoc_STRVAR(doc_QPrintEngine_setProperty, "setProperty(self, key: QPrintEngine.PrintEnginePropertyKey, value: Any)");

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

    {
        ::QPrintEngine::PrintEnginePropertyKey a0;
        const ::QVariant* a1;
        int a1State = 0;
        ::QPrintEngine *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BEJ1", &sipSelf, sipType_QPrintEngine, &sipCpp, sipType_QPrintEngine_PrintEnginePropertyKey, &a0, sipType_QVariant, &a1, &a1State))
        {
            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_QPrintEngine, sipName_setProperty);
                return SIP_NULLPTR;
            }

            sipCpp->setProperty(a0, *a1);
            sipReleaseType(const_cast< ::QVariant *>(a1), sipType_QVariant, a1State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QPrintEngine, sipName_setProperty, doc_QPrintEngine_setProperty);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QPrintEngine_property, "property(self, key: QPrintEngine.PrintEnginePropertyKey) -> Any");

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

    {
        ::QPrintEngine::PrintEnginePropertyKey a0;
        const ::QPrintEngine *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BE", &sipSelf, sipType_QPrintEngine, &sipCpp, sipType_QPrintEngine_PrintEnginePropertyKey, &a0))
        {
            ::QVariant*sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_QPrintEngine, sipName_property);
                return SIP_NULLPTR;
            }

            sipRes = new ::QVariant(sipCpp->property(a0));

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

    sipNoMethod(sipParseErr, sipName_QPrintEngine, sipName_property, doc_QPrintEngine_property);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QPrintEngine_newPage, "newPage(self) -> bool");

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

    {
        ::QPrintEngine *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QPrintEngine, &sipCpp))
        {
            bool sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_QPrintEngine, sipName_newPage);
                return SIP_NULLPTR;
            }

            sipRes = sipCpp->newPage();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QPrintEngine, sipName_newPage, doc_QPrintEngine_newPage);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QPrintEngine_abort, "abort(self) -> bool");

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

    {
        ::QPrintEngine *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QPrintEngine, &sipCpp))
        {
            bool sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_QPrintEngine, sipName_abort);
                return SIP_NULLPTR;
            }

            sipRes = sipCpp->abort();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QPrintEngine, sipName_abort, doc_QPrintEngine_abort);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QPrintEngine_metric, "metric(self, a0: QPaintDevice.PaintDeviceMetric) -> int");

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

    {
        ::QPaintDevice::PaintDeviceMetric a0;
        const ::QPrintEngine *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BE", &sipSelf, sipType_QPrintEngine, &sipCpp, sipType_QPaintDevice_PaintDeviceMetric, &a0))
        {
            int sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_QPrintEngine, sipName_metric);
                return SIP_NULLPTR;
            }

            sipRes = sipCpp->metric(a0);

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QPrintEngine, sipName_metric, doc_QPrintEngine_metric);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QPrintEngine_printerState, "printerState(self) -> QPrinter.PrinterState");

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

    {
        const ::QPrintEngine *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QPrintEngine, &sipCpp))
        {
            ::QPrinter::PrinterState sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_QPrintEngine, sipName_printerState);
                return SIP_NULLPTR;
            }

            sipRes = sipCpp->printerState();

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_QPrinter_PrinterState);
        }
    }

    sipNoMethod(sipParseErr, sipName_QPrintEngine, sipName_printerState, doc_QPrintEngine_printerState);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QPrintEngine(void *, int);}
static void release_QPrintEngine(void *sipCppV, int sipState)
{
    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipQPrintEngine *>(sipCppV);
    else
        delete reinterpret_cast< ::QPrintEngine *>(sipCppV);
}


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const ::QPrintEngine* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_QPrintEngine, &a0))
        {
            sipCpp = new sipQPrintEngine(*a0);

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_QPrintEngine[] = {
    {sipName_abort, meth_QPrintEngine_abort, METH_VARARGS, doc_QPrintEngine_abort},
    {sipName_metric, meth_QPrintEngine_metric, METH_VARARGS, doc_QPrintEngine_metric},
    {sipName_newPage, meth_QPrintEngine_newPage, METH_VARARGS, doc_QPrintEngine_newPage},
    {sipName_printerState, meth_QPrintEngine_printerState, METH_VARARGS, doc_QPrintEngine_printerState},
    {sipName_property, meth_QPrintEngine_property, METH_VARARGS, doc_QPrintEngine_property},
    {sipName_setProperty, meth_QPrintEngine_setProperty, METH_VARARGS, doc_QPrintEngine_setProperty}
};

static sipEnumMemberDef enummembers_QPrintEngine[] = {
    {sipName_PPK_CollateCopies, static_cast<int>(::QPrintEngine::PPK_CollateCopies), 13},
    {sipName_PPK_ColorMode, static_cast<int>(::QPrintEngine::PPK_ColorMode), 13},
    {sipName_PPK_CopyCount, static_cast<int>(::QPrintEngine::PPK_CopyCount), 13},
    {sipName_PPK_Creator, static_cast<int>(::QPrintEngine::PPK_Creator), 13},
    {sipName_PPK_CustomBase, static_cast<int>(::QPrintEngine::PPK_CustomBase), 13},
    {sipName_PPK_CustomPaperSize, static_cast<int>(::QPrintEngine::PPK_CustomPaperSize), 13},
    {sipName_PPK_DocumentName, static_cast<int>(::QPrintEngine::PPK_DocumentName), 13},
    {sipName_PPK_Duplex, static_cast<int>(::QPrintEngine::PPK_Duplex), 13},
    {sipName_PPK_FontEmbedding, static_cast<int>(::QPrintEngine::PPK_FontEmbedding), 13},
    {sipName_PPK_FullPage, static_cast<int>(::QPrintEngine::PPK_FullPage), 13},
    {sipName_PPK_NumberOfCopies, static_cast<int>(::QPrintEngine::PPK_NumberOfCopies), 13},
    {sipName_PPK_Orientation, static_cast<int>(::QPrintEngine::PPK_Orientation), 13},
    {sipName_PPK_OutputFileName, static_cast<int>(::QPrintEngine::PPK_OutputFileName), 13},
    {sipName_PPK_PageMargins, static_cast<int>(::QPrintEngine::PPK_PageMargins), 13},
    {sipName_PPK_PageOrder, static_cast<int>(::QPrintEngine::PPK_PageOrder), 13},
    {sipName_PPK_PageRect, static_cast<int>(::QPrintEngine::PPK_PageRect), 13},
    {sipName_PPK_PageSize, static_cast<int>(::QPrintEngine::PPK_PageSize), 13},
    {sipName_PPK_PaperName, static_cast<int>(::QPrintEngine::PPK_PaperName), 13},
    {sipName_PPK_PaperRect, static_cast<int>(::QPrintEngine::PPK_PaperRect), 13},
    {sipName_PPK_PaperSize, static_cast<int>(::QPrintEngine::PPK_PaperSize), 13},
    {sipName_PPK_PaperSource, static_cast<int>(::QPrintEngine::PPK_PaperSource), 13},
    {sipName_PPK_PaperSources, static_cast<int>(::QPrintEngine::PPK_PaperSources), 13},
    {sipName_PPK_PrinterName, static_cast<int>(::QPrintEngine::PPK_PrinterName), 13},
    {sipName_PPK_PrinterProgram, static_cast<int>(::QPrintEngine::PPK_PrinterProgram), 13},
    {sipName_PPK_QPageLayout, static_cast<int>(::QPrintEngine::PPK_QPageLayout), 13},
    {sipName_PPK_QPageMargins, static_cast<int>(::QPrintEngine::PPK_QPageMargins), 13},
    {sipName_PPK_QPageSize, static_cast<int>(::QPrintEngine::PPK_QPageSize), 13},
    {sipName_PPK_Resolution, static_cast<int>(::QPrintEngine::PPK_Resolution), 13},
    {sipName_PPK_SelectionOption, static_cast<int>(::QPrintEngine::PPK_SelectionOption), 13},
    {sipName_PPK_SupportedResolutions, static_cast<int>(::QPrintEngine::PPK_SupportedResolutions), 13},
    {sipName_PPK_SupportsMultipleCopies, static_cast<int>(::QPrintEngine::PPK_SupportsMultipleCopies), 13},
    {sipName_PPK_WindowsPageSize, static_cast<int>(::QPrintEngine::PPK_WindowsPageSize), 13},
};

PyDoc_STRVAR(doc_QPrintEngine, "\1QPrintEngine()\n"
"QPrintEngine(a0: QPrintEngine)");


static pyqt5ClassPluginDef plugin_QPrintEngine = {
    SIP_NULLPTR,
    0,
    SIP_NULLPTR,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtPrintSupport_QPrintEngine = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_ABSTRACT|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QPrintEngine,
        SIP_NULLPTR,
        &plugin_QPrintEngine,
    },
    {
        sipNameNr_QPrintEngine,
        {0, 0, 1},
        6, methods_QPrintEngine,
        32, enummembers_QPrintEngine,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QPrintEngine,
    -1,
    sipNameNr_sip_simplewrapper,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QPrintEngine,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QPrintEngine,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QPrintEngine,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::QPrintEngine),
};
