/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQtWebEngine.
 * 
 * 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 "sipAPIQtWebEngineCore.h"

#line 28 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/sip/QtWebEngineCore/qwebenginecookiestore.sip"
#include <qwebenginecookiestore.h>
#line 29 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"

#line 28 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qobject.sip"
#include <qobject.h>
#line 33 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 26 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtNetwork/qnetworkcookie.sip"
#include <qnetworkcookie.h>
#line 36 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 109 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qurl.sip"
#include <qurl.h>
#line 39 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 26 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qobjectdefs.sip"
#include <qobjectdefs.h>
#line 146 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qobjectdefs.sip"
#include <qobjectdefs.h>
#line 44 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 26 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qmetaobject.sip"
#include <qmetaobject.h>
#line 47 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 26 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 50 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 247 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 53 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 235 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 56 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 27 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qstring.sip"
#include <qstring.h>
#line 59 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 26 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qvariant.sip"
#include <qvariant.h>
#line 62 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 38 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qpycore_qlist.sip"
#include <qlist.h>
#line 65 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 30 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qbytearray.sip"
#include <qbytearray.h>
#line 68 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 149 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qpycore_qlist.sip"
#include <qlist.h>
#line 71 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 26 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 74 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 26 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qthread.sip"
#include <qthread.h>
#line 77 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 26 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 80 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 26 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qregexp.sip"
#include <qregexp.h>
#line 83 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 26 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qregularexpression.sip"
#include <qregularexpression.h>
#line 86 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"
#line 26 "/usr/lib/python3.10/site-packages/PyQt5/bindings/QtCore/qobjectdefs.sip"
#include <qobjectdefs.h>
#line 89 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"


PyDoc_STRVAR(doc_QWebEngineCookieStore_setCookie, "setCookie(self, QNetworkCookie, origin: QUrl = QUrl())");

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

    {
        const  ::QNetworkCookie* a0;
        const  ::QUrl& a1def = QUrl();
        const  ::QUrl* a1 = &a1def;
         ::QWebEngineCookieStore *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9|J9", &sipSelf, sipType_QWebEngineCookieStore, &sipCpp, sipType_QNetworkCookie, &a0, sipType_QUrl, &a1))
        {
            sipCpp->setCookie(*a0,*a1);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QWebEngineCookieStore, sipName_setCookie, doc_QWebEngineCookieStore_setCookie);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QWebEngineCookieStore_deleteCookie, "deleteCookie(self, QNetworkCookie, origin: QUrl = QUrl())");

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

    {
        const  ::QNetworkCookie* a0;
        const  ::QUrl& a1def = QUrl();
        const  ::QUrl* a1 = &a1def;
         ::QWebEngineCookieStore *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BJ9|J9", &sipSelf, sipType_QWebEngineCookieStore, &sipCpp, sipType_QNetworkCookie, &a0, sipType_QUrl, &a1))
        {
            sipCpp->deleteCookie(*a0,*a1);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QWebEngineCookieStore, sipName_deleteCookie, doc_QWebEngineCookieStore_deleteCookie);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QWebEngineCookieStore_deleteSessionCookies, "deleteSessionCookies(self)");

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

    {
         ::QWebEngineCookieStore *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QWebEngineCookieStore, &sipCpp))
        {
            sipCpp->deleteSessionCookies();

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QWebEngineCookieStore, sipName_deleteSessionCookies, doc_QWebEngineCookieStore_deleteSessionCookies);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QWebEngineCookieStore_deleteAllCookies, "deleteAllCookies(self)");

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

    {
         ::QWebEngineCookieStore *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QWebEngineCookieStore, &sipCpp))
        {
            sipCpp->deleteAllCookies();

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QWebEngineCookieStore, sipName_deleteAllCookies, doc_QWebEngineCookieStore_deleteAllCookies);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QWebEngineCookieStore_loadAllCookies, "loadAllCookies(self)");

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

    {
         ::QWebEngineCookieStore *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QWebEngineCookieStore, &sipCpp))
        {
            sipCpp->loadAllCookies();

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QWebEngineCookieStore, sipName_loadAllCookies, doc_QWebEngineCookieStore_loadAllCookies);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QWebEngineCookieStore_setCookieFilter, "setCookieFilter(self, filterCallback: Callable[[FilterRequest], bool] = 0)");

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

    {
        PyObject * a0 = 0;
        PyObject *a0Keep = 0;
         ::QWebEngineCookieStore *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|@H", &sipSelf, sipType_QWebEngineCookieStore, &sipCpp, &a0Keep, &a0))
        {
#line 100 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/sip/QtWebEngineCore/qwebenginecookiestore.sip"
        Py_BEGIN_ALLOW_THREADS
        
        sipCpp->setCookieFilter([a0](const QWebEngineCookieStore::FilterRequest &arg) {
            int res_int = 1;
            
            if (a0)
            {
                SIP_BLOCK_THREADS
            
                PyObject *res;
        
                res = sipCallMethod(NULL, a0, "N",
                        new QWebEngineCookieStore::FilterRequest(arg),
                        sipType_QWebEngineCookieStore_FilterRequest, NULL);
            
                if (!res)
                {
                    res_int = -1;
                }
                else
                {
                    res_int = sipConvertToBool(res);
                
                    Py_DECREF(res);
                }
        
                if (res_int < 0)
                {
                    pyqt5_qtwebenginecore_err_print();
                    res_int = 0;
                }
        
                SIP_UNBLOCK_THREADS
            }
        
            return res_int;
        });
        
        Py_END_ALLOW_THREADS
#line 297 "/build/pyqt5-webengine/src/PyQtWebEngine-5.15.6/build/QtWebEngineCore/sipQtWebEngineCoreQWebEngineCookieStore.cpp"

            sipKeepReference(sipSelf, -1, a0Keep);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QWebEngineCookieStore, sipName_setCookieFilter, doc_QWebEngineCookieStore_setCookieFilter);

    return SIP_NULLPTR;
}


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

    if (targetType == sipType_QWebEngineCookieStore)
        return sipCppV;

    if (targetType == sipType_QObject)
        return static_cast< ::QObject *>(sipCpp);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QWebEngineCookieStore(void *, int);}
