Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSPrintOperation.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.NSPrintOperation; | |
15 | |
16 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSGraphicsContext; | |
18 import dwt.internal.cocoa.NSInteger; | |
19 import dwt.internal.cocoa.NSMutableData; | |
20 import dwt.internal.cocoa.NSObject; | |
21 import dwt.internal.cocoa.NSPrintInfo; | |
22 import dwt.internal.cocoa.NSPrintPanel; | |
23 import dwt.internal.cocoa.NSRange; | |
24 import dwt.internal.cocoa.NSRect; | |
25 import dwt.internal.cocoa.NSString; | |
26 import dwt.internal.cocoa.NSView; | |
27 import dwt.internal.cocoa.NSWindow; | |
28 import dwt.internal.cocoa.OS; | |
29 import objc = dwt.internal.objc.runtime; | |
30 | |
31 enum NSPrintingPageOrder | |
32 { | |
33 NSDescendingPageOrder = (-1), | |
34 NSSpecialPageOrder = 0, | |
35 NSAscendingPageOrder = 1, | |
36 NSUnknownPageOrder = 2 | |
37 } | |
38 | |
39 alias NSPrintingPageOrder.NSDescendingPageOrder NSDescendingPageOrder; | |
40 alias NSPrintingPageOrder.NSSpecialPageOrder NSSpecialPageOrder; | |
41 alias NSPrintingPageOrder.NSAscendingPageOrder NSAscendingPageOrder; | |
42 alias NSPrintingPageOrder.NSUnknownPageOrder NSUnknownPageOrder; | |
43 | |
44 public class NSPrintOperation : NSObject | |
45 { | |
46 | |
47 public this () | |
48 { | |
49 super(); | |
50 } | |
51 | |
52 public this (objc.id id) | |
53 { | |
54 super(id); | |
55 } | |
56 | |
57 public static NSPrintOperation static_EPSOperationWithView_insideRect_toData_ (NSView view, NSRect rect, NSMutableData data) | |
58 { | |
59 objc.id result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_EPSOperationWithView_1insideRect_1toData_1, | |
60 view !is null ? view.id : null, rect, data !is null ? data.id : null); | |
61 return result !is null ? new NSPrintOperation(result) : null; | |
62 } | |
63 | |
64 public static NSPrintOperation static_EPSOperationWithView_insideRect_toData_printInfo_ (NSView view, NSRect rect, NSMutableData data, | |
65 NSPrintInfo printInfo) | |
66 { | |
67 objc.id result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_EPSOperationWithView_1insideRect_1toData_1printInfo_1, | |
68 view !is null ? view.id : null, rect, data !is null ? data.id : null, printInfo !is null ? printInfo.id : null); | |
69 return result !is null ? new NSPrintOperation(result) : null; | |
70 } | |
71 | |
72 public static NSPrintOperation static_EPSOperationWithView_insideRect_toPath_printInfo_ (NSView view, NSRect rect, NSString path, | |
73 NSPrintInfo printInfo) | |
74 { | |
75 objc.id result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_EPSOperationWithView_1insideRect_1toPath_1printInfo_1, | |
76 view !is null ? view.id : null, rect, path !is null ? path.id : null, printInfo !is null ? printInfo.id : null); | |
77 return result !is null ? new NSPrintOperation(result) : null; | |
78 } | |
79 | |
80 public static NSPrintOperation static_PDFOperationWithView_insideRect_toData_ (NSView view, NSRect rect, NSMutableData data) | |
81 { | |
82 objc.id result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_PDFOperationWithView_1insideRect_1toData_1, | |
83 view !is null ? view.id : null, rect, data !is null ? data.id : null); | |
84 return result !is null ? new NSPrintOperation(result) : null; | |
85 } | |
86 | |
87 public static NSPrintOperation static_PDFOperationWithView_insideRect_toData_printInfo_ (NSView view, NSRect rect, NSMutableData data, | |
88 NSPrintInfo printInfo) | |
89 { | |
90 objc.id result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_PDFOperationWithView_1insideRect_1toData_1printInfo_1, | |
91 view !is null ? view.id : null, rect, data !is null ? data.id : null, printInfo !is null ? printInfo.id : null); | |
92 return result !is null ? new NSPrintOperation(result) : null; | |
93 } | |
94 | |
95 public static NSPrintOperation static_PDFOperationWithView_insideRect_toPath_printInfo_ (NSView view, NSRect rect, NSString path, | |
96 NSPrintInfo printInfo) | |
97 { | |
98 objc.id result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_PDFOperationWithView_1insideRect_1toPath_1printInfo_1, | |
99 view !is null ? view.id : null, rect, path !is null ? path.id : null, printInfo !is null ? printInfo.id : null); | |
100 return result !is null ? new NSPrintOperation(result) : null; | |
101 } | |
102 | |
103 public NSView accessoryView () | |
104 { | |
105 objc.id result = OS.objc_msgSend(this.id, OS.sel_accessoryView); | |
106 return result !is null ? new NSView(result) : null; | |
107 } | |
108 | |
109 public bool canSpawnSeparateThread () | |
110 { | |
111 return OS.objc_msgSend(this.id, OS.sel_canSpawnSeparateThread) !is null; | |
112 } | |
113 | |
114 public void cleanUpOperation () | |
115 { | |
116 OS.objc_msgSend(this.id, OS.sel_cleanUpOperation); | |
117 } | |
118 | |
119 public NSGraphicsContext context () | |
120 { | |
121 objc.id result = OS.objc_msgSend(this.id, OS.sel_context); | |
122 return result !is null ? new NSGraphicsContext(result) : null; | |
123 } | |
124 | |
125 public NSGraphicsContext createContext () | |
126 { | |
127 objc.id result = OS.objc_msgSend(this.id, OS.sel_createContext); | |
128 return result !is null ? new NSGraphicsContext(result) : null; | |
129 } | |
130 | |
131 public static NSPrintOperation currentOperation () | |
132 { | |
133 objc.id result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_currentOperation); | |
134 return result !is null ? new NSPrintOperation(result) : null; | |
135 } | |
136 | |
137 public NSInteger currentPage () | |
138 { | |
139 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_currentPage); | |
140 } | |
141 | |
142 public bool deliverResult () | |
143 { | |
144 return OS.objc_msgSend(this.id, OS.sel_deliverResult) !is null; | |
145 } | |
146 | |
147 public void destroyContext () | |
148 { | |
149 OS.objc_msgSend(this.id, OS.sel_destroyContext); | |
150 } | |
151 | |
152 public bool isCopyingOperation () | |
153 { | |
154 return OS.objc_msgSend(this.id, OS.sel_isCopyingOperation) !is null; | |
155 } | |
156 | |
157 public NSString jobStyleHint () | |
158 { | |
159 objc.id result = OS.objc_msgSend(this.id, OS.sel_jobStyleHint); | |
160 return result !is null ? new NSString(result) : null; | |
161 } | |
162 | |
163 public NSString jobTitle () | |
164 { | |
165 objc.id result = OS.objc_msgSend(this.id, OS.sel_jobTitle); | |
166 return result !is null ? new NSString(result) : null; | |
167 } | |
168 | |
169 public NSPrintingPageOrder pageOrder () | |
170 { | |
171 return OS.objc_msgSend(this.id, OS.sel_pageOrder); | |
172 } | |
173 | |
174 public NSRange pageRange () | |
175 { | |
176 NSRange result; | |
177 OS.objc_msgSend_stret(result, this.id, OS.sel_pageRange); | |
178 return result; | |
179 } | |
180 | |
181 public NSPrintInfo printInfo () | |
182 { | |
183 objc.id result = OS.objc_msgSend(this.id, OS.sel_printInfo); | |
184 return result !is null ? new NSPrintInfo(result) : null; | |
185 } | |
186 | |
187 public static NSPrintOperation static_printOperationWithView_ (NSView view) | |
188 { | |
189 objc.id result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_printOperationWithView_1, view !is null ? view.id : null); | |
190 return result !is null ? new NSPrintOperation(result) : null; | |
191 } | |
192 | |
193 public static NSPrintOperation static_printOperationWithView_printInfo_ (NSView view, NSPrintInfo printInfo) | |
194 { | |
195 objc.id result = OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_printOperationWithView_1printInfo_1, view !is null ? view.id : null, | |
196 printInfo !is null ? printInfo.id : null); | |
197 return result !is null ? new NSPrintOperation(result) : null; | |
198 } | |
199 | |
200 public NSPrintPanel printPanel () | |
201 { | |
202 objc.id result = OS.objc_msgSend(this.id, OS.sel_printPanel); | |
203 return result !is null ? new NSPrintPanel(result) : null; | |
204 } | |
205 | |
206 public bool runOperation () | |
207 { | |
208 return OS.objc_msgSend(this.id, OS.sel_runOperation) !is null; | |
209 } | |
210 | |
211 public void runOperationModalForWindow (NSWindow docWindow, id delegatee, objc.SEL didRunSelector, void* contextInfo) | |
212 { | |
213 OS.objc_msgSend(this.id, OS.sel_runOperationModalForWindow_1delegate_1didRunSelector_1contextInfo_1, | |
214 docWindow !is null ? docWindow.id : null, delegatee !is null ? delegatee.id : null, didRunSelector, contextInfo); | |
215 } | |
216 | |
217 public void setAccessoryView (NSView view) | |
218 { | |
219 OS.objc_msgSend(this.id, OS.sel_setAccessoryView_1, view !is null ? view.id : null); | |
220 } | |
221 | |
222 public void setCanSpawnSeparateThread (bool canSpawnSeparateThread) | |
223 { | |
224 OS.objc_msgSend(this.id, OS.sel_setCanSpawnSeparateThread_1, canSpawnSeparateThread); | |
225 } | |
226 | |
227 public static void setCurrentOperation (NSPrintOperation operation) | |
228 { | |
229 OS.objc_msgSend(OS.class_NSPrintOperation, OS.sel_setCurrentOperation_1, operation !is null ? operation.id : null); | |
230 } | |
231 | |
232 public void setJobStyleHint (NSString hint) | |
233 { | |
234 OS.objc_msgSend(this.id, OS.sel_setJobStyleHint_1, hint !is null ? hint.id : null); | |
235 } | |
236 | |
237 public void setJobTitle (NSString jobTitle) | |
238 { | |
239 OS.objc_msgSend(this.id, OS.sel_setJobTitle_1, jobTitle !is null ? jobTitle.id : null); | |
240 } | |
241 | |
242 public void setPageOrder (NSPrintingPageOrder pageOrder) | |
243 { | |
244 OS.objc_msgSend(this.id, OS.sel_setPageOrder_1, pageOrder); | |
245 } | |
246 | |
247 public void setPrintInfo (NSPrintInfo printInfo) | |
248 { | |
249 OS.objc_msgSend(this.id, OS.sel_setPrintInfo_1, printInfo !is null ? printInfo.id : null); | |
250 } | |
251 | |
252 public void setPrintPanel (NSPrintPanel panel) | |
253 { | |
254 OS.objc_msgSend(this.id, OS.sel_setPrintPanel_1, panel !is null ? panel.id : null); | |
255 } | |
256 | |
257 public void setShowPanels (bool flag) | |
258 { | |
259 OS.objc_msgSend(this.id, OS.sel_setShowPanels_1, flag); | |
260 } | |
261 | |
262 public void setShowsPrintPanel (bool flag) | |
263 { | |
264 OS.objc_msgSend(this.id, OS.sel_setShowsPrintPanel_1, flag); | |
265 } | |
266 | |
267 public void setShowsProgressPanel (bool flag) | |
268 { | |
269 OS.objc_msgSend(this.id, OS.sel_setShowsProgressPanel_1, flag); | |
270 } | |
271 | |
272 public bool showPanels () | |
273 { | |
274 return OS.objc_msgSend(this.id, OS.sel_showPanels) !is null; | |
275 } | |
276 | |
277 public bool showsPrintPanel () | |
278 { | |
279 return OS.objc_msgSend(this.id, OS.sel_showsPrintPanel) !is null; | |
280 } | |
281 | |
282 public bool showsProgressPanel () | |
283 { | |
284 return OS.objc_msgSend(this.id, OS.sel_showsProgressPanel) !is null; | |
285 } | |
286 | |
287 public NSView view () | |
288 { | |
289 objc.id result = OS.objc_msgSend(this.id, OS.sel_view); | |
290 return result !is null ? new NSView(result) : null; | |
291 } | |
292 | |
293 } |