/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 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 "sipAPIQtWebKit.h"

#line 111 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtWebKit/qwebelement.sip"
#include <qwebelement.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWebKit/sipQtWebKitQWebElementCollection.cpp"

#line 28 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtWebKit/qwebelement.sip"
#include <qwebelement.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWebKit/sipQtWebKitQWebElementCollection.cpp"
#line 27 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWebKit/sipQtWebKitQWebElementCollection.cpp"
#line 38 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qpycore_qlist.sip"
#include <qlist.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWebKit/sipQtWebKitQWebElementCollection.cpp"


PyDoc_STRVAR(doc_QWebElementCollection_append, "append(self, QWebElementCollection)");

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

    {
        const  ::QWebElementCollection* a0;
         ::QWebElementCollection *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ9", &sipSelf, sipType_QWebElementCollection, &sipCpp, sipType_QWebElementCollection, &a0))
        {
            sipCpp->append(*a0);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QWebElementCollection, sipName_append, doc_QWebElementCollection_append);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QWebElementCollection_count, "count(self) -> int");

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

    {
        const  ::QWebElementCollection *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QWebElementCollection, &sipCpp))
        {
            int sipRes;

            sipRes = sipCpp->count();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QWebElementCollection, sipName_count, doc_QWebElementCollection_count);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QWebElementCollection_at, "at(self, int) -> QWebElement");

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

    {
        int a0;
        const  ::QWebElementCollection *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bi", &sipSelf, sipType_QWebElementCollection, &sipCpp, &a0))
        {
             ::QWebElement*sipRes;

            sipRes = new  ::QWebElement(sipCpp->at(a0));

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

    sipNoMethod(sipParseErr, sipName_QWebElementCollection, sipName_at, doc_QWebElementCollection_at);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QWebElementCollection_first, "first(self) -> QWebElement");

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

    {
        const  ::QWebElementCollection *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QWebElementCollection, &sipCpp))
        {
             ::QWebElement*sipRes;

            sipRes = new  ::QWebElement(sipCpp->first());

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

    sipNoMethod(sipParseErr, sipName_QWebElementCollection, sipName_first, doc_QWebElementCollection_first);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QWebElementCollection_last, "last(self) -> QWebElement");

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

    {
        const  ::QWebElementCollection *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QWebElementCollection, &sipCpp))
        {
             ::QWebElement*sipRes;

            sipRes = new  ::QWebElement(sipCpp->last());

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

    sipNoMethod(sipParseErr, sipName_QWebElementCollection, sipName_last, doc_QWebElementCollection_last);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QWebElementCollection_toList, "toList(self) -> List[QWebElement]");

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

    {
        const  ::QWebElementCollection *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QWebElementCollection, &sipCpp))
        {
            QList< ::QWebElement>*sipRes;

            sipRes = new QList< ::QWebElement>(sipCpp->toList());

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

    sipNoMethod(sipParseErr, sipName_QWebElementCollection, sipName_toList, doc_QWebElementCollection_toList);

    return SIP_NULLPTR;
}


extern "C" {static PyObject *slot_QWebElementCollection___getitem__(PyObject *,PyObject *);}
static PyObject *slot_QWebElementCollection___getitem__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QWebElementCollection *sipCpp = reinterpret_cast< ::QWebElementCollection *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QWebElementCollection));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        int a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1i", &a0))
        {
             ::QWebElement*sipRes = 0;
            int sipIsErr = 0;

#line 126 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtWebKit/qwebelement.sip"
        Py_ssize_t idx = sipConvertFromSequenceIndex(a0, sipCpp->count());
        
        if (idx < 0)
            sipIsErr = 1;
        else
            sipRes = new QWebElement(sipCpp->operator[]((int)idx));
#line 230 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWebKit/sipQtWebKitQWebElementCollection.cpp"

            if (sipIsErr)
                return 0;

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

    sipNoMethod(sipParseErr, sipName_QWebElementCollection, sipName___getitem__, SIP_NULLPTR);

    return SIP_NULLPTR;
}


extern "C" {static Py_ssize_t slot_QWebElementCollection___len__(PyObject *);}
static Py_ssize_t slot_QWebElementCollection___len__(PyObject *sipSelf)
{
     ::QWebElementCollection *sipCpp = reinterpret_cast< ::QWebElementCollection *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QWebElementCollection));

    if (!sipCpp)
        return 0;


    {
        {
            Py_ssize_t sipRes = 0;

#line 1 "Auto-generated"
            sipRes = (Py_ssize_t)sipCpp->count();
#line 260 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWebKit/sipQtWebKitQWebElementCollection.cpp"

            return sipRes;
        }
    }

    return 0;
}


