/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.7.0
 *
 * 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 295 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtWidgets/qstyleoption.sip"
#include <qstyleoption.h>
#line 29 "/build/pyqt6/src/PyQt6-6.4.0/build/QtWidgets/sipQtWidgetsQStyleOptionHeader.cpp"

#line 26 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtGui/qicon.sip"
#include <qicon.h>
#line 33 "/build/pyqt6/src/PyQt6-6.4.0/build/QtWidgets/sipQtWidgetsQStyleOptionHeader.cpp"
#line 25 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtCore/qflags.sip"
#include <qglobal.h>
#line 36 "/build/pyqt6/src/PyQt6-6.4.0/build/QtWidgets/sipQtWidgetsQStyleOptionHeader.cpp"
#line 26 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 150 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtCore/qtextstream.sip"
#include <qtextstream.h>
#line 41 "/build/pyqt6/src/PyQt6-6.4.0/build/QtWidgets/sipQtWidgetsQStyleOptionHeader.cpp"
#line 24 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 44 "/build/pyqt6/src/PyQt6-6.4.0/build/QtWidgets/sipQtWidgetsQStyleOptionHeader.cpp"
#line 28 "/build/pyqt6/src/PyQt6-6.4.0/sip/QtWidgets/qwidget.sip"
#include <qwidget.h>
#line 47 "/build/pyqt6/src/PyQt6-6.4.0/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[] = {{301, 255, 1}};


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, -85);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->icon;

    sipPy = sipConvertFromType(sipVal, sipType_QIcon, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -24, sipPySelf);
        sipKeepReference(sipPySelf, -85, 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 *, PyObject *)
{
     ::Qt::Alignment*sipVal;
     ::QStyleOptionHeader *sipCpp = reinterpret_cast< ::QStyleOptionHeader *>(sipSelf);

    sipVal = &sipCpp->iconAlignment;

    return sipConvertFromType(sipVal, sipType_QFlags_0100Qt_AlignmentFlag, SIP_NULLPTR);
}


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_QFlags_0100Qt_AlignmentFlag, SIP_NULLPTR, SIP_NOT_NONE, &sipValState, &sipIsErr));

    if (sipIsErr)
        return -1;

    sipCpp->iconAlignment = *sipVal;

    sipReleaseType(sipVal, sipType_QFlags_0100Qt_AlignmentFlag, 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 *, PyObject *)
{
     ::Qt::Alignment*sipVal;
     ::QStyleOptionHeader *sipCpp = reinterpret_cast< ::QStyleOptionHeader *>(sipSelf);

    sipVal = &sipCpp->textAlignment;

    return sipConvertFromType(sipVal, sipType_QFlags_0100Qt_AlignmentFlag, SIP_NULLPTR);
}


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_QFlags_0100Qt_AlignmentFlag, SIP_NULLPTR, SIP_NOT_NONE, &sipValState, &sipIsErr));

    if (sipIsErr)
        return -1;

    sipCpp->textAlignment = *sipVal;

    sipReleaseType(sipVal, sipType_QFlags_0100Qt_AlignmentFlag, 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},
};


/* Define the enum members and ints to be added to this type. */
static sipIntInstanceDef intInstances_QStyleOptionHeader[] = {
    {sipName_Beginning, static_cast<int>( ::QStyleOptionHeader::Beginning)},
    {sipName_Middle, static_cast<int>( ::QStyleOptionHeader::Middle)},
    {sipName_End, static_cast<int>( ::QStyleOptionHeader::End)},
    {sipName_OnlyOneSection, static_cast<int>( ::QStyleOptionHeader::OnlyOneSection)},
    {sipName_NotAdjacent, static_cast<int>( ::QStyleOptionHeader::NotAdjacent)},
    {sipName_NextIsSelected, static_cast<int>( ::QStyleOptionHeader::NextIsSelected)},
    {sipName_PreviousIsSelected, static_cast<int>( ::QStyleOptionHeader::PreviousIsSelected)},
    {sipName_NextAndPreviousAreSelected, static_cast<int>( ::QStyleOptionHeader::NextAndPreviousAreSelected)},
    {sipName_None_, static_cast<int>( ::QStyleOptionHeader::None)},
    {sipName_SortUp, static_cast<int>( ::QStyleOptionHeader::SortUp)},
    {sipName_SortDown, static_cast<int>( ::QStyleOptionHeader::SortDown)},
    {sipName_Type, static_cast<int>( ::QStyleOptionHeader::Type)},
    {sipName_Version, static_cast<int>( ::QStyleOptionHeader::Version)},
    {0, 0}
};

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


sipClassTypeDef sipTypeDef_QtWidgets_QStyleOptionHeader = {
    {
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QStyleOptionHeader,
        SIP_NULLPTR,
        SIP_NULLPTR
    },
    {
        sipNameNr_QStyleOptionHeader,
        {0, 0, 1},
        0, SIP_NULLPTR,
        9, variables_QStyleOptionHeader,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, intInstances_QStyleOptionHeader, 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),
};
