2024-11-04 09:13:59 +00:00
|
|
|
package printsupport
|
2024-10-16 05:08:07 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qabstractprintdialog.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/mappu/miqt/qt"
|
|
|
|
"runtime"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QAbstractPrintDialog__PrintRange int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QAbstractPrintDialog__AllPages QAbstractPrintDialog__PrintRange = 0
|
|
|
|
QAbstractPrintDialog__Selection QAbstractPrintDialog__PrintRange = 1
|
|
|
|
QAbstractPrintDialog__PageRange QAbstractPrintDialog__PrintRange = 2
|
|
|
|
QAbstractPrintDialog__CurrentPage QAbstractPrintDialog__PrintRange = 3
|
|
|
|
)
|
|
|
|
|
|
|
|
type QAbstractPrintDialog__PrintDialogOption int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QAbstractPrintDialog__None QAbstractPrintDialog__PrintDialogOption = 0
|
|
|
|
QAbstractPrintDialog__PrintToFile QAbstractPrintDialog__PrintDialogOption = 1
|
|
|
|
QAbstractPrintDialog__PrintSelection QAbstractPrintDialog__PrintDialogOption = 2
|
|
|
|
QAbstractPrintDialog__PrintPageRange QAbstractPrintDialog__PrintDialogOption = 4
|
|
|
|
QAbstractPrintDialog__PrintShowPageSize QAbstractPrintDialog__PrintDialogOption = 8
|
|
|
|
QAbstractPrintDialog__PrintCollateCopies QAbstractPrintDialog__PrintDialogOption = 16
|
|
|
|
QAbstractPrintDialog__DontUseSheet QAbstractPrintDialog__PrintDialogOption = 32
|
|
|
|
QAbstractPrintDialog__PrintCurrentPage QAbstractPrintDialog__PrintDialogOption = 64
|
|
|
|
)
|
|
|
|
|
|
|
|
type QAbstractPrintDialog struct {
|
|
|
|
h *C.QAbstractPrintDialog
|
|
|
|
*qt.QDialog
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) cPointer() *C.QAbstractPrintDialog {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQAbstractPrintDialog(h *C.QAbstractPrintDialog) *QAbstractPrintDialog {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return &QAbstractPrintDialog{h: h, QDialog: qt.UnsafeNewQDialog(unsafe.Pointer(h))}
|
|
|
|
}
|
|
|
|
|
|
|
|
func UnsafeNewQAbstractPrintDialog(h unsafe.Pointer) *QAbstractPrintDialog {
|
|
|
|
return newQAbstractPrintDialog((*C.QAbstractPrintDialog)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQAbstractPrintDialog constructs a new QAbstractPrintDialog object.
|
|
|
|
func NewQAbstractPrintDialog(printer *QPrinter) *QAbstractPrintDialog {
|
|
|
|
ret := C.QAbstractPrintDialog_new(printer.cPointer())
|
|
|
|
return newQAbstractPrintDialog(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQAbstractPrintDialog2 constructs a new QAbstractPrintDialog object.
|
|
|
|
func NewQAbstractPrintDialog2(printer *QPrinter, parent *qt.QWidget) *QAbstractPrintDialog {
|
|
|
|
ret := C.QAbstractPrintDialog_new2(printer.cPointer(), (*C.QWidget)(parent.UnsafePointer()))
|
|
|
|
return newQAbstractPrintDialog(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) MetaObject() *qt.QMetaObject {
|
|
|
|
return qt.UnsafeNewQMetaObject(unsafe.Pointer(C.QAbstractPrintDialog_MetaObject(this.h)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) Metacast(param1 string) unsafe.Pointer {
|
|
|
|
param1_Cstring := C.CString(param1)
|
|
|
|
defer C.free(unsafe.Pointer(param1_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
return (unsafe.Pointer)(C.QAbstractPrintDialog_Metacast(this.h, param1_Cstring))
|
2024-10-16 05:08:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QAbstractPrintDialog_Tr(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QAbstractPrintDialog_Tr(s_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-10-16 05:08:07 +00:00
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func QAbstractPrintDialog_TrUtf8(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QAbstractPrintDialog_TrUtf8(s_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-10-16 05:08:07 +00:00
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) AddEnabledOption(option QAbstractPrintDialog__PrintDialogOption) {
|
|
|
|
C.QAbstractPrintDialog_AddEnabledOption(this.h, (C.int)(option))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) SetEnabledOptions(options QAbstractPrintDialog__PrintDialogOption) {
|
|
|
|
C.QAbstractPrintDialog_SetEnabledOptions(this.h, (C.int)(options))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) EnabledOptions() QAbstractPrintDialog__PrintDialogOption {
|
|
|
|
return (QAbstractPrintDialog__PrintDialogOption)(C.QAbstractPrintDialog_EnabledOptions(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) IsOptionEnabled(option QAbstractPrintDialog__PrintDialogOption) bool {
|
|
|
|
return (bool)(C.QAbstractPrintDialog_IsOptionEnabled(this.h, (C.int)(option)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) SetOptionTabs(tabs []*qt.QWidget) {
|
|
|
|
tabs_CArray := (*[0xffff]*C.QWidget)(C.malloc(C.size_t(8 * len(tabs))))
|
|
|
|
defer C.free(unsafe.Pointer(tabs_CArray))
|
|
|
|
for i := range tabs {
|
|
|
|
tabs_CArray[i] = (*C.QWidget)(tabs[i].UnsafePointer())
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
tabs_ma := C.struct_miqt_array{len: C.size_t(len(tabs)), data: unsafe.Pointer(tabs_CArray)}
|
2024-10-16 05:08:07 +00:00
|
|
|
C.QAbstractPrintDialog_SetOptionTabs(this.h, tabs_ma)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) SetPrintRange(rangeVal QAbstractPrintDialog__PrintRange) {
|
|
|
|
C.QAbstractPrintDialog_SetPrintRange(this.h, (C.int)(rangeVal))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) PrintRange() QAbstractPrintDialog__PrintRange {
|
|
|
|
return (QAbstractPrintDialog__PrintRange)(C.QAbstractPrintDialog_PrintRange(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) SetMinMax(min int, max int) {
|
|
|
|
C.QAbstractPrintDialog_SetMinMax(this.h, (C.int)(min), (C.int)(max))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) MinPage() int {
|
|
|
|
return (int)(C.QAbstractPrintDialog_MinPage(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) MaxPage() int {
|
|
|
|
return (int)(C.QAbstractPrintDialog_MaxPage(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) SetFromTo(fromPage int, toPage int) {
|
|
|
|
C.QAbstractPrintDialog_SetFromTo(this.h, (C.int)(fromPage), (C.int)(toPage))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) FromPage() int {
|
|
|
|
return (int)(C.QAbstractPrintDialog_FromPage(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) ToPage() int {
|
|
|
|
return (int)(C.QAbstractPrintDialog_ToPage(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractPrintDialog) Printer() *QPrinter {
|
|
|
|
return UnsafeNewQPrinter(unsafe.Pointer(C.QAbstractPrintDialog_Printer(this.h)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func QAbstractPrintDialog_Tr2(s string, c string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QAbstractPrintDialog_Tr2(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-10-16 05:08:07 +00:00
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func QAbstractPrintDialog_Tr3(s string, c string, n int) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QAbstractPrintDialog_Tr3(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-10-16 05:08:07 +00:00
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func QAbstractPrintDialog_TrUtf82(s string, c string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QAbstractPrintDialog_TrUtf82(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-10-16 05:08:07 +00:00
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func QAbstractPrintDialog_TrUtf83(s string, c string, n int) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QAbstractPrintDialog_TrUtf83(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-10-16 05:08:07 +00:00
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
// Delete this object from C++ memory.
|
|
|
|
func (this *QAbstractPrintDialog) Delete() {
|
|
|
|
C.QAbstractPrintDialog_Delete(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
|
|
|
|
// from C++ memory once it is unreachable from Go memory.
|
|
|
|
func (this *QAbstractPrintDialog) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QAbstractPrintDialog) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|