2024-08-25 04:08:24 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QIODevice>
|
|
|
|
#include <QMetaObject>
|
2024-08-29 07:01:51 +00:00
|
|
|
#define WORKAROUND_INNER_CLASS_DEFINITION_QPagedPaintDevice__Margins
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QPdfWriter>
|
|
|
|
#include <QSizeF>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qpdfwriter.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qpdfwriter.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QPdfWriter* QPdfWriter_new(struct miqt_string* filename) {
|
|
|
|
QString filename_QString = QString::fromUtf8(&filename->data, filename->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QPdfWriter(filename_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
QPdfWriter* QPdfWriter_new2(QIODevice* device) {
|
|
|
|
return new QPdfWriter(device);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QPdfWriter_MetaObject(const QPdfWriter* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
void* QPdfWriter_Metacast(QPdfWriter* self, const char* param1) {
|
|
|
|
return self->qt_metacast(param1);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QPdfWriter_Tr(const char* s) {
|
|
|
|
QString _ret = QPdfWriter::tr(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QPdfWriter_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QPdfWriter::trUtf8(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QPdfWriter_SetPdfVersion(QPdfWriter* self, int version) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setPdfVersion(static_cast<QPagedPaintDevice::PdfVersion>(version));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QPdfWriter_PdfVersion(const QPdfWriter* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QPagedPaintDevice::PdfVersion _ret = self->pdfVersion();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QPdfWriter_Title(const QPdfWriter* self) {
|
|
|
|
QString _ret = self->title();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QPdfWriter_SetTitle(QPdfWriter* self, struct miqt_string* title) {
|
|
|
|
QString title_QString = QString::fromUtf8(&title->data, title->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setTitle(title_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QPdfWriter_Creator(const QPdfWriter* self) {
|
|
|
|
QString _ret = self->creator();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QPdfWriter_SetCreator(QPdfWriter* self, struct miqt_string* creator) {
|
|
|
|
QString creator_QString = QString::fromUtf8(&creator->data, creator->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setCreator(creator_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPdfWriter_NewPage(QPdfWriter* self) {
|
|
|
|
return self->newPage();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPdfWriter_SetResolution(QPdfWriter* self, int resolution) {
|
|
|
|
self->setResolution(static_cast<int>(resolution));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QPdfWriter_Resolution(const QPdfWriter* self) {
|
|
|
|
return self->resolution();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPdfWriter_SetDocumentXmpMetadata(QPdfWriter* self, QByteArray* xmpMetadata) {
|
|
|
|
self->setDocumentXmpMetadata(*xmpMetadata);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QByteArray* QPdfWriter_DocumentXmpMetadata(const QPdfWriter* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QByteArray(self->documentXmpMetadata());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QPdfWriter_AddFileAttachment(QPdfWriter* self, struct miqt_string* fileName, QByteArray* data) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->addFileAttachment(fileName_QString, *data);
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QPdfWriter_SetPageSize(QPdfWriter* self, int size) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setPageSize(static_cast<QPagedPaintDevice::PageSize>(size));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QPdfWriter_SetPageSizeMM(QPdfWriter* self, QSizeF* size) {
|
|
|
|
self->setPageSizeMM(*size);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QPdfWriter_SetMargins(QPdfWriter* self, QPagedPaintDevice__Margins* m) {
|
|
|
|
self->setMargins(*m);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QPdfWriter_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QPdfWriter::tr(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QPdfWriter_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QPdfWriter::tr(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QPdfWriter_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QPdfWriter::trUtf8(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QPdfWriter_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QPdfWriter::trUtf8(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QPdfWriter_AddFileAttachment3(QPdfWriter* self, struct miqt_string* fileName, QByteArray* data, struct miqt_string* mimeType) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
|
|
|
QString mimeType_QString = QString::fromUtf8(&mimeType->data, mimeType->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->addFileAttachment(fileName_QString, *data, mimeType_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPdfWriter_Delete(QPdfWriter* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|