mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 17:08:38 +00:00
113 lines
3.5 KiB
C++
113 lines
3.5 KiB
C++
#include <QAbstractPrintDialog>
|
|
#include <QList>
|
|
#include <QMetaObject>
|
|
#include <QPrinter>
|
|
#include <QString>
|
|
#include <QByteArray>
|
|
#include <cstring>
|
|
#include <QWidget>
|
|
#include <qabstractprintdialog.h>
|
|
#include "gen_qabstractprintdialog.h"
|
|
#include "_cgo_export.h"
|
|
|
|
QAbstractPrintDialog* QAbstractPrintDialog_new(QPrinter* printer) {
|
|
return new QAbstractPrintDialog(printer);
|
|
}
|
|
|
|
QAbstractPrintDialog* QAbstractPrintDialog_new2(QPrinter* printer, QWidget* parent) {
|
|
return new QAbstractPrintDialog(printer, parent);
|
|
}
|
|
|
|
QMetaObject* QAbstractPrintDialog_MetaObject(const QAbstractPrintDialog* self) {
|
|
return (QMetaObject*) self->metaObject();
|
|
}
|
|
|
|
void* QAbstractPrintDialog_Metacast(QAbstractPrintDialog* self, const char* param1) {
|
|
return self->qt_metacast(param1);
|
|
}
|
|
|
|
struct miqt_string QAbstractPrintDialog_Tr(const char* s) {
|
|
QString _ret = QAbstractPrintDialog::tr(s);
|
|
// 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;
|
|
}
|
|
|
|
void QAbstractPrintDialog_SetOptionTabs(QAbstractPrintDialog* self, struct miqt_array /* of QWidget* */ tabs) {
|
|
QList<QWidget *> tabs_QList;
|
|
tabs_QList.reserve(tabs.len);
|
|
QWidget** tabs_arr = static_cast<QWidget**>(tabs.data);
|
|
for(size_t i = 0; i < tabs.len; ++i) {
|
|
tabs_QList.push_back(tabs_arr[i]);
|
|
}
|
|
self->setOptionTabs(tabs_QList);
|
|
}
|
|
|
|
void QAbstractPrintDialog_SetPrintRange(QAbstractPrintDialog* self, int rangeVal) {
|
|
self->setPrintRange(static_cast<QAbstractPrintDialog::PrintRange>(rangeVal));
|
|
}
|
|
|
|
int QAbstractPrintDialog_PrintRange(const QAbstractPrintDialog* self) {
|
|
QAbstractPrintDialog::PrintRange _ret = self->printRange();
|
|
return static_cast<int>(_ret);
|
|
}
|
|
|
|
void QAbstractPrintDialog_SetMinMax(QAbstractPrintDialog* self, int min, int max) {
|
|
self->setMinMax(static_cast<int>(min), static_cast<int>(max));
|
|
}
|
|
|
|
int QAbstractPrintDialog_MinPage(const QAbstractPrintDialog* self) {
|
|
return self->minPage();
|
|
}
|
|
|
|
int QAbstractPrintDialog_MaxPage(const QAbstractPrintDialog* self) {
|
|
return self->maxPage();
|
|
}
|
|
|
|
void QAbstractPrintDialog_SetFromTo(QAbstractPrintDialog* self, int fromPage, int toPage) {
|
|
self->setFromTo(static_cast<int>(fromPage), static_cast<int>(toPage));
|
|
}
|
|
|
|
int QAbstractPrintDialog_FromPage(const QAbstractPrintDialog* self) {
|
|
return self->fromPage();
|
|
}
|
|
|
|
int QAbstractPrintDialog_ToPage(const QAbstractPrintDialog* self) {
|
|
return self->toPage();
|
|
}
|
|
|
|
QPrinter* QAbstractPrintDialog_Printer(const QAbstractPrintDialog* self) {
|
|
return self->printer();
|
|
}
|
|
|
|
struct miqt_string QAbstractPrintDialog_Tr2(const char* s, const char* c) {
|
|
QString _ret = QAbstractPrintDialog::tr(s, c);
|
|
// 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;
|
|
}
|
|
|
|
struct miqt_string QAbstractPrintDialog_Tr3(const char* s, const char* c, int n) {
|
|
QString _ret = QAbstractPrintDialog::tr(s, c, static_cast<int>(n));
|
|
// 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;
|
|
}
|
|
|
|
void QAbstractPrintDialog_Delete(QAbstractPrintDialog* self) {
|
|
delete self;
|
|
}
|
|
|