Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSPrintInfo.d @ 0:380af2bdd8e5
Upload of whole dwt tree
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sat, 09 Aug 2008 17:00:02 +0200 |
parents | |
children | 8b48be5454ce |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:380af2bdd8e5 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2007 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * | |
11 * Port to the D Programming language: | |
12 * Jacob Carlborg <jacob.carlborg@gmail.com> | |
13 *******************************************************************************/ | |
14 module dwt.internal.cocoa.NSPrintInfo; | |
15 | |
16 import dwt.internal.cocoa.CGFloat; | |
17 import dwt.internal.cocoa.id; | |
18 import dwt.internal.cocoa.NSDictionary; | |
19 import dwt.internal.cocoa.NSMutableDictionary; | |
20 import dwt.internal.cocoa.NSObject; | |
21 import dwt.internal.cocoa.NSPrinter; | |
22 import dwt.internal.cocoa.NSRect; | |
23 import dwt.internal.cocoa.NSSize; | |
24 import dwt.internal.cocoa.NSString; | |
25 import dwt.internal.cocoa.OS; | |
26 import objc = dwt.internal.objc.runtime; | |
27 | |
28 enum NSPrintingPaginationMod | |
29 { | |
30 NSAutoPagination = 0, | |
31 NSFitPagination = 1, | |
32 NSClipPagination = 2 | |
33 } | |
34 | |
35 alias NSPrintingPaginationMod.NSAutoPagination NSAutoPagination; | |
36 alias NSPrintingPaginationMod.NSFitPagination NSFitPagination; | |
37 alias NSPrintingPaginationMod.NSClipPagination NSClipPagination; | |
38 | |
39 enum NSPrintingOrientation | |
40 { | |
41 NSPortraitOrientation = 0, | |
42 NSLandscapeOrientation = 1 | |
43 } | |
44 | |
45 alias NSPrintingOrientation.NSPortraitOrientation NSPortraitOrientation; | |
46 alias NSPrintingOrientation.NSLandscapeOrientation NSLandscapeOrientation; | |
47 | |
48 enum NSPrintingPaginationMode | |
49 { | |
50 NSAutoPagination = 0, | |
51 NSFitPagination = 1, | |
52 NSClipPagination = 2 | |
53 } | |
54 | |
55 alias NSPrintingPaginationMode.NSAutoPagination NSAutoPagination; | |
56 alias NSPrintingPaginationMode.NSFitPagination NSFitPagination; | |
57 alias NSPrintingPaginationMode.NSClipPagination NSClipPagination; | |
58 | |
59 public class NSPrintInfo : NSObject | |
60 { | |
61 | |
62 public this () | |
63 { | |
64 super(); | |
65 } | |
66 | |
67 public this (objc.id id) | |
68 { | |
69 super(id); | |
70 } | |
71 | |
72 public void* PMPageFormat () | |
73 { | |
74 return cast(void*) OS.objc_msgSend(this.id, OS.sel_PMPageFormat); | |
75 } | |
76 | |
77 public void* PMPrintSession () | |
78 { | |
79 return cast(void*) OS.objc_msgSend(this.id, OS.sel_PMPrintSession); | |
80 } | |
81 | |
82 public void* PMPrintSettings () | |
83 { | |
84 return cast(void*) OS.objc_msgSend(this.id, OS.sel_PMPrintSettings); | |
85 } | |
86 | |
87 public CGFloat bottomMargin () | |
88 { | |
89 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_bottomMargin); | |
90 } | |
91 | |
92 public static NSPrinter defaultPrinter () | |
93 { | |
94 objc.id result = OS.objc_msgSend(OS.class_NSPrintInfo, OS.sel_defaultPrinter); | |
95 return result !is null ? new NSPrinter(result) : null; | |
96 } | |
97 | |
98 public NSMutableDictionary dictionary () | |
99 { | |
100 objc.id result = OS.objc_msgSend(this.id, OS.sel_dictionary); | |
101 return result !is null ? new NSMutableDictionary(result) : null; | |
102 } | |
103 | |
104 public NSPrintingPaginationMode horizontalPagination () | |
105 { | |
106 return OS.objc_msgSend(this.id, OS.sel_horizontalPagination); | |
107 } | |
108 | |
109 public NSRect imageablePageBounds () | |
110 { | |
111 NSRect result; | |
112 OS.objc_msgSend_stret(result, this.id, OS.sel_imageablePageBounds); | |
113 return result; | |
114 } | |
115 | |
116 public id initWithDictionary (NSDictionary attributes) | |
117 { | |
118 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithDictionary_1, attributes !is null ? attributes.id : null); | |
119 return result !is null ? new id(result) : null; | |
120 } | |
121 | |
122 public bool isHorizontallyCentered () | |
123 { | |
124 return OS.objc_msgSend(this.id, OS.sel_isHorizontallyCentered) !is null; | |
125 } | |
126 | |
127 public bool isVerticallyCentered () | |
128 { | |
129 return OS.objc_msgSend(this.id, OS.sel_isVerticallyCentered) !is null; | |
130 } | |
131 | |
132 public NSString jobDisposition () | |
133 { | |
134 objc.id result = OS.objc_msgSend(this.id, OS.sel_jobDisposition); | |
135 return result !is null ? new NSString(result) : null; | |
136 } | |
137 | |
138 public CGFloat leftMargin () | |
139 { | |
140 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_leftMargin); | |
141 } | |
142 | |
143 public NSString localizedPaperName () | |
144 { | |
145 objc.id result = OS.objc_msgSend(this.id, OS.sel_localizedPaperName); | |
146 return result !is null ? new NSString(result) : null; | |
147 } | |
148 | |
149 public NSPrintingOrientation orientation () | |
150 { | |
151 return cast(NSPrintingOrientation) OS.objc_msgSend(this.id, OS.sel_orientation); | |
152 } | |
153 | |
154 public NSString paperName () | |
155 { | |
156 objc.id result = OS.objc_msgSend(this.id, OS.sel_paperName); | |
157 return result !is null ? new NSString(result) : null; | |
158 } | |
159 | |
160 public NSSize paperSize () | |
161 { | |
162 NSSize result; | |
163 OS.objc_msgSend_stret(result, this.id, OS.sel_paperSize); | |
164 return result; | |
165 } | |
166 | |
167 public NSMutableDictionary printSettings () | |
168 { | |
169 objc.id result = OS.objc_msgSend(this.id, OS.sel_printSettings); | |
170 return result !is null ? new NSMutableDictionary(result) : null; | |
171 } | |
172 | |
173 public NSPrinter printer () | |
174 { | |
175 objc.id result = OS.objc_msgSend(this.id, OS.sel_printer); | |
176 return result !is null ? new NSPrinter(result) : null; | |
177 } | |
178 | |
179 public CGFloat rightMargin () | |
180 { | |
181 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_rightMargin); | |
182 } | |
183 | |
184 public void setBottomMargin (CGFloat margin) | |
185 { | |
186 OS.objc_msgSend(this.id, OS.sel_setBottomMargin_1, margin); | |
187 } | |
188 | |
189 public static void setDefaultPrinter (NSPrinter printer) | |
190 { | |
191 OS.objc_msgSend(OS.class_NSPrintInfo, OS.sel_setDefaultPrinter_1, printer !is null ? printer.id : null); | |
192 } | |
193 | |
194 public void setHorizontalPagination (NSPrintingPaginationMode mode) | |
195 { | |
196 OS.objc_msgSend(this.id, OS.sel_setHorizontalPagination_1, mode); | |
197 } | |
198 | |
199 public void setHorizontallyCentered (bool flag) | |
200 { | |
201 OS.objc_msgSend(this.id, OS.sel_setHorizontallyCentered_1, flag); | |
202 } | |
203 | |
204 public void setJobDisposition (NSString disposition) | |
205 { | |
206 OS.objc_msgSend(this.id, OS.sel_setJobDisposition_1, disposition !is null ? disposition.id : null); | |
207 } | |
208 | |
209 public void setLeftMargin (CGFloat margin) | |
210 { | |
211 OS.objc_msgSend(this.id, OS.sel_setLeftMargin_1, margin); | |
212 } | |
213 | |
214 public void setOrientation (NSPrintingOrientation orientation) | |
215 { | |
216 OS.objc_msgSend(this.id, OS.sel_setOrientation_1, orientation); | |
217 } | |
218 | |
219 public void setPaperName (NSString name) | |
220 { | |
221 OS.objc_msgSend(this.id, OS.sel_setPaperName_1, name !is null ? name.id : null); | |
222 } | |
223 | |
224 public void setPaperSize (NSSize size) | |
225 { | |
226 OS.objc_msgSend(this.id, OS.sel_setPaperSize_1, size); | |
227 } | |
228 | |
229 public void setPrinter (NSPrinter printer) | |
230 { | |
231 OS.objc_msgSend(this.id, OS.sel_setPrinter_1, printer !is null ? printer.id : null); | |
232 } | |
233 | |
234 public void setRightMargin (CGFloat margin) | |
235 { | |
236 OS.objc_msgSend(this.id, OS.sel_setRightMargin_1, margin); | |
237 } | |
238 | |
239 public static void setSharedPrintInfo (NSPrintInfo printInfo) | |
240 { | |
241 OS.objc_msgSend(OS.class_NSPrintInfo, OS.sel_setSharedPrintInfo_1, printInfo !is null ? printInfo.id : null); | |
242 } | |
243 | |
244 public void setTopMargin (CGFloat margin) | |
245 { | |
246 OS.objc_msgSend(this.id, OS.sel_setTopMargin_1, margin); | |
247 } | |
248 | |
249 public void setUpPrintOperationDefaultValues () | |
250 { | |
251 OS.objc_msgSend(this.id, OS.sel_setUpPrintOperationDefaultValues); | |
252 } | |
253 | |
254 public void setVerticalPagination (NSPrintingPaginationMode mode) | |
255 { | |
256 OS.objc_msgSend(this.id, OS.sel_setVerticalPagination_1, mode); | |
257 } | |
258 | |
259 public void setVerticallyCentered (bool flag) | |
260 { | |
261 OS.objc_msgSend(this.id, OS.sel_setVerticallyCentered_1, flag); | |
262 } | |
263 | |
264 public static NSPrintInfo sharedPrintInfo () | |
265 { | |
266 objc.id result = OS.objc_msgSend(OS.class_NSPrintInfo, OS.sel_sharedPrintInfo); | |
267 return result !is null ? new NSPrintInfo(result) : null; | |
268 } | |
269 | |
270 public static NSSize sizeForPaperName (NSString name) | |
271 { | |
272 NSSize result; | |
273 OS.objc_msgSend_stret(result, OS.class_NSPrintInfo, OS.sel_sizeForPaperName_1, name !is null ? name.id : null); | |
274 return result; | |
275 } | |
276 | |
277 public CGFloat topMargin () | |
278 { | |
279 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_topMargin); | |
280 } | |
281 | |
282 public void updateFromPMPageFormat () | |
283 { | |
284 OS.objc_msgSend(this.id, OS.sel_updateFromPMPageFormat); | |
285 } | |
286 | |
287 public void updateFromPMPrintSettings () | |
288 { | |
289 OS.objc_msgSend(this.id, OS.sel_updateFromPMPrintSettings); | |
290 } | |
291 | |
292 public NSPrintingPaginationMode verticalPagination () | |
293 { | |
294 return cast(NSPrintingPaginationMode) OS.objc_msgSend(this.id, OS.sel_verticalPagination); | |
295 } | |
296 | |
297 } |