Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSScriptCommand.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.NSScriptCommand; | |
15 | |
16 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSAppleEventDescriptor; | |
18 import dwt.internal.cocoa.NSDictionary; | |
19 import dwt.internal.cocoa.NSObject; | |
20 import dwt.internal.cocoa.NSScriptCommandDescription; | |
21 import dwt.internal.cocoa.NSScriptObjectSpecifier; | |
22 import dwt.internal.cocoa.NSString; | |
23 import dwt.internal.cocoa.OS; | |
24 import objc = dwt.internal.objc.runtime; | |
25 | |
26 public class NSScriptCommand : NSObject | |
27 { | |
28 | |
29 public this () | |
30 { | |
31 super(); | |
32 } | |
33 | |
34 public this (objc.id id) | |
35 { | |
36 super(id); | |
37 } | |
38 | |
39 public NSAppleEventDescriptor appleEvent () | |
40 { | |
41 objc.id result = OS.objc_msgSend(this.id, OS.sel_appleEvent); | |
42 return result !is null ? new NSAppleEventDescriptor(result) : null; | |
43 } | |
44 | |
45 public NSDictionary arguments () | |
46 { | |
47 objc.id result = OS.objc_msgSend(this.id, OS.sel_arguments); | |
48 return result !is null ? new NSDictionary(result) : null; | |
49 } | |
50 | |
51 public NSScriptCommandDescription commandDescription () | |
52 { | |
53 objc.id result = OS.objc_msgSend(this.id, OS.sel_commandDescription); | |
54 return result !is null ? new NSScriptCommandDescription(result) : null; | |
55 } | |
56 | |
57 public static NSScriptCommand currentCommand () | |
58 { | |
59 objc.id result = OS.objc_msgSend(OS.class_NSScriptCommand, OS.sel_currentCommand); | |
60 return result !is null ? new NSScriptCommand(result) : null; | |
61 } | |
62 | |
63 public id directParameter () | |
64 { | |
65 objc.id result = OS.objc_msgSend(this.id, OS.sel_directParameter); | |
66 return result !is null ? new id(result) : null; | |
67 } | |
68 | |
69 public NSDictionary evaluatedArguments () | |
70 { | |
71 objc.id result = OS.objc_msgSend(this.id, OS.sel_evaluatedArguments); | |
72 return result !is null ? new NSDictionary(result) : null; | |
73 } | |
74 | |
75 public id evaluatedReceivers () | |
76 { | |
77 objc.id result = OS.objc_msgSend(this.id, OS.sel_evaluatedReceivers); | |
78 return result !is null ? new id(result) : null; | |
79 } | |
80 | |
81 public id executeCommand () | |
82 { | |
83 objc.id result = OS.objc_msgSend(this.id, OS.sel_executeCommand); | |
84 return result !is null ? new id(result) : null; | |
85 } | |
86 | |
87 public id initWithCommandDescription (NSScriptCommandDescription commandDef) | |
88 { | |
89 objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithCommandDescription_1, commandDef !is null ? commandDef.id : null); | |
90 return result !is null ? new id(result) : null; | |
91 } | |
92 | |
93 public bool isWellFormed () | |
94 { | |
95 return OS.objc_msgSend(this.id, OS.sel_isWellFormed) !is null; | |
96 } | |
97 | |
98 public id performDefaultImplementation () | |
99 { | |
100 objc.id result = OS.objc_msgSend(this.id, OS.sel_performDefaultImplementation); | |
101 return result !is null ? new id(result) : null; | |
102 } | |
103 | |
104 public NSScriptObjectSpecifier receiversSpecifier () | |
105 { | |
106 objc.id result = OS.objc_msgSend(this.id, OS.sel_receiversSpecifier); | |
107 return result !is null ? new NSScriptObjectSpecifier(result) : null; | |
108 } | |
109 | |
110 public void resumeExecutionWithResult (id result) | |
111 { | |
112 OS.objc_msgSend(this.id, OS.sel_resumeExecutionWithResult_1, result !is null ? result.id : null); | |
113 } | |
114 | |
115 public NSAppleEventDescriptor scriptErrorExpectedTypeDescriptor () | |
116 { | |
117 objc.id result = OS.objc_msgSend(this.id, OS.sel_scriptErrorExpectedTypeDescriptor); | |
118 return result !is null ? new NSAppleEventDescriptor(result) : null; | |
119 } | |
120 | |
121 public int scriptErrorNumber () | |
122 { | |
123 return cast(int) OS.objc_msgSend(this.id, OS.sel_scriptErrorNumber); | |
124 } | |
125 | |
126 public NSAppleEventDescriptor scriptErrorOffendingObjectDescriptor () | |
127 { | |
128 objc.id result = OS.objc_msgSend(this.id, OS.sel_scriptErrorOffendingObjectDescriptor); | |
129 return result !is null ? new NSAppleEventDescriptor(result) : null; | |
130 } | |
131 | |
132 public NSString scriptErrorString () | |
133 { | |
134 objc.id result = OS.objc_msgSend(this.id, OS.sel_scriptErrorString); | |
135 return result !is null ? new NSString(result) : null; | |
136 } | |
137 | |
138 public void setArguments (NSDictionary args) | |
139 { | |
140 OS.objc_msgSend(this.id, OS.sel_setArguments_1, args !is null ? args.id : null); | |
141 } | |
142 | |
143 public void setDirectParameter (id directParameter) | |
144 { | |
145 OS.objc_msgSend(this.id, OS.sel_setDirectParameter_1, directParameter !is null ? directParameter.id : null); | |
146 } | |
147 | |
148 public void setReceiversSpecifier (NSScriptObjectSpecifier receiversRef) | |
149 { | |
150 OS.objc_msgSend(this.id, OS.sel_setReceiversSpecifier_1, receiversRef !is null ? receiversRef.id : null); | |
151 } | |
152 | |
153 public void setScriptErrorExpectedTypeDescriptor (NSAppleEventDescriptor errorExpectedTypeDescriptor) | |
154 { | |
155 OS.objc_msgSend(this.id, OS.sel_setScriptErrorExpectedTypeDescriptor_1, | |
156 errorExpectedTypeDescriptor !is null ? errorExpectedTypeDescriptor.id : null); | |
157 } | |
158 | |
159 public void setScriptErrorNumber (int errorNumber) | |
160 { | |
161 OS.objc_msgSend(this.id, OS.sel_setScriptErrorNumber_1, errorNumber); | |
162 } | |
163 | |
164 public void setScriptErrorOffendingObjectDescriptor (NSAppleEventDescriptor errorOffendingObjectDescriptor) | |
165 { | |
166 OS.objc_msgSend(this.id, OS.sel_setScriptErrorOffendingObjectDescriptor_1, | |
167 errorOffendingObjectDescriptor !is null ? errorOffendingObjectDescriptor.id : null); | |
168 } | |
169 | |
170 public void setScriptErrorString (NSString errorString) | |
171 { | |
172 OS.objc_msgSend(this.id, OS.sel_setScriptErrorString_1, errorString !is null ? errorString.id : null); | |
173 } | |
174 | |
175 public void suspendExecution () | |
176 { | |
177 OS.objc_msgSend(this.id, OS.sel_suspendExecution); | |
178 } | |
179 | |
180 } |