diff dwt/internal/cocoa/NSScriptCommandDescription.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/NSScriptCommandDescription.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * 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.NSScriptCommandDescription;
+
+import dwt.internal.c.carboncore.MacTypes : FourCharCode;
+import dwt.internal.cocoa.id;
+import dwt.internal.cocoa.NSArray;
+import dwt.internal.cocoa.NSDictionary;
+import dwt.internal.cocoa.NSObject;
+import dwt.internal.cocoa.NSScriptCommand;
+import dwt.internal.cocoa.NSString;
+import dwt.internal.cocoa.NSZone;
+import dwt.internal.cocoa.OS;
+import objc = dwt.internal.objc.runtime;
+
+public class NSScriptCommandDescription : NSObject
+{
+
+    public this ()
+    {
+        super();
+    }
+
+    public this (objc.id id)
+    {
+        super(id);
+    }
+
+    public FourCharCode appleEventClassCode ()
+    {
+        return cast(FourCharCode) OS.objc_msgSend(this.id, OS.sel_appleEventClassCode);
+    }
+
+    public FourCharCode appleEventCode ()
+    {
+        return cast(FourCharCode) OS.objc_msgSend(this.id, OS.sel_appleEventCode);
+    }
+
+    public FourCharCode appleEventCodeForArgumentWithName (NSString argumentName)
+    {
+        return cast(FourCharCode) OS.objc_msgSend(this.id, OS.sel_appleEventCodeForArgumentWithName_1, argumentName !is null ? argumentName.id : null);
+    }
+
+    public FourCharCode appleEventCodeForReturnType ()
+    {
+        return cast(FourCharCode) OS.objc_msgSend(this.id, OS.sel_appleEventCodeForReturnType);
+    }
+
+    public NSArray argumentNames ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_argumentNames);
+        return result !is null ? new NSArray(result) : null;
+    }
+
+    public NSString commandClassName ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_commandClassName);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSString commandName ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_commandName);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSScriptCommand createCommandInstance ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_createCommandInstance);
+        return result !is null ? new NSScriptCommand(result) : null;
+    }
+
+    public NSScriptCommand createCommandInstanceWithZone (NSZone* zone)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_createCommandInstanceWithZone_1, zone);
+        return result !is null ? new NSScriptCommand(result) : null;
+    }
+
+    public id initWithSuiteName (NSString suiteName, NSString commandName, NSDictionary commandDeclaration)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithSuiteName_1commandName_1dictionary_1, suiteName !is null ? suiteName.id : null,
+                commandName !is null ? commandName.id : null, commandDeclaration !is null ? commandDeclaration.id : null);
+        return result !is null ? new id(result) : null;
+    }
+
+    public bool isOptionalArgumentWithName (NSString argumentName)
+    {
+        return OS.objc_msgSend(this.id, OS.sel_isOptionalArgumentWithName_1, argumentName !is null ? argumentName.id : null) !is null;
+    }
+
+    public NSString returnType ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_returnType);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSString suiteName ()
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_suiteName);
+        return result !is null ? new NSString(result) : null;
+    }
+
+    public NSString typeForArgumentWithName (NSString argumentName)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_typeForArgumentWithName_1, argumentName !is null ? argumentName.id : null);
+        return result !is null ? new NSString(result) : null;
+    }
+
+}