/*
 * 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 "sipAPIQtWidgets.h"

#line 297 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtWidgets/qstyleoption.sip"
#include <qstyleoption.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.11/build/QtWidgets/sipQtWidgetsQStyleOptionHeader.cpp"

#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtGui/qicon.sip"
#include <qicon.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.11/build/QtWidgets/sipQtWidgetsQStyleOptionHeader.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.11/build/QtWidgets/sipQtWidgetsQStyleOptionHeader.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.11/build/QtWidgets/sipQtWidgetsQStyleOptionHeader.cpp"
#line 27 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 42 "/build/pyqt5/src/PyQt5-5.15.11/build/QtWidgets/sipQtWidgetsQStyleOptionHeader.cpp"
#line 28 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtWidgets/qwidget.sip"
#include <qwidget.h>
#line 45 "/build/pyqt5/src/PyQt5-5.15.11/build/QtWidgets/sipQtWidgetsQStyleOptionHeader.cpp"


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

    if (targetType == sipType_QStyleOptionHeader)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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


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


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


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


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


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


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

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

            return sipCpp;
        }
    }

    {
        const ::QStyleOptionHeader* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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

static sipEnumMemberDef enummembers_QStyleOptionHeader[] = {
    {sipName_Beginning, static_cast<int>(::QStyleOptionHeader::Beginning), 348},
    {sipName_End, static_cast<int>(::QStyleOptionHeader::End), 348},
    {sipName_Middle, static_cast<int>(::QStyleOptionHeader::Middle), 348},
    {sipName_NextAndPreviousAreSelected, static_cast<int>(::QStyleOptionHeader::NextAndPreviousAreSelected), 349},
    {sipName_NextIsSelected, static_cast<int>(::QStyleOptionHeader::NextIsSelected), 349},
    {sipName_None_, static_cast<int>(::QStyleOptionHeader::None), 350},
    {sipName_NotAdjacent, static_cast<int>(::QStyleOptionHeader::NotAdjacent), 349},
    {sipName_OnlyOneSection, static_cast<int>(::QStyleOptionHeader::OnlyOneSection), 348},
    {sipName_PreviousIsSelected, static_cast<int>(::QStyleOptionHeader::PreviousIsSelected), 349},
    {sipName_SortDown, static_cast<int>(::QStyleOptionHeader::SortDown), 350},
    {sipName_SortUp, static_cast<int>(::QStyleOptionHeader::SortUp), 350},
    {sipName_Type, static_cast<int>(::QStyleOptionHeader::Type), 351},
    {sipName_Version, static_cast<int>(::QStyleOptionHeader::Version), 352},
};


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

    sipPy = sipGetReference(sipPySelf, -114);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->icon;

    sipPy = sipConvertFromType(sipVal, sipType_QIcon, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -21, sipPySelf);
        sipKeepReference(sipPySelf, -114, sipPy);
    }

    return sipPy;
}


extern "C" {static int varset_QStyleOptionHeader_icon(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionHeader_icon(void *sipSelf, PyObject *sipPy, PyObject *)
{
    ::QIcon*sipVal;
    ::QStyleOptionHeader *sipCpp = reinterpret_cast< ::QStyleOptionHeader *>(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_QStyleOptionHeader_iconAlignment(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionHeader_iconAlignment(void *sipSelf, PyObject *sipPySelf, PyObject *)
{
    PyObject *sipPy;
    ::Qt::Alignment*sipVal;
    ::QStyleOptionHeader *sipCpp = reinterpret_cast< ::QStyleOptionHeader *>(sipSelf);

    sipPy = sipGetReference(sipPySelf, -115);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->iconAlignment;

    sipPy = sipConvertFromType(sipVal, sipType_Qt_Alignment, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -33, sipPySelf);
        sipKeepReference(sipPySelf, -115, sipPy);
    }

    return sipPy;
}


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

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

    if (sipIsErr)
        return -1;

    sipCpp->iconAlignment = *sipVal;

    sipReleaseType(sipVal, sipType_Qt_Alignment, sipValState);

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionHeader_orientation(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionHeader_orientation(void *sipSelf, PyObject *, PyObject *)
{
    ::Qt::Orientation sipVal;
    ::QStyleOptionHeader *sipCpp = reinterpret_cast< ::QStyleOptionHeader *>(sipSelf);

    sipVal = sipCpp->orientation;

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


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

    sipVal = (::Qt::Orientation)sipConvertToEnum(sipPy, sipType_Qt_Orientation);

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

    sipCpp->orientation = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionHeader_position(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionHeader_position(void *sipSelf, PyObject *, PyObject *)
{
    ::QStyleOptionHeader::SectionPosition sipVal;
    ::QStyleOptionHeader *sipCpp = reinterpret_cast< ::QStyleOptionHeader *>(sipSelf);

    sipVal = sipCpp->position;

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


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

    sipVal = (::QStyleOptionHeader::SectionPosition)sipConvertToEnum(sipPy, sipType_QStyleOptionHeader_SectionPosition);

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

    sipCpp->position = sipVal;

    return 0;
}


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

    sipVal = sipCpp->section;

    return PyLong_FromLong(sipVal);
}


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

    sipVal = sipLong_AsInt(sipPy);

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

    sipCpp->section = sipVal;

    return 0;
}


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

    sipVal = sipCpp->selectedPosition;

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


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

    sipVal = (::QStyleOptionHeader::SelectedPosition)sipConvertToEnum(sipPy, sipType_QStyleOptionHeader_SelectedPosition);

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

    sipCpp->selectedPosition = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionHeader_sortIndicator(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionHeader_sortIndicator(void *sipSelf, PyObject *, PyObject *)
{
    ::QStyleOptionHeader::SortIndicator sipVal;
    ::QStyleOptionHeader *sipCpp = reinterpret_cast< ::QStyleOptionHeader *>(sipSelf);

    sipVal = sipCpp->sortIndicator;

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


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

    sipVal = (::QStyleOptionHeader::SortIndicator)sipConvertToEnum(sipPy, sipType_QStyleOptionHeader_SortIndicator);

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

    sipCpp->sortIndicator = sipVal;

    return 0;
}


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

    sipVal = &sipCpp->text;

    return sipConvertFromType(sipVal, sipType_QString, SIP_NULLPTR);
}


extern "C" {static int varset_QStyleOptionHeader_text(void *, PyObject *, PyObject *);}
static int varset_QStyleOptionHeader_text(void *sipSelf, PyObject *sipPy, PyObject *)
{
    ::QString*sipVal;
    ::QStyleOptionHeader *sipCpp = reinterpret_cast< ::QStyleOptionHeader *>(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;
}


extern "C" {static PyObject *varget_QStyleOptionHeader_textAlignment(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionHeader_textAlignment(void *sipSelf, PyObject *sipPySelf, PyObject *)
{
    PyObject *sipPy;
    ::Qt::Alignment*sipVal;
    ::QStyleOptionHeader *sipCpp = reinterpret_cast< ::QStyleOptionHeader *>(sipSelf);

    sipPy = sipGetReference(sipPySelf, -116);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->textAlignment;

    sipPy = sipConvertFromType(sipVal, sipType_Qt_Alignment, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -34, sipPySelf);
        sipKeepReference(sipPySelf, -116, sipPy);
    }

    return sipPy;
}


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

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

    if (sipIsErr)
        return -1;

    sipCpp->textAlignment = *sipVal;

    sipReleaseType(sipVal, sipType_Qt_Alignment, sipValState);

    return 0;
}

sipVariableDef variables_QStyleOptionHeader[] = {
    {InstanceVariable, sipName_icon, (PyMethodDef *)varget_QStyleOptionHeader_icon, (PyMethodDef *)varset_QStyleOptionHeader_icon, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_iconAlignment, (PyMethodDef *)varget_QStyleOptionHeader_iconAlignment, (PyMethodDef *)varset_QStyleOptionHeader_iconAlignment, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_orientation, (PyMethodDef *)varget_QStyleOptionHeader_orientation, (PyMethodDef *)varset_QStyleOptionHeader_orientation, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_position, (PyMethodDef *)varget_QStyleOptionHeader_position, (PyMethodDef *)varset_QStyleOptionHeader_position, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_section, (PyMethodDef *)varget_QStyleOptionHeader_section, (PyMethodDef *)varset_QStyleOptionHeader_section, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_selectedPosition, (PyMethodDef *)varget_QStyleOptionHeader_selectedPosition, (PyMethodDef *)varset_QStyleOptionHeader_selectedPosition, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_sortIndicator, (PyMethodDef *)varget_QStyleOptionHeader_sortIndicator, (PyMethodDef *)varset_QStyleOptionHeader_sortIndicator, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_text, (PyMethodDef *)varget_QStyleOptionHeader_text, (PyMethodDef *)varset_QStyleOptionHeader_text, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_textAlignment, (PyMethodDef *)varget_QStyleOptionHeader_textAlignment, (PyMethodDef *)varset_QStyleOptionHeader_textAlignment, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_QStyleOptionHeader, "\1QStyleOptionHeader()\n"
"QStyleOptionHeader(other: QStyleOptionHeader)");


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


sipClassTypeDef sipTypeDef_QtWidgets_QStyleOptionHeader = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QStyleOptionHeader,
        SIP_NULLPTR,
        &plugin_QStyleOptionHeader,
    },
    {
        sipNameNr_QStyleOptionHeader,
        {0, 0, 1},
        0, SIP_NULLPTR,
        13, enummembers_QStyleOptionHeader,
        9, variables_QStyleOptionHeader,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QStyleOptionHeader,
    -1,
    -1,
    supers_QStyleOptionHeader,
    SIP_NULLPTR,
    init_type_QStyleOptionHeader,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QStyleOptionHeader,
    assign_QStyleOptionHeader,
    array_QStyleOptionHeader,
    copy_QStyleOptionHeader,
    release_QStyleOptionHeader,
    cast_QStyleOptionHeader,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QStyleOptionHeader,
    sizeof (::QStyleOptionHeader),
};
