/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 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 "sipAPIQtWidgets.h"

#line 938 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtWidgets/qstyleoption.sip"
#include <qstyleoption.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQStyleOptionToolBar.cpp"

#line 938 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtWidgets/qstyleoption.sip"
#include <qstyleoption.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQStyleOptionToolBar.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQStyleOptionToolBar.cpp"
#line 28 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtWidgets/qwidget.sip"
#include <qwidget.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQStyleOptionToolBar.cpp"


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

    if (targetType == sipType_QStyleOptionToolBar)
        return sipCppV;

    if (targetType == sipType_QStyleOption)
        return static_cast< ::QStyleOption *>(sipCpp);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QStyleOptionToolBar(void *, int);}
static void release_QStyleOptionToolBar(void *sipCppV, int)
{
    delete reinterpret_cast< ::QStyleOptionToolBar *>(sipCppV);
}


extern "C" {static void *array_QStyleOptionToolBar(Py_ssize_t);}
static void *array_QStyleOptionToolBar(Py_ssize_t sipNrElem)
{
    return new  ::QStyleOptionToolBar[sipNrElem];
}


extern "C" {static void array_delete_QStyleOptionToolBar(void *);}
static void array_delete_QStyleOptionToolBar(void *sipCpp)
{
    delete[] reinterpret_cast< ::QStyleOptionToolBar *>(sipCpp);
}


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


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


