comparison 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
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.NSScriptCommandDescription;
15
16 import dwt.internal.c.carboncore.MacTypes : FourCharCode;
17 import dwt.internal.cocoa.id;
18 import dwt.internal.cocoa.NSArray;
19 import dwt.internal.cocoa.NSDictionary;
20 import dwt.internal.cocoa.NSObject;
21 import dwt.internal.cocoa.NSScriptCommand;
22 import dwt.internal.cocoa.NSString;
23 import dwt.internal.cocoa.NSZone;
24 import dwt.internal.cocoa.OS;
25 import objc = dwt.internal.objc.runtime;
26
27 public class NSScriptCommandDescription : NSObject
28 {
29
30 public this ()
31 {
32 super();
33 }
34
35 public this (objc.id id)
36 {
37 super(id);
38 }
39
40 public FourCharCode appleEventClassCode ()
41 {
42 return cast(FourCharCode) OS.objc_msgSend(this.id, OS.sel_appleEventClassCode);
43 }
44
45 public FourCharCode appleEventCode ()
46 {
47 return cast(FourCharCode) OS.objc_msgSend(this.id, OS.sel_appleEventCode);
48 }
49
50 public FourCharCode appleEventCodeForArgumentWithName (NSString argumentName)
51 {
52 return cast(FourCharCode) OS.objc_msgSend(this.id, OS.sel_appleEventCodeForArgumentWithName_1, argumentName !is null ? argumentName.id : null);
53 }
54
55 public FourCharCode appleEventCodeForReturnType ()
56 {
57 return cast(FourCharCode) OS.objc_msgSend(this.id, OS.sel_appleEventCodeForReturnType);
58 }
59
60 public NSArray argumentNames ()
61 {
62 objc.id result = OS.objc_msgSend(this.id, OS.sel_argumentNames);
63 return result !is null ? new NSArray(result) : null;
64 }
65
66 public NSString commandClassName ()
67 {
68 objc.id result = OS.objc_msgSend(this.id, OS.sel_commandClassName);
69 return result !is null ? new NSString(result) : null;
70 }
71
72 public NSString commandName ()
73 {
74 objc.id result = OS.objc_msgSend(this.id, OS.sel_commandName);
75 return result !is null ? new NSString(result) : null;
76 }
77
78 public NSScriptCommand createCommandInstance ()
79 {
80 objc.id result = OS.objc_msgSend(this.id, OS.sel_createCommandInstance);
81 return result !is null ? new NSScriptCommand(result) : null;
82 }
83
84 public NSScriptCommand createCommandInstanceWithZone (NSZone* zone)
85 {
86 objc.id result = OS.objc_msgSend(this.id, OS.sel_createCommandInstanceWithZone_1, zone);
87 return result !is null ? new NSScriptCommand(result) : null;
88 }
89
90 public id initWithSuiteName (NSString suiteName, NSString commandName, NSDictionary commandDeclaration)
91 {
92 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithSuiteName_1commandName_1dictionary_1, suiteName !is null ? suiteName.id : null,
93 commandName !is null ? commandName.id : null, commandDeclaration !is null ? commandDeclaration.id : null);
94 return result !is null ? new id(result) : null;
95 }
96
97 public bool isOptionalArgumentWithName (NSString argumentName)
98 {
99 return OS.objc_msgSend(this.id, OS.sel_isOptionalArgumentWithName_1, argumentName !is null ? argumentName.id : null) !is null;
100 }
101
102 public NSString returnType ()
103 {
104 objc.id result = OS.objc_msgSend(this.id, OS.sel_returnType);
105 return result !is null ? new NSString(result) : null;
106 }
107
108 public NSString suiteName ()
109 {
110 objc.id result = OS.objc_msgSend(this.id, OS.sel_suiteName);
111 return result !is null ? new NSString(result) : null;
112 }
113
114 public NSString typeForArgumentWithName (NSString argumentName)
115 {
116 objc.id result = OS.objc_msgSend(this.id, OS.sel_typeForArgumentWithName_1, argumentName !is null ? argumentName.id : null);
117 return result !is null ? new NSString(result) : null;
118 }
119
120 }