Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSDocument.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.NSDocument; | |
15 | |
16 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSArray; | |
18 import dwt.internal.cocoa.NSCloseCommand; | |
19 import dwt.internal.cocoa.NSData; | |
20 import dwt.internal.cocoa.NSDate; | |
21 import dwt.internal.cocoa.NSDictionary; | |
22 import dwt.internal.cocoa.NSError; | |
23 import dwt.internal.cocoa.NSFileWrapper; | |
24 import dwt.internal.cocoa.NSInteger; | |
25 import dwt.internal.cocoa.NSObject; | |
26 import dwt.internal.cocoa.NSPageLayout; | |
27 import dwt.internal.cocoa.NSPrintInfo; | |
28 import dwt.internal.cocoa.NSPrintOperation; | |
29 import dwt.internal.cocoa.NSSavePanel; | |
30 import dwt.internal.cocoa.NSScriptCommand; | |
31 import dwt.internal.cocoa.NSScriptObjectSpecifier; | |
32 import dwt.internal.cocoa.NSString; | |
33 import dwt.internal.cocoa.NSUndoManager; | |
34 import dwt.internal.cocoa.NSURL; | |
35 import dwt.internal.cocoa.NSWindow; | |
36 import dwt.internal.cocoa.NSWindowController; | |
37 import dwt.internal.cocoa.OS; | |
38 import objc = dwt.internal.objc.runtime; | |
39 | |
40 enum NSSaveOperationType | |
41 { | |
42 NSSaveOperation = 0, | |
43 NSSaveAsOperation = 1, | |
44 NSSaveToOperation = 2, | |
45 NSAutosaveOperation = 3 | |
46 } | |
47 | |
48 alias NSSaveOperationType.NSSaveOperation NSSaveOperation; | |
49 alias NSSaveOperationType.NSSaveAsOperation NSSaveAsOperation; | |
50 alias NSSaveOperationType.NSSaveToOperation NSSaveToOperation; | |
51 alias NSSaveOperationType.NSAutosaveOperation NSAutosaveOperation;; | |
52 | |
53 public class NSDocument : NSObject | |
54 { | |
55 | |
56 public this () | |
57 { | |
58 super(); | |
59 } | |
60 | |
61 public this (objc.id id) | |
62 { | |
63 super(id); | |
64 } | |
65 | |
66 public void addWindowController (NSWindowController windowController) | |
67 { | |
68 OS.objc_msgSend(this.id, OS.sel_addWindowController_1, windowController !is null ? windowController.id : null); | |
69 } | |
70 | |
71 public void autosaveDocumentWithDelegate (id delegatee, objc.SEL didAutosaveSelector, void* contextInfo) | |
72 { | |
73 OS.objc_msgSend(this.id, OS.sel_autosaveDocumentWithDelegate_1didAutosaveSelector_1contextInfo_1, delegatee !is null ? delegatee.id : null, | |
74 didAutosaveSelector, contextInfo); | |
75 } | |
76 | |
77 public NSURL autosavedContentsFileURL () | |
78 { | |
79 objc.id result = OS.objc_msgSend(this.id, OS.sel_autosavedContentsFileURL); | |
80 return result !is null ? new NSURL(result) : null; | |
81 } | |
82 | |
83 public NSString autosavingFileType () | |
84 { | |
85 objc.id result = OS.objc_msgSend(this.id, OS.sel_autosavingFileType); | |
86 return result !is null ? new NSString(result) : null; | |
87 } | |
88 | |
89 public void canCloseDocumentWithDelegate (id delegatee, objc.SEL shouldCloseSelector, void* contextInfo) | |
90 { | |
91 OS.objc_msgSend(this.id, OS.sel_canCloseDocumentWithDelegate_1shouldCloseSelector_1contextInfo_1, delegatee !is null ? delegatee.id : null, | |
92 shouldCloseSelector, contextInfo); | |
93 } | |
94 | |
95 public void close () | |
96 { | |
97 OS.objc_msgSend(this.id, OS.sel_close); | |
98 } | |
99 | |
100 public NSData dataOfType (NSString typeName, objc.id** outError) | |
101 { | |
102 objc.id result = OS.objc_msgSend(this.id, OS.sel_dataOfType_1error_1, typeName !is null ? typeName.id : null, outError); | |
103 return result !is null ? new NSData(result) : null; | |
104 } | |
105 | |
106 public NSData dataRepresentationOfType (NSString type) | |
107 { | |
108 objc.id result = OS.objc_msgSend(this.id, OS.sel_dataRepresentationOfType_1, type !is null ? type.id : null); | |
109 return result !is null ? new NSData(result) : null; | |
110 } | |
111 | |
112 public NSString displayName () | |
113 { | |
114 objc.id result = OS.objc_msgSend(this.id, OS.sel_displayName); | |
115 return result !is null ? new NSString(result) : null; | |
116 } | |
117 | |
118 public NSDictionary fileAttributesToWriteToFile (NSString fullDocumentPath, NSString documentTypeName, objc.id saveOperationType) | |
119 { | |
120 objc.id result = OS.objc_msgSend(this.id, OS.sel_fileAttributesToWriteToFile_1ofType_1saveOperation_1, | |
121 fullDocumentPath !is null ? fullDocumentPath.id : null, documentTypeName !is null ? documentTypeName.id : null, saveOperationType); | |
122 return result !is null ? new NSDictionary(result) : null; | |
123 } | |
124 | |
125 public NSDictionary fileAttributesToWriteToURL (NSURL absoluteURL, NSString typeName, objc.id saveOperation, NSURL absoluteOriginalContentsURL, | |
126 objc.id** outError) | |
127 { | |
128 objc.id result = OS.objc_msgSend(this.id, OS.sel_fileAttributesToWriteToURL_1ofType_1forSaveOperation_1originalContentsURL_1error_1, | |
129 absoluteURL !is null ? absoluteURL.id : null, typeName !is null ? typeName.id : null, saveOperation, | |
130 absoluteOriginalContentsURL !is null ? absoluteOriginalContentsURL.id : null, outError); | |
131 return result !is null ? new NSDictionary(result) : null; | |
132 } | |
133 | |
134 public NSDate fileModificationDate () | |
135 { | |
136 objc.id result = OS.objc_msgSend(this.id, OS.sel_fileModificationDate); | |
137 return result !is null ? new NSDate(result) : null; | |
138 } | |
139 | |
140 public NSString fileName () | |
141 { | |
142 objc.id result = OS.objc_msgSend(this.id, OS.sel_fileName); | |
143 return result !is null ? new NSString(result) : null; | |
144 } | |
145 | |
146 public NSString fileNameExtensionForType (NSString typeName, objc.id saveOperation) | |
147 { | |
148 objc.id result = OS.objc_msgSend(this.id, OS.sel_fileNameExtensionForType_1saveOperation_1, typeName !is null ? typeName.id : null, | |
149 saveOperation); | |
150 return result !is null ? new NSString(result) : null; | |
151 } | |
152 | |
153 public bool fileNameExtensionWasHiddenInLastRunSavePanel () | |
154 { | |
155 return OS.objc_msgSend(this.id, OS.sel_fileNameExtensionWasHiddenInLastRunSavePanel) !is null; | |
156 } | |
157 | |
158 public NSString fileType () | |
159 { | |
160 objc.id result = OS.objc_msgSend(this.id, OS.sel_fileType); | |
161 return result !is null ? new NSString(result) : null; | |
162 } | |
163 | |
164 public NSString fileTypeFromLastRunSavePanel () | |
165 { | |
166 objc.id result = OS.objc_msgSend(this.id, OS.sel_fileTypeFromLastRunSavePanel); | |
167 return result !is null ? new NSString(result) : null; | |
168 } | |
169 | |
170 public NSURL fileURL () | |
171 { | |
172 objc.id result = OS.objc_msgSend(this.id, OS.sel_fileURL); | |
173 return result !is null ? new NSURL(result) : null; | |
174 } | |
175 | |
176 public NSFileWrapper fileWrapperOfType (NSString typeName, objc.id** outError) | |
177 { | |
178 objc.id result = OS.objc_msgSend(this.id, OS.sel_fileWrapperOfType_1error_1, typeName !is null ? typeName.id : null, outError); | |
179 return result !is null ? new NSFileWrapper(result) : null; | |
180 } | |
181 | |
182 public NSFileWrapper fileWrapperRepresentationOfType (NSString type) | |
183 { | |
184 objc.id result = OS.objc_msgSend(this.id, OS.sel_fileWrapperRepresentationOfType_1, type !is null ? type.id : null); | |
185 return result !is null ? new NSFileWrapper(result) : null; | |
186 } | |
187 | |
188 public id handleCloseScriptCommand (NSCloseCommand command) | |
189 { | |
190 objc.id result = OS.objc_msgSend(this.id, OS.sel_handleCloseScriptCommand_1, command !is null ? command.id : null); | |
191 return result !is null ? new id(result) : null; | |
192 } | |
193 | |
194 public id handlePrintScriptCommand (NSScriptCommand command) | |
195 { | |
196 objc.id result = OS.objc_msgSend(this.id, OS.sel_handlePrintScriptCommand_1, command !is null ? command.id : null); | |
197 return result !is null ? new id(result) : null; | |
198 } | |
199 | |
200 public id handleSaveScriptCommand (NSScriptCommand command) | |
201 { | |
202 objc.id result = OS.objc_msgSend(this.id, OS.sel_handleSaveScriptCommand_1, command !is null ? command.id : null); | |
203 return result !is null ? new id(result) : null; | |
204 } | |
205 | |
206 public bool hasUnautosavedChanges () | |
207 { | |
208 return OS.objc_msgSend(this.id, OS.sel_hasUnautosavedChanges) !is null; | |
209 } | |
210 | |
211 public bool hasUndoManager () | |
212 { | |
213 return OS.objc_msgSend(this.id, OS.sel_hasUndoManager) !is null; | |
214 } | |
215 | |
216 public NSDocument initForURL (NSURL absoluteDocumentURL, NSURL absoluteDocumentContentsURL, NSString typeName, objc.id** outError) | |
217 { | |
218 objc.id result = OS.objc_msgSend(this.id, OS.sel_initForURL_1withContentsOfURL_1ofType_1error_1, | |
219 absoluteDocumentURL !is null ? absoluteDocumentURL.id : null, | |
220 absoluteDocumentContentsURL !is null ? absoluteDocumentContentsURL.id : null, typeName !is null ? typeName.id : null, outError); | |
221 return result !is null ? this : null; | |
222 } | |
223 | |
224 public NSDocument initWithContentsOfFile (NSString absolutePath, NSString typeName) | |
225 { | |
226 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfFile_1ofType_1, absolutePath !is null ? absolutePath.id : null, | |
227 typeName !is null ? typeName.id : null); | |
228 return result !is null ? this : null; | |
229 } | |
230 | |
231 public NSDocument initWithContentsOfURL_ofType_ (NSURL absoluteURL, NSString typeName) | |
232 { | |
233 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1ofType_1, absoluteURL !is null ? absoluteURL.id : null, | |
234 typeName !is null ? typeName.id : null); | |
235 return result !is null ? this : null; | |
236 } | |
237 | |
238 public NSDocument initWithContentsOfURL_ofType_error_ (NSURL absoluteURL, NSString typeName, objc.id** outError) | |
239 { | |
240 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithContentsOfURL_1ofType_1error_1, absoluteURL !is null ? absoluteURL.id : null, | |
241 typeName !is null ? typeName.id : null, outError); | |
242 return result !is null ? this : null; | |
243 } | |
244 | |
245 public NSDocument initWithType (NSString typeName, objc.id** outError) | |
246 { | |
247 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithType_1error_1, typeName !is null ? typeName.id : null, outError); | |
248 return result !is null ? this : null; | |
249 } | |
250 | |
251 public bool isDocumentEdited () | |
252 { | |
253 return OS.objc_msgSend(this.id, OS.sel_isDocumentEdited) !is null; | |
254 } | |
255 | |
256 public static bool isNativeType (NSString type) | |
257 { | |
258 return OS.objc_msgSend(OS.class_NSDocument, OS.sel_isNativeType_1, type !is null ? type.id : null) !is null; | |
259 } | |
260 | |
261 public bool keepBackupFile () | |
262 { | |
263 return OS.objc_msgSend(this.id, OS.sel_keepBackupFile) !is null; | |
264 } | |
265 | |
266 public NSString lastComponentOfFileName () | |
267 { | |
268 objc.id result = OS.objc_msgSend(this.id, OS.sel_lastComponentOfFileName); | |
269 return result !is null ? new NSString(result) : null; | |
270 } | |
271 | |
272 public bool loadDataRepresentation (NSData data, NSString type) | |
273 { | |
274 return OS.objc_msgSend(this.id, OS.sel_loadDataRepresentation_1ofType_1, data !is null ? data.id : null, type !is null ? type.id : null) !is null; | |
275 } | |
276 | |
277 public bool loadFileWrapperRepresentation (NSFileWrapper wrapper, NSString type) | |
278 { | |
279 return OS.objc_msgSend(this.id, OS.sel_loadFileWrapperRepresentation_1ofType_1, wrapper !is null ? wrapper.id : null, | |
280 type !is null ? type.id : null) !is null; | |
281 } | |
282 | |
283 public void makeWindowControllers () | |
284 { | |
285 OS.objc_msgSend(this.id, OS.sel_makeWindowControllers); | |
286 } | |
287 | |
288 public NSScriptObjectSpecifier objectSpecifier () | |
289 { | |
290 objc.id result = OS.objc_msgSend(this.id, OS.sel_objectSpecifier); | |
291 return result !is null ? new NSScriptObjectSpecifier(result) : null; | |
292 } | |
293 | |
294 public bool preparePageLayout (NSPageLayout pageLayout) | |
295 { | |
296 return OS.objc_msgSend(this.id, OS.sel_preparePageLayout_1, pageLayout !is null ? pageLayout.id : null) !is null; | |
297 } | |
298 | |
299 public bool prepareSavePanel (NSSavePanel savePanel) | |
300 { | |
301 return OS.objc_msgSend(this.id, OS.sel_prepareSavePanel_1, savePanel !is null ? savePanel.id : null) !is null; | |
302 } | |
303 | |
304 public bool presentError_ (NSError error) | |
305 { | |
306 return OS.objc_msgSend(this.id, OS.sel_presentError_1, error !is null ? error.id : null) !is null; | |
307 } | |
308 | |
309 public void presentError_modalForWindow_delegatee_didPresentSelector_contextInfo_ (NSError error, NSWindow window, id delegatee, | |
310 objc.SEL didPresentSelector, void* contextInfo) | |
311 { | |
312 OS.objc_msgSend(this.id, OS.sel_presentError_1modalForWindow_1delegatee_1didPresentSelector_1contextInfo_1, error !is null ? error.id : null, | |
313 window !is null ? window.id : null, delegatee !is null ? delegatee.id : null, didPresentSelector, contextInfo); | |
314 } | |
315 | |
316 public void printDocument (id sender) | |
317 { | |
318 OS.objc_msgSend(this.id, OS.sel_printDocument_1, sender !is null ? sender.id : null); | |
319 } | |
320 | |
321 public void printDocumentWithSettings (NSDictionary printSettings, bool showPrintPanel, id delegatee, objc.SEL didPrintSelector, | |
322 void* contextInfo) | |
323 { | |
324 OS.objc_msgSend(this.id, OS.sel_printDocumentWithSettings_1showPrintPanel_1delegatee_1didPrintSelector_1contextInfo_1, | |
325 printSettings !is null ? printSettings.id : null, showPrintPanel, delegatee !is null ? delegatee.id : null, didPrintSelector, | |
326 contextInfo); | |
327 } | |
328 | |
329 public NSPrintInfo printInfo () | |
330 { | |
331 objc.id result = OS.objc_msgSend(this.id, OS.sel_printInfo); | |
332 return result !is null ? new NSPrintInfo(result) : null; | |
333 } | |
334 | |
335 public NSPrintOperation printOperationWithSettings (NSDictionary printSettings, objc.id** outError) | |
336 { | |
337 objc.id result = OS.objc_msgSend(this.id, OS.sel_printOperationWithSettings_1error_1, printSettings !is null ? printSettings.id : null, | |
338 outError); | |
339 return result !is null ? new NSPrintOperation(result) : null; | |
340 } | |
341 | |
342 public void printShowingPrintPanel (bool flag) | |
343 { | |
344 OS.objc_msgSend(this.id, OS.sel_printShowingPrintPanel_1, flag); | |
345 } | |
346 | |
347 public bool readFromData (NSData data, NSString typeName, objc.id** outError) | |
348 { | |
349 return OS.objc_msgSend(this.id, OS.sel_readFromData_1ofType_1error_1, data !is null ? data.id : null, typeName !is null ? typeName.id : null, | |
350 outError) !is null; | |
351 } | |
352 | |
353 public bool readFromFile (NSString fileName, NSString type) | |
354 { | |
355 return OS.objc_msgSend(this.id, OS.sel_readFromFile_1ofType_1, fileName !is null ? fileName.id : null, type !is null ? type.id : null) !is null; | |
356 } | |
357 | |
358 public bool readFromFileWrapper (NSFileWrapper fileWrapper, NSString typeName, objc.id** outError) | |
359 { | |
360 return OS.objc_msgSend(this.id, OS.sel_readFromFileWrapper_1ofType_1error_1, fileWrapper !is null ? fileWrapper.id : null, | |
361 typeName !is null ? typeName.id : null, outError) !is null; | |
362 } | |
363 | |
364 public bool readFromURL_ofType_ (NSURL url, NSString type) | |
365 { | |
366 return OS.objc_msgSend(this.id, OS.sel_readFromURL_1ofType_1, url !is null ? url.id : null, type !is null ? type.id : null) !is null; | |
367 } | |
368 | |
369 public bool readFromURL_ofType_error_ (NSURL absoluteURL, NSString typeName, objc.id** outError) | |
370 { | |
371 return OS.objc_msgSend(this.id, OS.sel_readFromURL_1ofType_1error_1, absoluteURL !is null ? absoluteURL.id : null, | |
372 typeName !is null ? typeName.id : null, outError) !is null; | |
373 } | |
374 | |
375 public static NSArray readableTypes () | |
376 { | |
377 objc.id result = OS.objc_msgSend(OS.class_NSDocument, OS.sel_readableTypes); | |
378 return result !is null ? new NSArray(result) : null; | |
379 } | |
380 | |
381 public void removeWindowController (NSWindowController windowController) | |
382 { | |
383 OS.objc_msgSend(this.id, OS.sel_removeWindowController_1, windowController !is null ? windowController.id : null); | |
384 } | |
385 | |
386 public void revertDocumentToSaved (id sender) | |
387 { | |
388 OS.objc_msgSend(this.id, OS.sel_revertDocumentToSaved_1, sender !is null ? sender.id : null); | |
389 } | |
390 | |
391 public bool revertToContentsOfURL (NSURL absoluteURL, NSString typeName, objc.id** outError) | |
392 { | |
393 return OS.objc_msgSend(this.id, OS.sel_revertToContentsOfURL_1ofType_1error_1, absoluteURL !is null ? absoluteURL.id : null, | |
394 typeName !is null ? typeName.id : null, outError) !is null; | |
395 } | |
396 | |
397 public bool revertToSavedFromFile (NSString fileName, NSString type) | |
398 { | |
399 return OS.objc_msgSend(this.id, OS.sel_revertToSavedFromFile_1ofType_1, fileName !is null ? fileName.id : null, | |
400 type !is null ? type.id : null) !is null; | |
401 } | |
402 | |
403 public bool revertToSavedFromURL (NSURL url, NSString type) | |
404 { | |
405 return OS.objc_msgSend(this.id, OS.sel_revertToSavedFromURL_1ofType_1, url !is null ? url.id : null, type !is null ? type.id : null) !is null; | |
406 } | |
407 | |
408 public NSInteger runModalPageLayoutWithPrintInfo_ (NSPrintInfo printInfo) | |
409 { | |
410 return OS.objc_msgSend(this.id, OS.sel_runModalPageLayoutWithPrintInfo_1, printInfo !is null ? printInfo.id : null); | |
411 } | |
412 | |
413 public void runModalPageLayoutWithPrintInfo_delegatee_didRunSelector_contextInfo_ (NSPrintInfo printInfo, id delegatee, objc.SEL didRunSelector, | |
414 void* contextInfo) | |
415 { | |
416 OS.objc_msgSend(this.id, OS.sel_runModalPageLayoutWithPrintInfo_1delegatee_1didRunSelector_1contextInfo_1, | |
417 printInfo !is null ? printInfo.id : null, delegatee !is null ? delegatee.id : null, didRunSelector, contextInfo); | |
418 } | |
419 | |
420 public void runModalPrintOperation (NSPrintOperation printOperation, id delegatee, objc.SEL didRunSelector, void* contextInfo) | |
421 { | |
422 OS.objc_msgSend(this.id, OS.sel_runModalPrintOperation_1delegatee_1didRunSelector_1contextInfo_1, | |
423 printOperation !is null ? printOperation.id : null, delegatee !is null ? delegatee.id : null, didRunSelector, contextInfo); | |
424 } | |
425 | |
426 public void runModalSavePanelForSaveOperation (objc.id saveOperation, id delegatee, objc.SEL didSaveSelector, void* contextInfo) | |
427 { | |
428 OS.objc_msgSend(this.id, OS.sel_runModalSavePanelForSaveOperation_1delegatee_1didSaveSelector_1contextInfo_1, saveOperation, | |
429 delegatee !is null ? delegatee.id : null, didSaveSelector, contextInfo); | |
430 } | |
431 | |
432 public void runPageLayout (id sender) | |
433 { | |
434 OS.objc_msgSend(this.id, OS.sel_runPageLayout_1, sender !is null ? sender.id : null); | |
435 } | |
436 | |
437 public void saveDocument (id sender) | |
438 { | |
439 OS.objc_msgSend(this.id, OS.sel_saveDocument_1, sender !is null ? sender.id : null); | |
440 } | |
441 | |
442 public void saveDocumentAs (id sender) | |
443 { | |
444 OS.objc_msgSend(this.id, OS.sel_saveDocumentAs_1, sender !is null ? sender.id : null); | |
445 } | |
446 | |
447 public void saveDocumentTo (id sender) | |
448 { | |
449 OS.objc_msgSend(this.id, OS.sel_saveDocumentTo_1, sender !is null ? sender.id : null); | |
450 } | |
451 | |
452 public void saveDocumentWithDelegate (id delegatee, objc.SEL didSaveSelector, void* contextInfo) | |
453 { | |
454 OS.objc_msgSend(this.id, OS.sel_saveDocumentWithDelegate_1didSaveSelector_1contextInfo_1, delegatee !is null ? delegatee.id : null, | |
455 didSaveSelector, contextInfo); | |
456 } | |
457 | |
458 public void saveToFile (NSString fileName, objc.id saveOperation, id delegatee, objc.SEL didSaveSelector, void* contextInfo) | |
459 { | |
460 OS.objc_msgSend(this.id, OS.sel_saveToFile_1saveOperation_1delegatee_1didSaveSelector_1contextInfo_1, fileName !is null ? fileName.id : null, | |
461 saveOperation, delegatee !is null ? delegatee.id : null, didSaveSelector, contextInfo); | |
462 } | |
463 | |
464 public void saveToURL_ofType_forSaveOperation_delegatee_didSaveSelector_contextInfo_ (NSURL absoluteURL, NSString typeName, | |
465 objc.id saveOperation, id delegatee, objc.SEL didSaveSelector, void* contextInfo) | |
466 { | |
467 OS.objc_msgSend(this.id, OS.sel_saveToURL_1ofType_1forSaveOperation_1delegatee_1didSaveSelector_1contextInfo_1, | |
468 absoluteURL !is null ? absoluteURL.id : null, typeName !is null ? typeName.id : null, saveOperation, | |
469 delegatee !is null ? delegatee.id : null, didSaveSelector, contextInfo); | |
470 } | |
471 | |
472 public bool saveToURL_ofType_forSaveOperation_error_ (NSURL absoluteURL, NSString typeName, objc.id saveOperation, objc.id** outError) | |
473 { | |
474 return OS.objc_msgSend(this.id, OS.sel_saveToURL_1ofType_1forSaveOperation_1error_1, absoluteURL !is null ? absoluteURL.id : null, | |
475 typeName !is null ? typeName.id : null, saveOperation, outError) !is null; | |
476 } | |
477 | |
478 public void setAutosavedContentsFileURL (NSURL absoluteURL) | |
479 { | |
480 OS.objc_msgSend(this.id, OS.sel_setAutosavedContentsFileURL_1, absoluteURL !is null ? absoluteURL.id : null); | |
481 } | |
482 | |
483 public void setFileModificationDate (NSDate modificationDate) | |
484 { | |
485 OS.objc_msgSend(this.id, OS.sel_setFileModificationDate_1, modificationDate !is null ? modificationDate.id : null); | |
486 } | |
487 | |
488 public void setFileName (NSString fileName) | |
489 { | |
490 OS.objc_msgSend(this.id, OS.sel_setFileName_1, fileName !is null ? fileName.id : null); | |
491 } | |
492 | |
493 public void setFileType (NSString typeName) | |
494 { | |
495 OS.objc_msgSend(this.id, OS.sel_setFileType_1, typeName !is null ? typeName.id : null); | |
496 } | |
497 | |
498 public void setFileURL (NSURL absoluteURL) | |
499 { | |
500 OS.objc_msgSend(this.id, OS.sel_setFileURL_1, absoluteURL !is null ? absoluteURL.id : null); | |
501 } | |
502 | |
503 public void setHasUndoManager (bool hasUndoManager) | |
504 { | |
505 OS.objc_msgSend(this.id, OS.sel_setHasUndoManager_1, hasUndoManager); | |
506 } | |
507 | |
508 public void setLastComponentOfFileName (NSString str) | |
509 { | |
510 OS.objc_msgSend(this.id, OS.sel_setLastComponentOfFileName_1, str !is null ? str.id : null); | |
511 } | |
512 | |
513 public void setPrintInfo (NSPrintInfo printInfo) | |
514 { | |
515 OS.objc_msgSend(this.id, OS.sel_setPrintInfo_1, printInfo !is null ? printInfo.id : null); | |
516 } | |
517 | |
518 public void setUndoManager (NSUndoManager undoManager) | |
519 { | |
520 OS.objc_msgSend(this.id, OS.sel_setUndoManager_1, undoManager !is null ? undoManager.id : null); | |
521 } | |
522 | |
523 public void setWindow (NSWindow window) | |
524 { | |
525 OS.objc_msgSend(this.id, OS.sel_setWindow_1, window !is null ? window.id : null); | |
526 } | |
527 | |
528 public bool shouldChangePrintInfo (NSPrintInfo newPrintInfo) | |
529 { | |
530 return OS.objc_msgSend(this.id, OS.sel_shouldChangePrintInfo_1, newPrintInfo !is null ? newPrintInfo.id : null) !is null; | |
531 } | |
532 | |
533 public void shouldCloseWindowController (NSWindowController windowController, id delegatee, objc.SEL shouldCloseSelector, void* contextInfo) | |
534 { | |
535 OS.objc_msgSend(this.id, OS.sel_shouldCloseWindowController_1delegatee_1shouldCloseSelector_1contextInfo_1, | |
536 windowController !is null ? windowController.id : null, delegatee !is null ? delegatee.id : null, shouldCloseSelector, contextInfo); | |
537 } | |
538 | |
539 public bool shouldRunSavePanelWithAccessoryView () | |
540 { | |
541 return OS.objc_msgSend(this.id, OS.sel_shouldRunSavePanelWithAccessoryView) !is null; | |
542 } | |
543 | |
544 public void showWindows () | |
545 { | |
546 OS.objc_msgSend(this.id, OS.sel_showWindows); | |
547 } | |
548 | |
549 public NSUndoManager undoManager () | |
550 { | |
551 objc.id result = OS.objc_msgSend(this.id, OS.sel_undoManager); | |
552 return result !is null ? new NSUndoManager(result) : null; | |
553 } | |
554 | |
555 public void updateChangeCount (objc.id change) | |
556 { | |
557 OS.objc_msgSend(this.id, OS.sel_updateChangeCount_1, change); | |
558 } | |
559 | |
560 public bool validateUserInterfaceItem (id anItem) | |
561 { | |
562 return OS.objc_msgSend(this.id, OS.sel_validateUserInterfaceItem_1, anItem !is null ? anItem.id : null) !is null; | |
563 } | |
564 | |
565 public NSError willPresentError (NSError error) | |
566 { | |
567 objc.id result = OS.objc_msgSend(this.id, OS.sel_willPresentError_1, error !is null ? error.id : null); | |
568 return result !is null ? new NSError(result) : null; | |
569 } | |
570 | |
571 public void windowControllerDidLoadNib (NSWindowController windowController) | |
572 { | |
573 OS.objc_msgSend(this.id, OS.sel_windowControllerDidLoadNib_1, windowController !is null ? windowController.id : null); | |
574 } | |
575 | |
576 public void windowControllerWillLoadNib (NSWindowController windowController) | |
577 { | |
578 OS.objc_msgSend(this.id, OS.sel_windowControllerWillLoadNib_1, windowController !is null ? windowController.id : null); | |
579 } | |
580 | |
581 public NSArray windowControllers () | |
582 { | |
583 objc.id result = OS.objc_msgSend(this.id, OS.sel_windowControllers); | |
584 return result !is null ? new NSArray(result) : null; | |
585 } | |
586 | |
587 public NSWindow windowForSheet () | |
588 { | |
589 objc.id result = OS.objc_msgSend(this.id, OS.sel_windowForSheet); | |
590 return result !is null ? new NSWindow(result) : null; | |
591 } | |
592 | |
593 public NSString windowNibName () | |
594 { | |
595 objc.id result = OS.objc_msgSend(this.id, OS.sel_windowNibName); | |
596 return result !is null ? new NSString(result) : null; | |
597 } | |
598 | |
599 public static NSArray writableTypes () | |
600 { | |
601 objc.id result = OS.objc_msgSend(OS.class_NSDocument, OS.sel_writableTypes); | |
602 return result !is null ? new NSArray(result) : null; | |
603 } | |
604 | |
605 public NSArray writableTypesForSaveOperation (objc.id saveOperation) | |
606 { | |
607 objc.id result = OS.objc_msgSend(this.id, OS.sel_writableTypesForSaveOperation_1, saveOperation); | |
608 return result !is null ? new NSArray(result) : null; | |
609 } | |
610 | |
611 public bool writeSafelyToURL (NSURL absoluteURL, NSString typeName, objc.id saveOperation, objc.id** outError) | |
612 { | |
613 return OS.objc_msgSend(this.id, OS.sel_writeSafelyToURL_1ofType_1forSaveOperation_1error_1, absoluteURL !is null ? absoluteURL.id : null, | |
614 typeName !is null ? typeName.id : null, saveOperation, outError) !is null; | |
615 } | |
616 | |
617 public bool writeToFile_ofType_ (NSString fileName, NSString type) | |
618 { | |
619 return OS.objc_msgSend(this.id, OS.sel_writeToFile_1ofType_1, fileName !is null ? fileName.id : null, type !is null ? type.id : null) !is null; | |
620 } | |
621 | |
622 public bool writeToFile_ofType_originalFile_saveOperation_ (NSString fullDocumentPath, NSString documentTypeName, | |
623 NSString fullOriginalDocumentPath, objc.id saveOperationType) | |
624 { | |
625 return OS.objc_msgSend(this.id, OS.sel_writeToFile_1ofType_1originalFile_1saveOperation_1, | |
626 fullDocumentPath !is null ? fullDocumentPath.id : null, documentTypeName !is null ? documentTypeName.id : null, | |
627 fullOriginalDocumentPath !is null ? fullOriginalDocumentPath.id : null, saveOperationType) !is null; | |
628 } | |
629 | |
630 public bool writeToURL_ofType_ (NSURL url, NSString type) | |
631 { | |
632 return OS.objc_msgSend(this.id, OS.sel_writeToURL_1ofType_1, url !is null ? url.id : null, type !is null ? type.id : null) !is null; | |
633 } | |
634 | |
635 public bool writeToURL_ofType_error_ (NSURL absoluteURL, NSString typeName, objc.id** outError) | |
636 { | |
637 return OS.objc_msgSend(this.id, OS.sel_writeToURL_1ofType_1error_1, absoluteURL !is null ? absoluteURL.id : null, | |
638 typeName !is null ? typeName.id : null, outError) !is null; | |
639 } | |
640 | |
641 public bool writeToURL_ofType_forSaveOperation_originalContentsURL_error_ (NSURL absoluteURL, NSString typeName, objc.id saveOperation, | |
642 NSURL absoluteOriginalContentsURL, objc.id** outError) | |
643 { | |
644 return OS.objc_msgSend(this.id, OS.sel_writeToURL_1ofType_1forSaveOperation_1originalContentsURL_1error_1, | |
645 absoluteURL !is null ? absoluteURL.id : null, typeName !is null ? typeName.id : null, saveOperation, | |
646 absoluteOriginalContentsURL !is null ? absoluteOriginalContentsURL.id : null, outError) !is null; | |
647 } | |
648 | |
649 public bool writeWithBackupToFile (NSString fullDocumentPath, NSString documentTypeName, objc.id saveOperationType) | |
650 { | |
651 return OS.objc_msgSend(this.id, OS.sel_writeWithBackupToFile_1ofType_1saveOperation_1, | |
652 fullDocumentPath !is null ? fullDocumentPath.id : null, documentTypeName !is null ? documentTypeName.id : null, saveOperationType) !is null; | |
653 } | |
654 | |
655 } |