miqt/qt/webengine/gen_qwebenginecertificateerror.cpp

93 lines
2.9 KiB
C++
Raw Normal View History

2024-11-27 18:16:48 +13:00
#include <QList>
#include <QSslCertificate>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <QUrl>
#include <QWebEngineCertificateError>
#include <qwebenginecertificateerror.h>
#include "gen_qwebenginecertificateerror.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
2024-11-27 18:16:48 +13:00
2024-12-07 17:15:57 +13:00
QWebEngineCertificateError* QWebEngineCertificateError_new(int error, QUrl* url, bool overridable, struct miqt_string errorDescription) {
2024-11-27 18:16:48 +13:00
QString errorDescription_QString = QString::fromUtf8(errorDescription.data, errorDescription.len);
2024-12-07 17:15:57 +13:00
return new QWebEngineCertificateError(static_cast<int>(error), *url, overridable, errorDescription_QString);
2024-11-27 18:16:48 +13:00
}
2024-12-07 17:15:57 +13:00
QWebEngineCertificateError* QWebEngineCertificateError_new2(QWebEngineCertificateError* other) {
return new QWebEngineCertificateError(*other);
2024-11-27 18:16:48 +13:00
}
2025-02-01 13:45:16 +13:00
int QWebEngineCertificateError_error(const QWebEngineCertificateError* self) {
2024-11-27 18:16:48 +13:00
QWebEngineCertificateError::Error _ret = self->error();
return static_cast<int>(_ret);
}
2025-02-01 13:45:16 +13:00
QUrl* QWebEngineCertificateError_url(const QWebEngineCertificateError* self) {
2024-11-27 18:16:48 +13:00
return new QUrl(self->url());
}
2025-02-01 13:45:16 +13:00
bool QWebEngineCertificateError_isOverridable(const QWebEngineCertificateError* self) {
2024-11-27 18:16:48 +13:00
return self->isOverridable();
}
2025-02-01 13:45:16 +13:00
struct miqt_string QWebEngineCertificateError_errorDescription(const QWebEngineCertificateError* self) {
2024-11-27 18:16:48 +13:00
QString _ret = self->errorDescription();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
2025-02-01 13:45:16 +13:00
void QWebEngineCertificateError_operatorAssign(QWebEngineCertificateError* self, QWebEngineCertificateError* other) {
2024-11-27 18:16:48 +13:00
self->operator=(*other);
}
2025-02-01 13:45:16 +13:00
void QWebEngineCertificateError_defer(QWebEngineCertificateError* self) {
2024-11-27 18:16:48 +13:00
self->defer();
}
2025-02-01 13:45:16 +13:00
bool QWebEngineCertificateError_deferred(const QWebEngineCertificateError* self) {
2024-11-27 18:16:48 +13:00
return self->deferred();
}
2025-02-01 13:45:16 +13:00
void QWebEngineCertificateError_rejectCertificate(QWebEngineCertificateError* self) {
2024-11-27 18:16:48 +13:00
self->rejectCertificate();
}
2025-02-01 13:45:16 +13:00
void QWebEngineCertificateError_ignoreCertificateError(QWebEngineCertificateError* self) {
2024-11-27 18:16:48 +13:00
self->ignoreCertificateError();
}
2025-02-01 13:45:16 +13:00
bool QWebEngineCertificateError_answered(const QWebEngineCertificateError* self) {
2024-11-27 18:16:48 +13:00
return self->answered();
}
2025-02-01 13:45:16 +13:00
struct miqt_array /* of QSslCertificate* */ QWebEngineCertificateError_certificateChain(const QWebEngineCertificateError* self) {
2024-11-27 18:16:48 +13:00
QList<QSslCertificate> _ret = self->certificateChain();
// Convert QList<> from C++ memory to manually-managed C memory
QSslCertificate** _arr = static_cast<QSslCertificate**>(malloc(sizeof(QSslCertificate*) * _ret.length()));
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
_arr[i] = new QSslCertificate(_ret[i]);
}
struct miqt_array _out;
_out.len = _ret.length();
_out.data = static_cast<void*>(_arr);
return _out;
}
2025-02-01 13:45:16 +13:00
void QWebEngineCertificateError_delete(QWebEngineCertificateError* self) {
delete self;
2024-11-27 18:16:48 +13:00
}