extern "C" {static PyObject *slot_QWebElementCollection___iadd__(PyObject *,PyObject *);}
static PyObject *slot_QWebElementCollection___iadd__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QWebElementCollection *sipCpp = reinterpret_cast< ::QWebElementCollection *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QWebElementCollection));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QWebElementCollection* a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_QWebElementCollection, &a0))
        {
            sipCpp-> ::QWebElementCollection::operator+=(*a0);

            Py_INCREF(sipSelf);
            return sipSelf;
        }
    }

    /* Raise an exception if the argument couldn't be parsed. */
    sipBadOperatorArg(sipSelf,sipArg,iconcat_slot);

    return SIP_NULLPTR;
}


extern "C" {static PyObject *slot_QWebElementCollection___add__(PyObject *,PyObject *);}
static PyObject *slot_QWebElementCollection___add__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QWebElementCollection *sipCpp = reinterpret_cast< ::QWebElementCollection *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QWebElementCollection));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QWebElementCollection* a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_QWebElementCollection, &a0))
        {
             ::QWebElementCollection*sipRes;

            sipRes = new  ::QWebElementCollection(sipCpp-> ::QWebElementCollection::operator+(*a0));

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

    /* Raise an exception if the argument couldn't be parsed. */
    sipBadOperatorArg(sipSelf,sipArg,concat_slot);

    return SIP_NULLPTR;
}


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


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


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


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


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


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


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

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

            return sipCpp;
        }
    }

    {
        const  ::QWebElement* a0;
        const  ::QString* a1;
        int a1State = 0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9J1", sipType_QWebElement, &a0, sipType_QString, &a1, &a1State))
        {
            sipCpp = new  ::QWebElementCollection(*a0,*a1);
            sipReleaseType(const_cast< ::QString *>(a1), sipType_QString, a1State);

            return sipCpp;
        }
    }

    {
        const  ::QWebElementCollection* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's Python slots. */
static sipPySlotDef slots_QWebElementCollection[] = {
    {(void *)slot_QWebElementCollection___getitem__, getitem_slot},
    {(void *)slot_QWebElementCollection___len__, len_slot},
    {(void *)slot_QWebElementCollection___iadd__, iconcat_slot},
    {(void *)slot_QWebElementCollection___add__, concat_slot},
    {0, (sipPySlotType)0}
};


static PyMethodDef methods_QWebElementCollection[] = {
    {sipName_append, meth_QWebElementCollection_append, METH_VARARGS, doc_QWebElementCollection_append},
    {sipName_at, meth_QWebElementCollection_at, METH_VARARGS, doc_QWebElementCollection_at},
    {sipName_count, meth_QWebElementCollection_count, METH_VARARGS, doc_QWebElementCollection_count},
    {sipName_first, meth_QWebElementCollection_first, METH_VARARGS, doc_QWebElementCollection_first},
    {sipName_last, meth_QWebElementCollection_last, METH_VARARGS, doc_QWebElementCollection_last},
    {sipName_toList, meth_QWebElementCollection_toList, METH_VARARGS, doc_QWebElementCollection_toList}
};

PyDoc_STRVAR(doc_QWebElementCollection, "\1QWebElementCollection()\n"
"QWebElementCollection(QWebElement, str)\n"
"QWebElementCollection(QWebElementCollection)");


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


sipClassTypeDef sipTypeDef_QtWebKit_QWebElementCollection = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QWebElementCollection,
        SIP_NULLPTR,
        &plugin_QWebElementCollection
    },
    {
        sipNameNr_QWebElementCollection,
        {0, 0, 1},
        6, methods_QWebElementCollection,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QWebElementCollection,
    -1,
    sipNameNr_sip_simplewrapper,
    SIP_NULLPTR,
    slots_QWebElementCollection,
    init_type_QWebElementCollection,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QWebElementCollection,
    assign_QWebElementCollection,
    array_QWebElementCollection,
    copy_QWebElementCollection,
    release_QWebElementCollection,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QWebElementCollection,
    sizeof ( ::QWebElementCollection),
};
