/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt6.
 * 
 * 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 648 "/build/pyqt6/src/PyQt6-6.3.1/sip/QtWidgets/qstyleoption.sip"
#include <qstyleoption.h>
#line 29 "/build/pyqt6/src/PyQt6-6.3.1/build/QtWidgets/sipQtWidgetsQStyleOptionToolBox.cpp"

#line 26 "/build/pyqt6/src/PyQt6-6.3.1/sip/QtGui/qicon.sip"
#include <qicon.h>
#line 33 "/build/pyqt6/src/PyQt6-6.3.1/build/QtWidgets/sipQtWidgetsQStyleOptionToolBox.cpp"
#line 24 "/build/pyqt6/src/PyQt6-6.3.1/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 36 "/build/pyqt6/src/PyQt6-6.3.1/build/QtWidgets/sipQtWidgetsQStyleOptionToolBox.cpp"
#line 28 "/build/pyqt6/src/PyQt6-6.3.1/sip/QtWidgets/qwidget.sip"
#include <qwidget.h>
#line 39 "/build/pyqt6/src/PyQt6-6.3.1/build/QtWidgets/sipQtWidgetsQStyleOptionToolBox.cpp"


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

    if (targetType == sipType_QStyleOptionToolBox)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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


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


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


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


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


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


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

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

            return sipCpp;
        }
    }

    {
        const  ::QStyleOptionToolBox* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


extern "C" {static PyObject *varget_QStyleOptionToolBox_icon(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionToolBox_icon(void *sipSelf, PyObject *sipPySelf, PyObject *)
{
    PyObject *sipPy;
     ::QIcon*sipVal;
     ::QStyleOptionToolBox *sipCpp = reinterpret_cast< ::QStyleOptionToolBox *>(sipSelf);

    sipPy = sipGetReference(sipPySelf, -69);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->icon;

    sipPy = sipConvertFromType(sipVal, sipType_QIcon, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -16, sipPySelf);
        sipKeepReference(sipPySelf, -69, sipPy);
    }

    return sipPy;
}


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

    int sipIsErr = 0;
    sipVal = reinterpret_cast< ::QIcon *>(sipForceConvertToType(sipPy, sipType_QIcon, SIP_NULLPTR, SIP_NOT_NONE, SIP_NULLPTR, &sipIsErr));

    if (sipIsErr)
        return -1;

    sipCpp->icon = *sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionToolBox_position(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionToolBox_position(void *sipSelf, PyObject *, PyObject *)
{
     ::QStyleOptionToolBox::TabPosition sipVal;
     ::QStyleOptionToolBox *sipCpp = reinterpret_cast< ::QStyleOptionToolBox *>(sipSelf);

    sipVal = sipCpp->position;

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


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

    sipVal = ( ::QStyleOptionToolBox::TabPosition)sipConvertToEnum(sipPy, sipType_QStyleOptionToolBox_TabPosition);

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

    sipCpp->position = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionToolBox_selectedPosition(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionToolBox_selectedPosition(void *sipSelf, PyObject *, PyObject *)
{
     ::QStyleOptionToolBox::SelectedPosition sipVal;
     ::QStyleOptionToolBox *sipCpp = reinterpret_cast< ::QStyleOptionToolBox *>(sipSelf);

    sipVal = sipCpp->selectedPosition;

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


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

    sipVal = ( ::QStyleOptionToolBox::SelectedPosition)sipConvertToEnum(sipPy, sipType_QStyleOptionToolBox_SelectedPosition);

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

    sipCpp->selectedPosition = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionToolBox_text(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionToolBox_text(void *sipSelf, PyObject *, PyObject *)
{
     ::QString*sipVal;
     ::QStyleOptionToolBox *sipCpp = reinterpret_cast< ::QStyleOptionToolBox *>(sipSelf);

    sipVal = &sipCpp->text;

    return sipConvertFromType(sipVal, sipType_QString, SIP_NULLPTR);
}


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

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

    if (sipIsErr)
        return -1;

    sipCpp->text = *sipVal;

    sipReleaseType(sipVal, sipType_QString, sipValState);

    return 0;
}

sipVariableDef variables_QStyleOptionToolBox[] = {
    {InstanceVariable, sipName_icon, (PyMethodDef *)varget_QStyleOptionToolBox_icon, (PyMethodDef *)varset_QStyleOptionToolBox_icon, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_position, (PyMethodDef *)varget_QStyleOptionToolBox_position, (PyMethodDef *)varset_QStyleOptionToolBox_position, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_selectedPosition, (PyMethodDef *)varget_QStyleOptionToolBox_selectedPosition, (PyMethodDef *)varset_QStyleOptionToolBox_selectedPosition, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_text, (PyMethodDef *)varget_QStyleOptionToolBox_text, (PyMethodDef *)varset_QStyleOptionToolBox_text, SIP_NULLPTR, SIP_NULLPTR},
};


/* Define the enum members and ints to be added to this type. */
static sipIntInstanceDef intInstances_QStyleOptionToolBox[] = {
    {sipName_NotAdjacent, static_cast<int>( ::QStyleOptionToolBox::NotAdjacent)},
    {sipName_NextIsSelected, static_cast<int>( ::QStyleOptionToolBox::NextIsSelected)},
    {sipName_PreviousIsSelected, static_cast<int>( ::QStyleOptionToolBox::PreviousIsSelected)},
    {sipName_Type, static_cast<int>( ::QStyleOptionToolBox::Type)},
    {sipName_Version, static_cast<int>( ::QStyleOptionToolBox::Version)},
    {sipName_Beginning, static_cast<int>( ::QStyleOptionToolBox::Beginning)},
    {sipName_Middle, static_cast<int>( ::QStyleOptionToolBox::Middle)},
    {sipName_End, static_cast<int>( ::QStyleOptionToolBox::End)},
    {sipName_OnlyOneTab, static_cast<int>( ::QStyleOptionToolBox::OnlyOneTab)},
    {0, 0}
};

PyDoc_STRVAR(doc_QStyleOptionToolBox, "\1QStyleOptionToolBox()\n"
"QStyleOptionToolBox(QStyleOptionToolBox)");


sipClassTypeDef sipTypeDef_QtWidgets_QStyleOptionToolBox = {
    {
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QStyleOptionToolBox,
        SIP_NULLPTR,
        SIP_NULLPTR
    },
    {
        sipNameNr_QStyleOptionToolBox,
        {0, 0, 1},
        0, SIP_NULLPTR,
        4, variables_QStyleOptionToolBox,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, intInstances_QStyleOptionToolBox, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QStyleOptionToolBox,
    -1,
    -1,
    supers_QStyleOptionToolBox,
    SIP_NULLPTR,
    init_type_QStyleOptionToolBox,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QStyleOptionToolBox,
    assign_QStyleOptionToolBox,
    array_QStyleOptionToolBox,
    copy_QStyleOptionToolBox,
    release_QStyleOptionToolBox,
    cast_QStyleOptionToolBox,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QStyleOptionToolBox,
    sizeof ( ::QStyleOptionToolBox),
};
