/*
 * 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 350 "/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/sipQtWidgetsQStyleOptionHeaderV2.cpp"

#line 26 "/build/pyqt6/src/PyQt6-6.3.1/sip/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 150 "/build/pyqt6/src/PyQt6-6.3.1/sip/QtCore/qtextstream.sip"
#include <qtextstream.h>
#line 35 "/build/pyqt6/src/PyQt6-6.3.1/build/QtWidgets/sipQtWidgetsQStyleOptionHeaderV2.cpp"
#line 28 "/build/pyqt6/src/PyQt6-6.3.1/sip/QtWidgets/qwidget.sip"
#include <qwidget.h>
#line 38 "/build/pyqt6/src/PyQt6-6.3.1/build/QtWidgets/sipQtWidgetsQStyleOptionHeaderV2.cpp"


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

    if (targetType == sipType_QStyleOptionHeaderV2)
        return sipCppV;

    sipCppV = ((const sipClassTypeDef *)sipType_QStyleOptionHeader)->ctd_cast(static_cast< ::QStyleOptionHeader *>(sipCpp), targetType);
    if (sipCppV)
        return sipCppV;

    return SIP_NULLPTR;
}


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


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


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


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


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


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


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

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

            return sipCpp;
        }
    }

    {
        const  ::QStyleOptionHeaderV2* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


extern "C" {static PyObject *varget_QStyleOptionHeaderV2_isSectionDragTarget(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionHeaderV2_isSectionDragTarget(void *sipSelf, PyObject *, PyObject *)
{
    bool sipVal;
     ::QStyleOptionHeaderV2 *sipCpp = reinterpret_cast< ::QStyleOptionHeaderV2 *>(sipSelf);

    sipVal = sipCpp->isSectionDragTarget;

    return PyBool_FromLong(sipVal);
}


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

    sipVal = sipConvertToBool(sipPy);

    if (sipVal < 0)
        return -1;

    sipCpp->isSectionDragTarget = static_cast<bool>(sipVal);

    return 0;
}


extern "C" {static PyObject *varget_QStyleOptionHeaderV2_textElideMode(void *, PyObject *, PyObject *);}
static PyObject *varget_QStyleOptionHeaderV2_textElideMode(void *sipSelf, PyObject *, PyObject *)
{
     ::Qt::TextElideMode sipVal;
     ::QStyleOptionHeaderV2 *sipCpp = reinterpret_cast< ::QStyleOptionHeaderV2 *>(sipSelf);

    sipVal = sipCpp->textElideMode;

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


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

    sipVal = ( ::Qt::TextElideMode)sipConvertToEnum(sipPy, sipType_Qt_TextElideMode);

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

    sipCpp->textElideMode = sipVal;

    return 0;
}

sipVariableDef variables_QStyleOptionHeaderV2[] = {
    {InstanceVariable, sipName_isSectionDragTarget, (PyMethodDef *)varget_QStyleOptionHeaderV2_isSectionDragTarget, (PyMethodDef *)varset_QStyleOptionHeaderV2_isSectionDragTarget, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_textElideMode, (PyMethodDef *)varget_QStyleOptionHeaderV2_textElideMode, (PyMethodDef *)varset_QStyleOptionHeaderV2_textElideMode, SIP_NULLPTR, SIP_NULLPTR},
};


/* Define the enum members and ints to be added to this type. */
static sipIntInstanceDef intInstances_QStyleOptionHeaderV2[] = {
    {sipName_Type, static_cast<int>( ::QStyleOptionHeaderV2::Type)},
    {sipName_Version, static_cast<int>( ::QStyleOptionHeaderV2::Version)},
    {0, 0}
};

PyDoc_STRVAR(doc_QStyleOptionHeaderV2, "\1QStyleOptionHeaderV2()\n"
"QStyleOptionHeaderV2(QStyleOptionHeaderV2)");


sipClassTypeDef sipTypeDef_QtWidgets_QStyleOptionHeaderV2 = {
    {
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QStyleOptionHeaderV2,
        SIP_NULLPTR,
        SIP_NULLPTR
    },
    {
        sipNameNr_QStyleOptionHeaderV2,
        {0, 0, 1},
        0, SIP_NULLPTR,
        2, variables_QStyleOptionHeaderV2,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, intInstances_QStyleOptionHeaderV2, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QStyleOptionHeaderV2,
    -1,
    -1,
    supers_QStyleOptionHeaderV2,
    SIP_NULLPTR,
    init_type_QStyleOptionHeaderV2,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QStyleOptionHeaderV2,
    assign_QStyleOptionHeaderV2,
    array_QStyleOptionHeaderV2,
    copy_QStyleOptionHeaderV2,
    release_QStyleOptionHeaderV2,
    cast_QStyleOptionHeaderV2,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QStyleOptionHeaderV2,
    sizeof ( ::QStyleOptionHeaderV2),
};
