Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSSavePanel.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.NSSavePanel; | |
15 | |
16 import dwt.internal.cocoa.NSArray; | |
17 import dwt.internal.cocoa.NSInteger; | |
18 import dwt.internal.cocoa.NSPanel; | |
19 import dwt.internal.cocoa.NSString; | |
20 import dwt.internal.cocoa.NSURL; | |
21 import dwt.internal.cocoa.NSView; | |
22 import dwt.internal.cocoa.NSWindow; | |
23 import dwt.internal.cocoa.OS; | |
24 import objc = dwt.internal.objc.runtime; | |
25 | |
26 public class NSSavePanel : NSPanel | |
27 { | |
28 | |
29 public this () | |
30 { | |
31 super(); | |
32 } | |
33 | |
34 public this (objc.id id) | |
35 { | |
36 super(id); | |
37 } | |
38 | |
39 public NSURL URL () | |
40 { | |
41 objc.id result = OS.objc_msgSend(this.id, OS.sel_URL); | |
42 return result !is null ? new NSURL(result) : null; | |
43 } | |
44 | |
45 public NSView accessoryView () | |
46 { | |
47 objc.id result = OS.objc_msgSend(this.id, OS.sel_accessoryView); | |
48 return result !is null ? new NSView(result) : null; | |
49 } | |
50 | |
51 public NSArray allowedFileTypes () | |
52 { | |
53 objc.id result = OS.objc_msgSend(this.id, OS.sel_allowedFileTypes); | |
54 return result !is null ? new NSArray(result) : null; | |
55 } | |
56 | |
57 public bool allowsOtherFileTypes () | |
58 { | |
59 return OS.objc_msgSend(this.id, OS.sel_allowsOtherFileTypes) !is null; | |
60 } | |
61 | |
62 public void beginSheetForDirectory (NSString path, NSString name, NSWindow docWindow, id delegatee, objc.SEL didEndSelector, void* contextInfo) | |
63 { | |
64 OS.objc_msgSend(this.id, OS.sel_beginSheetForDirectory_1file_1modalForWindow_1modalDelegate_1didEndSelector_1contextInfo_1, | |
65 path !is null ? path.id : null, name !is null ? name.id : null, docWindow !is null ? docWindow.id : null, | |
66 delegatee !is null ? delegatee.id : null, didEndSelector, contextInfo); | |
67 } | |
68 | |
69 public bool canCreateDirectories () | |
70 { | |
71 return OS.objc_msgSend(this.id, OS.sel_canCreateDirectories) !is null; | |
72 } | |
73 | |
74 public bool canSelectHiddenExtension () | |
75 { | |
76 return OS.objc_msgSend(this.id, OS.sel_canSelectHiddenExtension) !is null; | |
77 } | |
78 | |
79 public void cancel (id sender) | |
80 { | |
81 OS.objc_msgSend(this.id, OS.sel_cancel_1, sender !is null ? sender.id : null); | |
82 } | |
83 | |
84 public id delegatee () | |
85 { | |
86 objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate); | |
87 return result !is null ? new id(result) : null; | |
88 } | |
89 | |
90 public NSString directory () | |
91 { | |
92 objc.id result = OS.objc_msgSend(this.id, OS.sel_directory); | |
93 return result !is null ? new NSString(result) : null; | |
94 } | |
95 | |
96 public NSString filename () | |
97 { | |
98 objc.id result = OS.objc_msgSend(this.id, OS.sel_filename); | |
99 return result !is null ? new NSString(result) : null; | |
100 } | |
101 | |
102 public bool isExpanded () | |
103 { | |
104 return OS.objc_msgSend(this.id, OS.sel_isExpanded) !is null; | |
105 } | |
106 | |
107 public bool isExtensionHidden () | |
108 { | |
109 return OS.objc_msgSend(this.id, OS.sel_isExtensionHidden) !is null; | |
110 } | |
111 | |
112 public NSString message () | |
113 { | |
114 objc.id result = OS.objc_msgSend(this.id, OS.sel_message); | |
115 return result !is null ? new NSString(result) : null; | |
116 } | |
117 | |
118 public NSString nameFieldLabel () | |
119 { | |
120 objc.id result = OS.objc_msgSend(this.id, OS.sel_nameFieldLabel); | |
121 return result !is null ? new NSString(result) : null; | |
122 } | |
123 | |
124 public void ok (id sender) | |
125 { | |
126 OS.objc_msgSend(this.id, OS.sel_ok_1, sender !is null ? sender.id : null); | |
127 } | |
128 | |
129 public NSString prompt () | |
130 { | |
131 objc.id result = OS.objc_msgSend(this.id, OS.sel_prompt); | |
132 return result !is null ? new NSString(result) : null; | |
133 } | |
134 | |
135 public NSString requiredFileType () | |
136 { | |
137 objc.id result = OS.objc_msgSend(this.id, OS.sel_requiredFileType); | |
138 return result !is null ? new NSString(result) : null; | |
139 } | |
140 | |
141 public NSInteger runModal () | |
142 { | |
143 return OS.objc_msgSend(this.id, OS.sel_runModal); | |
144 } | |
145 | |
146 public NSInteger runModalForDirectory (NSString path, NSString name) | |
147 { | |
148 return OS.objc_msgSend(this.id, OS.sel_runModalForDirectory_1file_1, path !is null ? path.id : null, name !is null ? name.id : null); | |
149 } | |
150 | |
151 public static NSSavePanel savePanel () | |
152 { | |
153 objc.id result = OS.objc_msgSend(OS.class_NSSavePanel, OS.sel_savePanel); | |
154 return result !is null ? new NSSavePanel(result) : null; | |
155 } | |
156 | |
157 public void selectText (id sender) | |
158 { | |
159 OS.objc_msgSend(this.id, OS.sel_selectText_1, sender !is null ? sender.id : null); | |
160 } | |
161 | |
162 public void setAccessoryView (NSView view) | |
163 { | |
164 OS.objc_msgSend(this.id, OS.sel_setAccessoryView_1, view !is null ? view.id : null); | |
165 } | |
166 | |
167 public void setAllowedFileTypes (NSArray types) | |
168 { | |
169 OS.objc_msgSend(this.id, OS.sel_setAllowedFileTypes_1, types !is null ? types.id : null); | |
170 } | |
171 | |
172 public void setAllowsOtherFileTypes (bool flag) | |
173 { | |
174 OS.objc_msgSend(this.id, OS.sel_setAllowsOtherFileTypes_1, flag); | |
175 } | |
176 | |
177 public void setCanCreateDirectories (bool flag) | |
178 { | |
179 OS.objc_msgSend(this.id, OS.sel_setCanCreateDirectories_1, flag); | |
180 } | |
181 | |
182 public void setCanSelectHiddenExtension (bool flag) | |
183 { | |
184 OS.objc_msgSend(this.id, OS.sel_setCanSelectHiddenExtension_1, flag); | |
185 } | |
186 | |
187 public void setDelegate (id delegatee) | |
188 { | |
189 OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id : null); | |
190 } | |
191 | |
192 public void setDirectory (NSString path) | |
193 { | |
194 OS.objc_msgSend(this.id, OS.sel_setDirectory_1, path !is null ? path.id : null); | |
195 } | |
196 | |
197 public void setExtensionHidden (bool flag) | |
198 { | |
199 OS.objc_msgSend(this.id, OS.sel_setExtensionHidden_1, flag); | |
200 } | |
201 | |
202 public void setMessage (NSString message) | |
203 { | |
204 OS.objc_msgSend(this.id, OS.sel_setMessage_1, message !is null ? message.id : null); | |
205 } | |
206 | |
207 public void setNameFieldLabel (NSString label) | |
208 { | |
209 OS.objc_msgSend(this.id, OS.sel_setNameFieldLabel_1, label !is null ? label.id : null); | |
210 } | |
211 | |
212 public void setPrompt (NSString prompt) | |
213 { | |
214 OS.objc_msgSend(this.id, OS.sel_setPrompt_1, prompt !is null ? prompt.id : null); | |
215 } | |
216 | |
217 public void setRequiredFileType (NSString type) | |
218 { | |
219 OS.objc_msgSend(this.id, OS.sel_setRequiredFileType_1, type !is null ? type.id : null); | |
220 } | |
221 | |
222 public void setTitle (NSString title) | |
223 { | |
224 OS.objc_msgSend(this.id, OS.sel_setTitle_1, title !is null ? title.id : null); | |
225 } | |
226 | |
227 public void setTreatsFilePackagesAsDirectories (bool flag) | |
228 { | |
229 OS.objc_msgSend(this.id, OS.sel_setTreatsFilePackagesAsDirectories_1, flag); | |
230 } | |
231 | |
232 public NSString title () | |
233 { | |
234 objc.id result = OS.objc_msgSend(this.id, OS.sel_title); | |
235 return result !is null ? new NSString(result) : null; | |
236 } | |
237 | |
238 public bool treatsFilePackagesAsDirectories () | |
239 { | |
240 return OS.objc_msgSend(this.id, OS.sel_treatsFilePackagesAsDirectories) !is null; | |
241 } | |
242 | |
243 public void validateVisibleColumns () | |
244 { | |
245 OS.objc_msgSend(this.id, OS.sel_validateVisibleColumns); | |
246 } | |
247 | |
248 } |