2024-08-25 04:08:24 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QTextCursor>
|
|
|
|
#include <QTextDocument>
|
|
|
|
#include <QTextDocumentFragment>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qtextdocumentfragment.h"
|
|
|
|
#include "gen_qtextdocumentfragment.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QTextDocumentFragment* QTextDocumentFragment_new() {
|
|
|
|
return new QTextDocumentFragment();
|
|
|
|
}
|
|
|
|
|
|
|
|
QTextDocumentFragment* QTextDocumentFragment_new2(QTextDocument* document) {
|
|
|
|
return new QTextDocumentFragment(document);
|
|
|
|
}
|
|
|
|
|
|
|
|
QTextDocumentFragment* QTextDocumentFragment_new3(QTextCursor* rangeVal) {
|
|
|
|
return new QTextDocumentFragment(*rangeVal);
|
|
|
|
}
|
|
|
|
|
|
|
|
QTextDocumentFragment* QTextDocumentFragment_new4(QTextDocumentFragment* rhs) {
|
|
|
|
return new QTextDocumentFragment(*rhs);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTextDocumentFragment_OperatorAssign(QTextDocumentFragment* self, QTextDocumentFragment* rhs) {
|
|
|
|
self->operator=(*rhs);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QTextDocumentFragment_IsEmpty(const QTextDocumentFragment* self) {
|
|
|
|
return self->isEmpty();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QTextDocumentFragment_ToPlainText(const QTextDocumentFragment* self) {
|
|
|
|
QString _ret = self->toPlainText();
|
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* QTextDocumentFragment_ToHtml(const QTextDocumentFragment* self) {
|
|
|
|
QString _ret = self->toHtml();
|
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
|
|
|
QTextDocumentFragment* QTextDocumentFragment_FromPlainText(struct miqt_string* plainText) {
|
|
|
|
QString plainText_QString = QString::fromUtf8(&plainText->data, plainText->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QTextDocumentFragment(QTextDocumentFragment::fromPlainText(plainText_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QTextDocumentFragment* QTextDocumentFragment_FromHtml(struct miqt_string* html) {
|
|
|
|
QString html_QString = QString::fromUtf8(&html->data, html->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QTextDocumentFragment(QTextDocumentFragment::fromHtml(html_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QTextDocumentFragment* QTextDocumentFragment_FromHtml2(struct miqt_string* html, QTextDocument* resourceProvider) {
|
|
|
|
QString html_QString = QString::fromUtf8(&html->data, html->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QTextDocumentFragment(QTextDocumentFragment::fromHtml(html_QString, resourceProvider));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QTextDocumentFragment_ToHtml1(const QTextDocumentFragment* self, QByteArray* encoding) {
|
|
|
|
QString _ret = self->toHtml(*encoding);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
void QTextDocumentFragment_Delete(QTextDocumentFragment* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|