xlang v5.1 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,
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 public void setPrinterName(String printerName){
79 QtXnl.widget_slot_string(nativehandle, Constant.QPrinter_setPrinterName, printerName);
80 }
81
82 protected void setNeedDelloc(bool bd){
83 need_delloc = bd;
84 }
85
86 protected bool isNeedDelloc(){
87 return need_delloc;
88 }
89
90 public int devType() override {
91 return QtXnl.widget_get_int_value(nativehandle, Constant.PAINTERTYPE);
92 }
93
94 public bool newPage() {
95 return QtXnl.widget_get_int_value(nativehandle, Constant.PAINTERNEWPAGE) != 0;
96 }
97
98 public void setOutputFormat(OutputFormat format){
99 QtXnl.widget_set_vint_value(nativehandle, Constant.PRINTERSETOUTFMT, format);
100 }
101
102 public void setPageSize(PageSize pagesize){
103 QtXnl.widget_set_vint_value(nativehandle, Constant.PRINTERSETPAGESIZE, pagesize);
104 }
105
106 public void setFullPage(bool bf){
108 }
109
110 public OutputFormat outputFormat() {
111 return (OutputFormat)QtXnl.widget_get_int_value(nativehandle, Constant.PRINTERGETOUTFMT);
112 }
113
114 public bool setPageMargins(double l, double t, double r, double b){
115 QtXnl.native_double4(l, t, r, b, nativehandle, Constant.PRINTER_SETPAGEMARGINS);
116 return true;
117 }
118
119 public bool setPageOrientation(Orientation orientation){
120 return QtXnl.widget_get_int_bool(nativehandle, Constant.PRINTER_SETPAGEORIENTATION, orientation);
121 }
122
123 public int resolution(){
124 return QtXnl.widget_get_int_value(nativehandle, Constant.PAINTER_resolution);
125 }
126
127 public bool setResolution(int reso){
128 return QtXnl.widget_get_int_bool(nativehandle, Constant.PRINTER_setResolution, reso);
129 }
130
131 public void finalize(){
132 if (need_delloc){
133 QtXnl.widget_slot(nativehandle, Constant.PRINTERDTOR);
134 }
135 }
136 };
137};
Definition Error.x:5
static const int QPRINTER_SETFULLPAGE
Definition Constant.x:1513
int devType() override
Definition QPrinter.xcsm:90
bool setResolution(int reso)
void finalize()
void setFullPage(bool bf)
OutputFormat outputFormat()
void setPageSize(PageSize pagesize)
void setOutputFormat(OutputFormat format)
Definition QPrinter.xcsm:98
bool newPage()
Definition QPrinter.xcsm:94
bool isNeedDelloc()
Definition QPrinter.xcsm:86
bool setPageMargins(double l, double t, double r, double b)
bool setPageOrientation(Orientation orientation)
void setNeedDelloc(bool bd)
Definition QPrinter.xcsm:82
QPrinter(long handle)
Definition QPrinter.xcsm:66
int resolution()
QPrinter(PrinterMode mode)
Definition QPrinter.xcsm:71
void setPrinterName(String printerName)
Definition QPrinter.xcsm:78
void cdecl widget_set_bool_value(long h, int proid, bool v)
Definition String.x:5
Definition QCefQuery.x:3