extern "C" {static void dealloc_QStyleOptionToolBar(sipSimpleWrapper *);}
static void dealloc_QStyleOptionToolBar(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_QStyleOptionToolBar(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_QStyleOptionToolBar(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QStyleOptionToolBar(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
     ::QStyleOptionToolBar *sipCpp = SIP_NULLPTR;

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

            return sipCpp;
        }
    }

    {
        const  ::QStyleOptionToolBar* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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

static sipEnumMemberDef enummembers_QStyleOptionToolBar[] = {
    {sipName_Beginning, static_cast<int>( ::QStyleOptionToolBar::Beginning), 398},
    {sipName_End, static_cast<int>( ::QStyleOptionToolBar::End), 398},
    {sipName_Middle, static_cast<int>( ::QStyleOptionToolBar::Middle), 398},
    {sipName_Movable, static_cast<int>( ::QStyleOptionToolBar::Movable), 396},
    {sipName_None_, static_cast<int>( ::QStyleOptionToolBar::None), 396},
    {sipName_OnlyOne, static_cast<int>( ::QStyleOptionToolBar::OnlyOne), 398},
    {sipName_Type, static_cast<int>( ::QStyleOptionToolBar::Type), 394},
    {sipName_Version, static_cast<int>( ::QStyleOptionToolBar::Version), 395},
};


extern "C" {static PyObject *varget_QStyleOptionToolBar_features(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionToolBar_features(void *sipSelf, PyObject *sipPySelf, PyObject *)
{
    PyObject *sipPy;
     ::QStyleOptionToolBar::ToolBarFeatures*sipVal;
     ::QStyleOptionToolBar *sipCpp = reinterpret_cast< ::QStyleOptionToolBar *>(sipSelf);

    sipPy = sipGetReference(sipPySelf, -68);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->features;

    sipPy = sipConvertFromType(sipVal, sipType_QStyleOptionToolBar_ToolBarFeatures, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -67, sipPySelf);
        sipKeepReference(sipPySelf, -68, sipPy);
    }

    return sipPy;
}


extern "C" {static int varset_QStyleOptionToolBar_features(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionToolBar_features(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QStyleOptionToolBar::ToolBarFeatures*sipVal;
     ::QStyleOptionToolBar *sipCpp = reinterpret_cast< ::QStyleOptionToolBar *>(sipSelf);

    int sipIsErr = 0;
    int sipValState;
    sipVal = reinterpret_cast< ::QStyleOptionToolBar::ToolBarFeatures *>(sipForceConvertToType(sipPy, sipType_QStyleOptionToolBar_ToolBarFeatures, SIP_NULLPTR, SIP_NOT_NONE, &sipValState, &sipIsErr));

    if (sipIsErr)
        return -1;

    sipCpp->features = *sipVal;

    sipReleaseType(sipVal, sipType_QStyleOptionToolBar_ToolBarFeatures, sipValState);

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionToolBar_lineWidth(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionToolBar_lineWidth(void *sipSelf, PyObject *, PyObject *)
{
    int sipVal;
     ::QStyleOptionToolBar *sipCpp = reinterpret_cast< ::QStyleOptionToolBar *>(sipSelf);

    sipVal = sipCpp->lineWidth;

    return PyLong_FromLong(sipVal);
}


extern "C" {static int varset_QStyleOptionToolBar_lineWidth(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionToolBar_lineWidth(void *sipSelf, PyObject *sipPy, PyObject *)
{
    int sipVal;
     ::QStyleOptionToolBar *sipCpp = reinterpret_cast< ::QStyleOptionToolBar *>(sipSelf);

    sipVal = sipLong_AsInt(sipPy);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->lineWidth = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionToolBar_midLineWidth(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionToolBar_midLineWidth(void *sipSelf, PyObject *, PyObject *)
{
    int sipVal;
     ::QStyleOptionToolBar *sipCpp = reinterpret_cast< ::QStyleOptionToolBar *>(sipSelf);

    sipVal = sipCpp->midLineWidth;

    return PyLong_FromLong(sipVal);
}


extern "C" {static int varset_QStyleOptionToolBar_midLineWidth(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionToolBar_midLineWidth(void *sipSelf, PyObject *sipPy, PyObject *)
{
    int sipVal;
     ::QStyleOptionToolBar *sipCpp = reinterpret_cast< ::QStyleOptionToolBar *>(sipSelf);

    sipVal = sipLong_AsInt(sipPy);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->midLineWidth = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionToolBar_positionOfLine(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionToolBar_positionOfLine(void *sipSelf, PyObject *, PyObject *)
{
     ::QStyleOptionToolBar::ToolBarPosition sipVal;
     ::QStyleOptionToolBar *sipCpp = reinterpret_cast< ::QStyleOptionToolBar *>(sipSelf);

    sipVal = sipCpp->positionOfLine;

    return sipConvertFromEnum(static_cast<int>(sipVal), sipType_QStyleOptionToolBar_ToolBarPosition);
}


extern "C" {static int varset_QStyleOptionToolBar_positionOfLine(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionToolBar_positionOfLine(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QStyleOptionToolBar::ToolBarPosition sipVal;
     ::QStyleOptionToolBar *sipCpp = reinterpret_cast< ::QStyleOptionToolBar *>(sipSelf);

    sipVal = ( ::QStyleOptionToolBar::ToolBarPosition)sipConvertToEnum(sipPy, sipType_QStyleOptionToolBar_ToolBarPosition);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->positionOfLine = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionToolBar_positionWithinLine(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionToolBar_positionWithinLine(void *sipSelf, PyObject *, PyObject *)
{
     ::QStyleOptionToolBar::ToolBarPosition sipVal;
     ::QStyleOptionToolBar *sipCpp = reinterpret_cast< ::QStyleOptionToolBar *>(sipSelf);

    sipVal = sipCpp->positionWithinLine;

    return sipConvertFromEnum(static_cast<int>(sipVal), sipType_QStyleOptionToolBar_ToolBarPosition);
}


extern "C" {static int varset_QStyleOptionToolBar_positionWithinLine(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionToolBar_positionWithinLine(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QStyleOptionToolBar::ToolBarPosition sipVal;
     ::QStyleOptionToolBar *sipCpp = reinterpret_cast< ::QStyleOptionToolBar *>(sipSelf);

    sipVal = ( ::QStyleOptionToolBar::ToolBarPosition)sipConvertToEnum(sipPy, sipType_QStyleOptionToolBar_ToolBarPosition);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->positionWithinLine = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionToolBar_toolBarArea(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionToolBar_toolBarArea(void *sipSelf, PyObject *, PyObject *)
{
     ::Qt::ToolBarArea sipVal;
     ::QStyleOptionToolBar *sipCpp = reinterpret_cast< ::QStyleOptionToolBar *>(sipSelf);

    sipVal = sipCpp->toolBarArea;

    return sipConvertFromEnum(static_cast<int>(sipVal), sipType_Qt_ToolBarArea);
}


extern "C" {static int varset_QStyleOptionToolBar_toolBarArea(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionToolBar_toolBarArea(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::Qt::ToolBarArea sipVal;
     ::QStyleOptionToolBar *sipCpp = reinterpret_cast< ::QStyleOptionToolBar *>(sipSelf);

    sipVal = ( ::Qt::ToolBarArea)sipConvertToEnum(sipPy, sipType_Qt_ToolBarArea);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->toolBarArea = sipVal;

    return 0;
}

sipVariableDef variables_QStyleOptionToolBar[] = {
    {InstanceVariable, sipName_features, (PyMethodDef *)varget_QStyleOptionToolBar_features, (PyMethodDef *)varset_QStyleOptionToolBar_features, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_lineWidth, (PyMethodDef *)varget_QStyleOptionToolBar_lineWidth, (PyMethodDef *)varset_QStyleOptionToolBar_lineWidth, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_midLineWidth, (PyMethodDef *)varget_QStyleOptionToolBar_midLineWidth, (PyMethodDef *)varset_QStyleOptionToolBar_midLineWidth, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_positionOfLine, (PyMethodDef *)varget_QStyleOptionToolBar_positionOfLine, (PyMethodDef *)varset_QStyleOptionToolBar_positionOfLine, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_positionWithinLine, (PyMethodDef *)varget_QStyleOptionToolBar_positionWithinLine, (PyMethodDef *)varset_QStyleOptionToolBar_positionWithinLine, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_toolBarArea, (PyMethodDef *)varget_QStyleOptionToolBar_toolBarArea, (PyMethodDef *)varset_QStyleOptionToolBar_toolBarArea, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_QStyleOptionToolBar, "\1QStyleOptionToolBar()\n"
"QStyleOptionToolBar(QStyleOptionToolBar)");


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


sipClassTypeDef sipTypeDef_QtWidgets_QStyleOptionToolBar = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QStyleOptionToolBar,
        SIP_NULLPTR,
        &plugin_QStyleOptionToolBar
    },
    {
        sipNameNr_QStyleOptionToolBar,
        {0, 0, 1},
        0, SIP_NULLPTR,
        8, enummembers_QStyleOptionToolBar,
        6, variables_QStyleOptionToolBar,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QStyleOptionToolBar,
    -1,
    -1,
    supers_QStyleOptionToolBar,
    SIP_NULLPTR,
    init_type_QStyleOptionToolBar,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QStyleOptionToolBar,
    assign_QStyleOptionToolBar,
    array_QStyleOptionToolBar,
    copy_QStyleOptionToolBar,
    release_QStyleOptionToolBar,
    cast_QStyleOptionToolBar,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QStyleOptionToolBar,
    sizeof ( ::QStyleOptionToolBar),
};
