Mercurial > projects > dstep
comparison dstep/appkit/NSPrintPanel.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.NSPrintPanel; | |
8 | |
9 import dstep.appkit.AppKitDefines; | |
10 import dstep.appkit.NSPrintInfo; | |
11 import dstep.appkit.NSView; | |
12 import dstep.appkit.NSViewController; | |
13 import dstep.appkit.NSWindow; | |
14 import dstep.appkit.NSWindowController; | |
15 import dstep.foundation.NSArray; | |
16 import dstep.foundation.NSObjCRuntime; | |
17 import dstep.foundation.NSObject; | |
18 import dstep.foundation.NSString; | |
19 import dstep.foundation.NSSet; | |
20 import dstep.objc.bridge.Bridge; | |
21 import dstep.objc.objc; | |
22 | |
23 import bindings = dstep.appkit.NSPrintPanel_bindings; | |
24 | |
25 typedef NSInteger NSPrintPanelOptions; | |
26 | |
27 private | |
28 { | |
29 NSString NSPrintPhotoJobStyleHint_; | |
30 NSString NSPrintPanelAccessorySummaryItemNameKey_; | |
31 NSString NSPrintPanelAccessorySummaryItemDescriptionKey_; | |
32 } | |
33 | |
34 NSString NSPrintPhotoJobStyleHint () | |
35 { | |
36 if (NSPrintPhotoJobStyleHint_) | |
37 return NSPrintPhotoJobStyleHint_; | |
38 | |
39 return NSPrintPhotoJobStyleHint_ = new NSString(bindings.NSPrintPhotoJobStyleHint); | |
40 } | |
41 | |
42 NSString NSPrintPanelAccessorySummaryItemNameKey () | |
43 { | |
44 if (NSPrintPanelAccessorySummaryItemNameKey_) | |
45 return NSPrintPanelAccessorySummaryItemNameKey_; | |
46 | |
47 return NSPrintPanelAccessorySummaryItemNameKey_ = new NSString(bindings.NSPrintPanelAccessorySummaryItemNameKey); | |
48 } | |
49 | |
50 NSString NSPrintPanelAccessorySummaryItemDescriptionKey () | |
51 { | |
52 if (NSPrintPanelAccessorySummaryItemDescriptionKey_) | |
53 return NSPrintPanelAccessorySummaryItemDescriptionKey_; | |
54 | |
55 return NSPrintPanelAccessorySummaryItemDescriptionKey_ = new NSString(bindings.NSPrintPanelAccessorySummaryItemDescriptionKey); | |
56 } | |
57 | |
58 enum : NSInteger | |
59 { | |
60 NSPrintPanelShowsCopies = 0x01, | |
61 NSPrintPanelShowsPageRange = 0x02, | |
62 NSPrintPanelShowsPaperSize = 0x04, | |
63 NSPrintPanelShowsOrientation = 0x08, | |
64 NSPrintPanelShowsScaling = 0x10, | |
65 NSPrintPanelShowsPageSetupAccessory = 0x100, | |
66 NSPrintPanelShowsPreview = 0x20000 | |
67 } | |
68 | |
69 class NSPrintPanel : NSObject | |
70 { | |
71 mixin (ObjcWrap); | |
72 | |
73 static NSPrintPanel printPanel () | |
74 { | |
75 return invokeObjcSelfClass!(NSPrintPanel, "printPanel"); | |
76 } | |
77 | |
78 void addAccessoryController (INSPrintPanelAccessorizing accessoryController) | |
79 { | |
80 return invokeObjcSelf!(void, "addAccessoryController:", INSPrintPanelAccessorizing)(accessoryController); | |
81 } | |
82 | |
83 void removeAccessoryController (INSPrintPanelAccessorizing accessoryController) | |
84 { | |
85 return invokeObjcSelf!(void, "removeAccessoryController:", INSPrintPanelAccessorizing)(accessoryController); | |
86 } | |
87 | |
88 NSArray accessoryControllers () | |
89 { | |
90 return invokeObjcSelf!(NSArray, "accessoryControllers"); | |
91 } | |
92 | |
93 void setOptions (int options) | |
94 { | |
95 return invokeObjcSelf!(void, "setOptions:", int)(options); | |
96 } | |
97 | |
98 int options () | |
99 { | |
100 return invokeObjcSelf!(int, "options"); | |
101 } | |
102 | |
103 void setDefaultButtonTitle (NSString defaultButtonTitle) | |
104 { | |
105 return invokeObjcSelf!(void, "setDefaultButtonTitle:", NSString)(defaultButtonTitle); | |
106 } | |
107 | |
108 NSString defaultButtonTitle () | |
109 { | |
110 return invokeObjcSelf!(NSString, "defaultButtonTitle"); | |
111 } | |
112 | |
113 void setHelpAnchor (NSString helpAnchor) | |
114 { | |
115 return invokeObjcSelf!(void, "setHelpAnchor:", NSString)(helpAnchor); | |
116 } | |
117 | |
118 NSString helpAnchor () | |
119 { | |
120 return invokeObjcSelf!(NSString, "helpAnchor"); | |
121 } | |
122 | |
123 void setJobStyleHint (NSString hint) | |
124 { | |
125 return invokeObjcSelf!(void, "setJobStyleHint:", NSString)(hint); | |
126 } | |
127 | |
128 NSString jobStyleHint () | |
129 { | |
130 return invokeObjcSelf!(NSString, "jobStyleHint"); | |
131 } | |
132 | |
133 void beginSheetWithPrintInfo (NSPrintInfo printInfo, NSWindow docWindow, Object delegate_, SEL didEndSelector, void* contextInfo) | |
134 { | |
135 return invokeObjcSelf!(void, "beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:", NSPrintInfo, NSWindow, Object, SEL, void*)(printInfo, docWindow, delegate_, didEndSelector, contextInfo); | |
136 } | |
137 | |
138 NSInteger runModalWithPrintInfo (NSPrintInfo printInfo) | |
139 { | |
140 return invokeObjcSelf!(NSInteger, "runModalWithPrintInfo:", NSPrintInfo)(printInfo); | |
141 } | |
142 | |
143 NSInteger runModal () | |
144 { | |
145 return invokeObjcSelf!(NSInteger, "runModal"); | |
146 } | |
147 | |
148 NSPrintInfo printInfo () | |
149 { | |
150 return invokeObjcSelf!(NSPrintInfo, "printInfo"); | |
151 } | |
152 } | |
153 | |
154 interface INSPrintPanelAccessorizing | |
155 { | |
156 NSArray localizedSummaryItems (); | |
157 NSSet keyPathsForValuesAffectingPreview (); | |
158 } | |
159 |