xlang v4.0 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
QPrinter.xcsm
浏览该文件的文档.
1//xlang Source, Name:QPrinter.xcsm
2//Date: Sat Aug 13:36:30 2019
3package Qt{
4 @SuppressWarnings public class QPrinter : QPagedPaintDevice{
5
6 private bool need_delloc = true;
7 public enum PrinterMode { ScreenResolution, PrinterResolution, HighResolution };
8 public enum Orientation { Portrait, Landscape };
9 public enum PageOrder { FirstPageFirst,
10 LastPageFirst };
11
12 public enum ColorMode { GrayScale,
13 Color };
14
15 public enum PaperSource { OnlyOne,
28 MaxPageSource, // Deprecated
29 CustomSource
30 };
31
32 public enum PrinterState { Idle,
35 Error };
36
37 public enum OutputFormat { NativeFormat, PdfFormat };
38
39 // Keep in sync with QAbstractPrintDialog::PrintRange
40 public enum PrintRange { AllPages, Selection, PageRange, CurrentPage };
41
42 public enum Unit {
49 DevicePixel
50 };
51
52 public enum DuplexMode {
53 DuplexNone = 0,
56 DuplexShortSide
57 };
58
60 nativehandle = QtXnl.createQPObject(QType.qtPrinter, this, 0, PrinterMode.ScreenResolution, 0, 0, 0);
61 if (nativehandle == 0) {
62 throw new IllegalArgumentException("can't new Object");
63 }
64 }
65
66 public QPrinter(long handle){
67 need_delloc = false;
68 nativehandle = handle;
69 }
70
71 public QPrinter(PrinterMode mode) throws IllegalArgumentException{
72 nativehandle = QtXnl.createQPObject(QType.qtPrinter, this, 0, mode, 0, 0, 0);
73 if (nativehandle == 0) {
74 throw new IllegalArgumentException("can't new Object");
75 }
76 }
77
78 protected void setNeedDelloc(bool bd){
79 need_delloc = bd;
80 }
81
82 protected bool isNeedDelloc(){
83 return need_delloc;
84 }
85
86 public int devType() override {
87 return QtXnl.widget_get_int_value(nativehandle, Constant.PAINTERTYPE);
88 }
89
90 public bool newPage() {
91 return QtXnl.widget_get_int_value(nativehandle, Constant.PAINTERNEWPAGE) != 0;
92 }
93
94 public void setOutputFormat(OutputFormat format){
95 QtXnl.widget_set_vint_value(nativehandle, Constant.PRINTERSETOUTFMT, format);
96 }
97
98 public void setPageSize(PageSize pagesize){
99 QtXnl.widget_set_vint_value(nativehandle, Constant.PRINTERSETPAGESIZE, pagesize);
100 }
101
102 public OutputFormat outputFormat() {
103 return (OutputFormat)QtXnl.widget_get_int_value(nativehandle, Constant.PRINTERGETOUTFMT);
104 }
105
106 public bool setPageMargins(double l, double t, double r, double b){
107 QtXnl.native_double4(l, t, r, b, nativehandle, Constant.PRINTER_SETPAGEMARGINS);
108 return true;
109 }
110
111 public bool setPageOrientation(Orientation orientation){
112 return QtXnl.widget_get_int_bool(nativehandle, Constant.PRINTER_SETPAGEORIENTATION, orientation);
113 }
114
115 public void finalize(){
116 if (need_delloc){
117 QtXnl.widget_slot(nativehandle, Constant.PRINTERDTOR);
118 }
119 }
120 };
121};
int devType() override
Definition QPrinter.xcsm:86
void finalize()
OutputFormat outputFormat()
void setPageSize(PageSize pagesize)
Definition QPrinter.xcsm:98
void setOutputFormat(OutputFormat format)
Definition QPrinter.xcsm:94
bool newPage()
Definition QPrinter.xcsm:90
bool isNeedDelloc()
Definition QPrinter.xcsm:82
bool setPageMargins(double l, double t, double r, double b)
bool setPageOrientation(Orientation orientation)
void setNeedDelloc(bool bd)
Definition QPrinter.xcsm:78
QPrinter(long handle)
Definition QPrinter.xcsm:66
QPrinter(PrinterMode mode)
Definition QPrinter.xcsm:71