/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.15.3
 *
 * Copyright (c) 2026 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 "sipAPIQtCore.h"

#line 106 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qstringconverter.sip"
#include <qstringconverter.h>
#line 29 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQStringDecoder.cpp"

#line 57 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qstringconverter_base.sip"
#include <qstringconverter_base.h>
#line 33 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQStringDecoder.cpp"
#line 25 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qflags.sip"
#include <qglobal.h>
#line 36 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQStringDecoder.cpp"
#line 28 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qstringconverter_base.sip"
#include <qstringconverter_base.h>
#line 39 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQStringDecoder.cpp"
#line 26 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qanystringview.sip"
#include <qanystringview.h>
#line 42 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQStringDecoder.cpp"
#line 24 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qbytearrayview.sip"
#include <qbytearrayview.h>
#line 45 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQStringDecoder.cpp"
#line 24 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 48 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQStringDecoder.cpp"
#line 26 "/build/pyqt6/src/pyqt6-6.11.0/sip/QtCore/qstringlist.sip"
#include <qstringlist.h>
#line 51 "/build/pyqt6/src/pyqt6-6.11.0/build/QtCore/sipQtCoreQStringDecoder.cpp"


PyDoc_STRVAR(doc_QStringDecoder_decode, "decode(self, ba: QByteArray|bytes|bytearray|memoryview) -> str");

extern "C" {static PyObject *meth_QStringDecoder_decode(PyObject *, PyObject *);}
static PyObject *meth_QStringDecoder_decode(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        ::QByteArrayView* a0;
        int a0State = 0;
        void *a0UserState = SIP_NULLPTR;
        ::QStringDecoder *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_QStringDecoder, &sipCpp, sipType_QByteArrayView, &a0, &a0State, &a0UserState))
        {
            ::QString*sipRes;

            sipRes = new ::QString(sipCpp->decode(*a0));
            sipReleaseTypeUS(a0, sipType_QByteArrayView, a0State, a0UserState);

            return sipConvertFromNewType(sipRes, sipType_QString, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QStringDecoder, sipName_decode, doc_QStringDecoder_decode);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QStringDecoder_decoderForHtml, "decoderForHtml(data: QByteArray|bytes|bytearray|memoryview) -> QStringDecoder");

extern "C" {static PyObject *meth_QStringDecoder_decoderForHtml(PyObject *, PyObject *);}
static PyObject *meth_QStringDecoder_decoderForHtml(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        ::QByteArrayView* a0;
        int a0State = 0;
        void *a0UserState = SIP_NULLPTR;

        if (sipParseArgs(&sipParseErr, sipArgs, "CJ1", &sipSelf, sipType_QByteArrayView, &a0, &a0State, &a0UserState))
        {
            ::QStringDecoder*sipRes;

            sipRes = reinterpret_cast< ::QStringDecoder *>(::operator new(sizeof (::QStringDecoder)));
            *sipRes = ::QStringDecoder::decoderForHtml(*a0);
            sipReleaseTypeUS(a0, sipType_QByteArrayView, a0State, a0UserState);

            return sipConvertFromNewType(sipRes, sipType_QStringDecoder, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QStringDecoder, sipName_decoderForHtml, doc_QStringDecoder_decoderForHtml);

    return SIP_NULLPTR;
}


extern "C" {static PyObject *slot_QStringDecoder___call__(PyObject *, PyObject *, PyObject *);}
static PyObject *slot_QStringDecoder___call__(PyObject *sipSelf, PyObject *sipArgs, PyObject *)
{
    ::QStringDecoder *sipCpp = reinterpret_cast< ::QStringDecoder *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf, sipType_QStringDecoder));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        ::QByteArrayView* a0;
        int a0State = 0;
        void *a0UserState = SIP_NULLPTR;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1", sipType_QByteArrayView, &a0, &a0State, &a0UserState))
        {
            ::QString*sipRes;

            sipRes = new ::QString((*sipCpp)(*a0));
            sipReleaseTypeUS(a0, sipType_QByteArrayView, a0State, a0UserState);

            return sipConvertFromNewType(sipRes, sipType_QString, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QStringDecoder, sipName___call__, SIP_NULLPTR);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_QStringDecoder)
        return sipCppV;

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

    return SIP_NULLPTR;
}


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


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


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


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


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

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

            return sipCpp;
        }
    }

    {
        ::QStringConverter::Encoding a0;
        ::QStringConverterBase::Flags a1def = QStringConverterBase::Flag::Default;
        ::QStringConverterBase::Flags* a1 = &a1def;
        int a1State = 0;

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            sipName_flags,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "E|J1", sipType_QStringConverter_Encoding, &a0, sipType_QFlags_0100QStringConverterBase_Flag, &a1, &a1State))
        {
            sipCpp = new ::QStringDecoder(a0, *a1);
            sipReleaseType(a1, sipType_QFlags_0100QStringConverterBase_Flag, a1State);

            return sipCpp;
        }
    }

    {
        ::QAnyStringView* a0;
        int a0State = 0;
        void *a0UserState = SIP_NULLPTR;
        ::QStringConverterBase::Flags a1def = QStringConverterBase::Flag::Default;
        ::QStringConverterBase::Flags* a1 = &a1def;
        int a1State = 0;

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            sipName_flags,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J1|J1", sipType_QAnyStringView, &a0, &a0State, &a0UserState, sipType_QFlags_0100QStringConverterBase_Flag, &a1, &a1State))
        {
            sipCpp = new ::QStringDecoder(*a0, *a1);
            sipReleaseTypeUS(a0, sipType_QAnyStringView, a0State, a0UserState);
            sipReleaseType(a1, sipType_QFlags_0100QStringConverterBase_Flag, a1State);

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


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


/* Define this type's Python slots. */
static sipPySlotDef slots_QStringDecoder[] = {
    {(void *)slot_QStringDecoder___call__, call_slot},
    {0, (sipPySlotType)0}
};


static PyMethodDef methods_QStringDecoder[] = {
    {sipName_decode, meth_QStringDecoder_decode, METH_VARARGS, doc_QStringDecoder_decode},
    {sipName_decoderForHtml, meth_QStringDecoder_decoderForHtml, METH_VARARGS, doc_QStringDecoder_decoderForHtml}
};

PyDoc_STRVAR(doc_QStringDecoder, "\1QStringDecoder()\n"
"QStringDecoder(encoding: QStringConverter.Encoding, flags: QStringConverterBase.Flag = QStringConverterBase.Flag.Default)\n"
"QStringDecoder(name: QByteArray|bytes|bytearray|memoryview|str|None, flags: QStringConverterBase.Flag = QStringConverterBase.Flag.Default)");


sipClassTypeDef sipTypeDef_QtCore_QStringDecoder = {
    {
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QStringDecoder,
        SIP_NULLPTR,
        SIP_NULLPTR,
    },
    {
        sipNameNr_QStringDecoder,
        {0, 0, 1},
        2, methods_QStringDecoder,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QStringDecoder,
    -1,
    -1,
    supers_QStringDecoder,
    slots_QStringDecoder,
    init_type_QStringDecoder,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QStringDecoder,
    SIP_NULLPTR,
    array_QStringDecoder,
    SIP_NULLPTR,
    release_QStringDecoder,
    cast_QStringDecoder,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QStringDecoder,
    sizeof (::QStringDecoder),
};
