PythonQtWrapper_QHttp.cpp
265 lines
| 8.6 KiB
| text/x-c
|
CppLexer
florianlink
|
r13 | #include "PythonQtWrapper_QHttp.h" | ||
florianlink
|
r24 | #include <PythonQtSignalReceiver.h> | ||
#include <PythonQtMethodInfo.h> | ||||
#include <PythonQtConversion.h> | ||||
florianlink
|
r13 | #include <QVariant> | ||
#include <qauthenticator.h> | ||||
#include <qbytearray.h> | ||||
#include <qcoreevent.h> | ||||
#include <qhttp.h> | ||||
#include <qiodevice.h> | ||||
#include <qlist.h> | ||||
#include <qnetworkproxy.h> | ||||
#include <qobject.h> | ||||
#include <qtcpsocket.h> | ||||
florianlink
|
r24 | void PythonQtShell_QHttp::childEvent(QChildEvent* arg__1) | ||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"" , "QChildEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
florianlink
|
r24 | void* args[2] = {NULL, (void*)&arg__1}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QHttp::childEvent(arg__1); | ||||
} | ||||
void PythonQtShell_QHttp::customEvent(QEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"" , "QEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
florianlink
|
r24 | void* args[2] = {NULL, (void*)&arg__1}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QHttp::customEvent(arg__1); | ||||
} | ||||
bool PythonQtShell_QHttp::event(QEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"bool" , "QEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
bool returnValue; | ||||
florianlink
|
r24 | void* args[2] = {NULL, (void*)&arg__1}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { | ||||
args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); | ||||
if (args[0]!=&returnValue) { | ||||
florianlink
|
r73 | if (args[0]==NULL) { | ||
PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); | ||||
} else { | ||||
returnValue = *((bool*)args[0]); | ||||
} | ||||
florianlink
|
r24 | } | ||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QHttp::event(arg__1); | ||||
} | ||||
bool PythonQtShell_QHttp::eventFilter(QObject* arg__1, QEvent* arg__2) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); | ||||
bool returnValue; | ||||
florianlink
|
r24 | void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { | ||||
args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); | ||||
if (args[0]!=&returnValue) { | ||||
florianlink
|
r73 | if (args[0]==NULL) { | ||
PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); | ||||
} else { | ||||
returnValue = *((bool*)args[0]); | ||||
} | ||||
florianlink
|
r24 | } | ||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QHttp::eventFilter(arg__1, arg__2); | ||||
} | ||||
void PythonQtShell_QHttp::timerEvent(QTimerEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"" , "QTimerEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
florianlink
|
r24 | void* args[2] = {NULL, (void*)&arg__1}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QHttp::timerEvent(arg__1); | ||||
} | ||||
florianlink
|
r13 | QHttp* PythonQtWrapper_QHttp::new_QHttp(QObject* parent) | ||
{ | ||||
florianlink
|
r24 | return new PythonQtShell_QHttp(parent); } | ||
florianlink
|
r13 | |||
QHttp* PythonQtWrapper_QHttp::new_QHttp(const QString& hostname, QHttp::ConnectionMode mode, unsigned short port, QObject* parent) | ||||
{ | ||||
florianlink
|
r24 | return new PythonQtShell_QHttp(hostname, mode, port, parent); } | ||
florianlink
|
r13 | |||
QHttp* PythonQtWrapper_QHttp::new_QHttp(const QString& hostname, unsigned short port, QObject* parent) | ||||
{ | ||||
florianlink
|
r24 | return new PythonQtShell_QHttp(hostname, port, parent); } | ||
florianlink
|
r13 | |||
florianlink
|
r73 | int PythonQtWrapper_QHttp::setProxy(QHttp* theWrappedObject, const QNetworkProxy& proxy) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->setProxy(proxy)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QHttp::request(QHttp* theWrappedObject, const QHttpRequestHeader& header, QIODevice* device, QIODevice* to) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->request(header, device, to)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QHttpRequestHeader PythonQtWrapper_QHttp::currentRequest(QHttp* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->currentRequest()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QHttp::State PythonQtWrapper_QHttp::state(QHttp* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->state()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QHttp::Error PythonQtWrapper_QHttp::error(QHttp* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->error()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QHttp::request(QHttp* theWrappedObject, const QHttpRequestHeader& header, const QByteArray& data, QIODevice* to) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->request(header, data, to)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | bool PythonQtWrapper_QHttp::hasPendingRequests(QHttp* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->hasPendingRequests()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QHttp::setSocket(QHttp* theWrappedObject, QTcpSocket* socket) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->setSocket(socket)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QHttp::setUser(QHttp* theWrappedObject, const QString& username, const QString& password) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->setUser(username, password)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QHttp::post(QHttp* theWrappedObject, const QString& path, const QByteArray& data, QIODevice* to) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->post(path, data, to)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QIODevice* PythonQtWrapper_QHttp::currentDestinationDevice(QHttp* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->currentDestinationDevice()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | qint64 PythonQtWrapper_QHttp::bytesAvailable(QHttp* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->bytesAvailable()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QByteArray PythonQtWrapper_QHttp::readAll(QHttp* theWrappedObject) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->readAll()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QHttp::setHost(QHttp* theWrappedObject, const QString& hostname, QHttp::ConnectionMode mode, unsigned short port) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->setHost(hostname, mode, port)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QHttp::currentId(QHttp* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->currentId()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QHttp::setHost(QHttp* theWrappedObject, const QString& hostname, unsigned short port) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->setHost(hostname, port)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QHttp::setProxy(QHttp* theWrappedObject, const QString& host, int port, const QString& username, const QString& password) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->setProxy(host, port, username, password)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QHttp::clearPendingRequests(QHttp* theWrappedObject) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->clearPendingRequests()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QHttpResponseHeader PythonQtWrapper_QHttp::lastResponse(QHttp* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->lastResponse()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | qint64 PythonQtWrapper_QHttp::read(QHttp* theWrappedObject, char* data, qint64 maxlen) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->read(data, maxlen)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QIODevice* PythonQtWrapper_QHttp::currentSourceDevice(QHttp* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->currentSourceDevice()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QHttp::get(QHttp* theWrappedObject, const QString& path, QIODevice* to) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->get(path, to)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | QString PythonQtWrapper_QHttp::errorString(QHttp* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->errorString()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r24 | int PythonQtWrapper_QHttp::close(QHttp* theWrappedObject) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->close()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QHttp::head(QHttp* theWrappedObject, const QString& path) | ||
florianlink
|
r28 | { | ||
florianlink
|
r73 | return ( theWrappedObject->head(path)); | ||
florianlink
|
r28 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QHttp::post(QHttp* theWrappedObject, const QString& path, QIODevice* data, QIODevice* to) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->post(path, data, to)); | ||
florianlink
|
r13 | } | ||