static void release_QWebEngineCookieStore(void *sipCppV, int)
{
     ::QWebEngineCookieStore *sipCpp = reinterpret_cast< ::QWebEngineCookieStore *>(sipCppV);

    if (QThread::currentThread() == sipCpp->thread())
        delete sipCpp;
    else
        sipCpp->deleteLater();
}


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


/* Define this type's super-types. */
static sipEncodedTypeDef supers_QWebEngineCookieStore[] = {{5, 0, 1}};


static PyMethodDef methods_QWebEngineCookieStore[] = {
    {sipName_deleteAllCookies, meth_QWebEngineCookieStore_deleteAllCookies, METH_VARARGS, doc_QWebEngineCookieStore_deleteAllCookies},
    {sipName_deleteCookie, SIP_MLMETH_CAST(meth_QWebEngineCookieStore_deleteCookie), METH_VARARGS|METH_KEYWORDS, doc_QWebEngineCookieStore_deleteCookie},
    {sipName_deleteSessionCookies, meth_QWebEngineCookieStore_deleteSessionCookies, METH_VARARGS, doc_QWebEngineCookieStore_deleteSessionCookies},
    {sipName_loadAllCookies, meth_QWebEngineCookieStore_loadAllCookies, METH_VARARGS, doc_QWebEngineCookieStore_loadAllCookies},
    {sipName_setCookie, SIP_MLMETH_CAST(meth_QWebEngineCookieStore_setCookie), METH_VARARGS|METH_KEYWORDS, doc_QWebEngineCookieStore_setCookie},
    {sipName_setCookieFilter, SIP_MLMETH_CAST(meth_QWebEngineCookieStore_setCookieFilter), METH_VARARGS|METH_KEYWORDS, doc_QWebEngineCookieStore_setCookieFilter}
};


/* Define this type's signals. */
static const pyqt5QtSignal signals_QWebEngineCookieStore[] = {
    {"cookieRemoved(QNetworkCookie)", "\1cookieRemoved(self, QNetworkCookie)", SIP_NULLPTR, SIP_NULLPTR},
    {"cookieAdded(QNetworkCookie)", "\1cookieAdded(self, QNetworkCookie)", SIP_NULLPTR, SIP_NULLPTR},
    {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR}
};


static pyqt5ClassPluginDef plugin_QWebEngineCookieStore = {
    & ::QWebEngineCookieStore::staticMetaObject,
    0,
    signals_QWebEngineCookieStore,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtWebEngineCore_QWebEngineCookieStore = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QWebEngineCookieStore,
        SIP_NULLPTR,
        &plugin_QWebEngineCookieStore
    },
    {
        sipNameNr_QWebEngineCookieStore,
        {0, 0, 1},
        6, methods_QWebEngineCookieStore,
        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},
    },
    SIP_NULLPTR,
    -1,
    -1,
    supers_QWebEngineCookieStore,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QWebEngineCookieStore,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QWebEngineCookieStore,
    cast_QWebEngineCookieStore,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    0,
};
