comparison dstep/appkit/NSPrintOperation.d @ 16:19885b43130e

Huge update, the bridge actually works now
author Jacob Carlborg <doob@me.com>
date Sun, 03 Jan 2010 22:06:11 +0100
parents
children b9de51448c6b
comparison
equal deleted inserted replaced
15:7ff919f595d5 16:19885b43130e
1 /**
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
3 * Authors: Jacob Carlborg
4 * Version: Initial created: Sep 24, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */
7 module dstep.appkit.NSPrintOperation;
8
9 import dstep.appkit.AppKitDefines;
10 import dstep.appkit.NSGraphicsContext;
11 import dstep.appkit.NSPrintInfo;
12 import dstep.appkit.NSPrintPanel;
13 import dstep.appkit.NSView;
14 import dstep.appkit.NSWindow;
15 import dstep.foundation.NSData;
16 import dstep.foundation.NSGeometry;
17 import dstep.foundation.NSObjCRuntime;
18 import dstep.foundation.NSObject;
19 import dstep.foundation.NSString;
20 import dstep.foundation.NSRange;
21 import dstep.objc.bridge.Bridge;
22 import dstep.objc.objc;
23
24 import bindings = dstep.appkit.NSPrintOperation_bindings;
25
26 alias NSInteger NSPrintingPageOrder;
27
28 private
29 {
30 NSString NSPrintOperationExistsException_;
31 }
32
33 NSString NSPrintOperationExistsException ()
34 {
35 if (NSPrintOperationExistsException_)
36 return NSPrintOperationExistsException_;
37
38 return NSPrintOperationExistsException_ = new NSString(bindings.NSPrintOperationExistsException);
39 }
40
41 enum
42 {
43 NSDescendingPageOrder = -1,
44 NSSpecialPageOrder = 0,
45 NSAscendingPageOrder = 1,
46 NSUnknownPageOrder = 2
47 }
48
49 class NSPrintOperation : NSObject
50 {
51 mixin (ObjcWrap);
52
53 static NSPrintOperation printOperationWithView (NSView view, NSPrintInfo printInfo)
54 {
55 return invokeObjcSelfClass!(NSPrintOperation, "printOperationWithView:printInfo:", NSView, NSPrintInfo)(view, printInfo);
56 }
57
58 static NSPrintOperation PDFOperationWithView (NSView view, NSRect rect, NSMutableData data, NSPrintInfo printInfo)
59 {
60 return invokeObjcSelfClass!(NSPrintOperation, "PDFOperationWithView:insideRect:toData:printInfo:", NSView, NSRect, NSMutableData, NSPrintInfo)(view, rect, data, printInfo);
61 }
62
63 static NSPrintOperation PDFOperationWithView (NSView view, NSRect rect, NSString path, NSPrintInfo printInfo)
64 {
65 return invokeObjcSelfClass!(NSPrintOperation, "PDFOperationWithView:insideRect:toPath:printInfo:", NSView, NSRect, NSString, NSPrintInfo)(view, rect, path, printInfo);
66 }
67
68 static NSPrintOperation EPSOperationWithView (NSView view, NSRect rect, NSMutableData data, NSPrintInfo printInfo)
69 {
70 return invokeObjcSelfClass!(NSPrintOperation, "EPSOperationWithView:insideRect:toData:printInfo:", NSView, NSRect, NSMutableData, NSPrintInfo)(view, rect, data, printInfo);
71 }
72
73 static NSPrintOperation EPSOperationWithView (NSView view, NSRect rect, NSString path, NSPrintInfo printInfo)
74 {
75 return invokeObjcSelfClass!(NSPrintOperation, "EPSOperationWithView:insideRect:toPath:printInfo:", NSView, NSRect, NSString, NSPrintInfo)(view, rect, path, printInfo);
76 }
77
78 static NSPrintOperation printOperationWithView (NSView view)
79 {
80 return invokeObjcSelfClass!(NSPrintOperation, "printOperationWithView:", NSView)(view);
81 }
82
83 static NSPrintOperation PDFOperationWithView (NSView view, NSRect rect, NSMutableData data)
84 {
85 return invokeObjcSelfClass!(NSPrintOperation, "PDFOperationWithView:insideRect:toData:", NSView, NSRect, NSMutableData)(view, rect, data);
86 }
87
88 static NSPrintOperation EPSOperationWithView (NSView view, NSRect rect, NSMutableData data)
89 {
90 return invokeObjcSelfClass!(NSPrintOperation, "EPSOperationWithView:insideRect:toData:", NSView, NSRect, NSMutableData)(view, rect, data);
91 }
92
93 static NSPrintOperation currentOperation ()
94 {
95 return invokeObjcSelfClass!(NSPrintOperation, "currentOperation");
96 }
97
98 static void setCurrentOperation (NSPrintOperation operation)
99 {
100 return invokeObjcSelfClass!(void, "setCurrentOperation:", NSPrintOperation)(operation);
101 }
102
103 bool isCopyingOperation ()
104 {
105 return invokeObjcSelf!(bool, "isCopyingOperation");
106 }
107
108 void setJobTitle (NSString jobTitle)
109 {
110 return invokeObjcSelf!(void, "setJobTitle:", NSString)(jobTitle);
111 }
112
113 NSString jobTitle ()
114 {
115 return invokeObjcSelf!(NSString, "jobTitle");
116 }
117
118 void setShowsPrintPanel (bool flag)
119 {
120 return invokeObjcSelf!(void, "setShowsPrintPanel:", bool)(flag);
121 }
122
123 bool showsPrintPanel ()
124 {
125 return invokeObjcSelf!(bool, "showsPrintPanel");
126 }
127
128 void setShowsProgressPanel (bool flag)
129 {
130 return invokeObjcSelf!(void, "setShowsProgressPanel:", bool)(flag);
131 }
132
133 bool showsProgressPanel ()
134 {
135 return invokeObjcSelf!(bool, "showsProgressPanel");
136 }
137
138 void setPrintPanel (NSPrintPanel panel)
139 {
140 return invokeObjcSelf!(void, "setPrintPanel:", NSPrintPanel)(panel);
141 }
142
143 NSPrintPanel printPanel ()
144 {
145 return invokeObjcSelf!(NSPrintPanel, "printPanel");
146 }
147
148 void setCanSpawnSeparateThread (bool canSpawnSeparateThread)
149 {
150 return invokeObjcSelf!(void, "setCanSpawnSeparateThread:", bool)(canSpawnSeparateThread);
151 }
152
153 bool canSpawnSeparateThread ()
154 {
155 return invokeObjcSelf!(bool, "canSpawnSeparateThread");
156 }
157
158 void setPageOrder (int pageOrder)
159 {
160 return invokeObjcSelf!(void, "setPageOrder:", int)(pageOrder);
161 }
162
163 int pageOrder ()
164 {
165 return invokeObjcSelf!(int, "pageOrder");
166 }
167
168 void runOperationModalForWindow (NSWindow docWindow, Object delegate_, SEL didRunSelector, void* contextInfo)
169 {
170 return invokeObjcSelf!(void, "runOperationModalForWindow:delegate:didRunSelector:contextInfo:", NSWindow, Object, SEL, void*)(docWindow, delegate_, didRunSelector, contextInfo);
171 }
172
173 bool runOperation ()
174 {
175 return invokeObjcSelf!(bool, "runOperation");
176 }
177
178 NSView view ()
179 {
180 return invokeObjcSelf!(NSView, "view");
181 }
182
183 NSPrintInfo printInfo ()
184 {
185 return invokeObjcSelf!(NSPrintInfo, "printInfo");
186 }
187
188 void setPrintInfo (NSPrintInfo printInfo)
189 {
190 return invokeObjcSelf!(void, "setPrintInfo:", NSPrintInfo)(printInfo);
191 }
192
193 NSGraphicsContext context ()
194 {
195 return invokeObjcSelf!(NSGraphicsContext, "context");
196 }
197
198 NSRange pageRange ()
199 {
200 return invokeObjcSelf!(NSRange, "pageRange");
201 }
202
203 NSInteger currentPage ()
204 {
205 return invokeObjcSelf!(NSInteger, "currentPage");
206 }
207
208 NSGraphicsContext createContext ()
209 {
210 return invokeObjcSelf!(NSGraphicsContext, "createContext");
211 }
212
213 void destroyContext ()
214 {
215 return invokeObjcSelf!(void, "destroyContext");
216 }
217
218 bool deliverResult ()
219 {
220 return invokeObjcSelf!(bool, "deliverResult");
221 }
222
223 void cleanUpOperation ()
224 {
225 return invokeObjcSelf!(void, "cleanUpOperation");
226 }
227 }
228