diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwt/internal/cocoa/NSSavePanel.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,248 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ * Port to the D Programming language:
+ *     Jacob Carlborg <jacob.carlborg@gmail.com>
+ *******************************************************************************/
+module dwt.internal.cocoa.NSSavePanel;
+
+import dwt.internal.cocoa.NSArray;
+import dwt.internal.cocoa.NSInteger;
+import dwt.internal.cocoa.NSPanel;
+import dwt.internal.cocoa.NSString;
+import dwt.internal.cocoa.NSURL;
+import dwt.internal.cocoa.NSView;
+import dwt.internal.cocoa.NSWindow;
+import dwt.internal.cocoa.OS;
+import objc = dwt.internal.objc.runtime;
+
+public class NSSavePanel : NSPanel
+{
+
+    public this ()
+    {
+        super();
+    }
+
+    public this (objc.id id)
+    {
+        super(id);
+    }
+
+    public NSURL URL ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_URL);
+        return result !is null ? new NSURL(result) : null;
+    }
+
+    public NSView accessoryView ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_accessoryView);
+        return result !is null ? new NSView(result) : null;
+    }
+
+    public NSArray allowedFileTypes ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_allowedFileTypes);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public bool allowsOtherFileTypes ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_allowsOtherFileTypes) !is null;
+    }
+
+    public void beginSheetForDirectory (NSString path, NSString name, NSWindow docWindow, id delegatee, objc.SEL didEndSelector, void* contextInfo)
+    {
+        OS.objc_msgSend(this.id, OS.sel_beginSheetForDirectory_1file_1modalForWindow_1modalDelegate_1didEndSelector_1contextInfo_1,
+                path !is null ? path.id : null, name !is null ? name.id : null, docWindow !is null ? docWindow.id : null,
+                delegatee !is null ? delegatee.id : null, didEndSelector, contextInfo);
+    }
+
+    public bool canCreateDirectories ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_canCreateDirectories) !is null;
+    }
+
+    public bool canSelectHiddenExtension ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_canSelectHiddenExtension) !is null;
+    }
+
+    public void cancel (id sender)
+    {
+        OS.objc_msgSend(this.id, OS.sel_cancel_1, sender !is null ? sender.id : null);
+    }
+
+    public id delegatee ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate);
+        return result !is null ? new id(result) : null;
+    }
+
+    public NSString directory ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_directory);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSString filename ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_filename);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public bool isExpanded ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_isExpanded) !is null;
+    }
+
+    public bool isExtensionHidden ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_isExtensionHidden) !is null;
+    }
+
+    public NSString message ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_message);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSString nameFieldLabel ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_nameFieldLabel);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public void ok (id sender)
+    {
+        OS.objc_msgSend(this.id, OS.sel_ok_1, sender !is null ? sender.id : null);
+    }
+
+    public NSString prompt ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_prompt);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSString requiredFileType ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_requiredFileType);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSInteger runModal ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_runModal);
+    }
+
+    public NSInteger runModalForDirectory (NSString path, NSString name)
+    {
+        return OS.objc_msgSend(this.id, OS.sel_runModalForDirectory_1file_1, path !is null ? path.id : null, name !is null ? name.id : null);
+    }
+
+    public static NSSavePanel savePanel ()
+    {
+        objc.id result = OS.objc_msgSend(OS.class_NSSavePanel, OS.sel_savePanel);
+        return result !is null ? new NSSavePanel(result) : null;
+    }
+
+    public void selectText (id sender)
+    {
+        OS.objc_msgSend(this.id, OS.sel_selectText_1, sender !is null ? sender.id : null);
+    }
+
+    public void setAccessoryView (NSView view)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAccessoryView_1, view !is null ? view.id : null);
+    }
+
+    public void setAllowedFileTypes (NSArray types)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAllowedFileTypes_1, types !is null ? types.id : null);
+    }
+
+    public void setAllowsOtherFileTypes (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setAllowsOtherFileTypes_1, flag);
+    }
+
+    public void setCanCreateDirectories (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setCanCreateDirectories_1, flag);
+    }
+
+    public void setCanSelectHiddenExtension (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setCanSelectHiddenExtension_1, flag);
+    }
+
+    public void setDelegate (id delegatee)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id : null);
+    }
+
+    public void setDirectory (NSString path)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setDirectory_1, path !is null ? path.id : null);
+    }
+
+    public void setExtensionHidden (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setExtensionHidden_1, flag);
+    }
+
+    public void setMessage (NSString message)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setMessage_1, message !is null ? message.id : null);
+    }
+
+    public void setNameFieldLabel (NSString label)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setNameFieldLabel_1, label !is null ? label.id : null);
+    }
+
+    public void setPrompt (NSString prompt)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setPrompt_1, prompt !is null ? prompt.id : null);
+    }
+
+    public void setRequiredFileType (NSString type)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setRequiredFileType_1, type !is null ? type.id : null);
+    }
+
+    public void setTitle (NSString title)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setTitle_1, title !is null ? title.id : null);
+    }
+
+    public void setTreatsFilePackagesAsDirectories (bool flag)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setTreatsFilePackagesAsDirectories_1, flag);
+    }
+
+    public NSString title ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_title);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public bool treatsFilePackagesAsDirectories ()
+    {
+        return OS.objc_msgSend(this.id, OS.sel_treatsFilePackagesAsDirectories) !is null;
+    }
+
+    public void validateVisibleColumns ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_validateVisibleColumns);
+    }
+
+}