Mercurial > projects > dwt-mac
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwt/internal/cocoa/NSScriptCommand.d Sat Aug 09 17:00:02 2008 +0200 @@ -0,0 +1,180 @@ +/******************************************************************************* + * 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.NSScriptCommand; + +import dwt.internal.cocoa.id; +import dwt.internal.cocoa.NSAppleEventDescriptor; +import dwt.internal.cocoa.NSDictionary; +import dwt.internal.cocoa.NSObject; +import dwt.internal.cocoa.NSScriptCommandDescription; +import dwt.internal.cocoa.NSScriptObjectSpecifier; +import dwt.internal.cocoa.NSString; +import dwt.internal.cocoa.OS; +import objc = dwt.internal.objc.runtime; + +public class NSScriptCommand : NSObject +{ + + public this () + { + super(); + } + + public this (objc.id id) + { + super(id); + } + + public NSAppleEventDescriptor appleEvent () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_appleEvent); + return result !is null ? new NSAppleEventDescriptor(result) : null; + } + + public NSDictionary arguments () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_arguments); + return result !is null ? new NSDictionary(result) : null; + } + + public NSScriptCommandDescription commandDescription () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_commandDescription); + return result !is null ? new NSScriptCommandDescription(result) : null; + } + + public static NSScriptCommand currentCommand () + { + objc.id result = OS.objc_msgSend(OS.class_NSScriptCommand, OS.sel_currentCommand); + return result !is null ? new NSScriptCommand(result) : null; + } + + public id directParameter () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_directParameter); + return result !is null ? new id(result) : null; + } + + public NSDictionary evaluatedArguments () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_evaluatedArguments); + return result !is null ? new NSDictionary(result) : null; + } + + public id evaluatedReceivers () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_evaluatedReceivers); + return result !is null ? new id(result) : null; + } + + public id executeCommand () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_executeCommand); + return result !is null ? new id(result) : null; + } + + public id initWithCommandDescription (NSScriptCommandDescription commandDef) + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithCommandDescription_1, commandDef !is null ? commandDef.id : null); + return result !is null ? new id(result) : null; + } + + public bool isWellFormed () + { + return OS.objc_msgSend(this.id, OS.sel_isWellFormed) !is null; + } + + public id performDefaultImplementation () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_performDefaultImplementation); + return result !is null ? new id(result) : null; + } + + public NSScriptObjectSpecifier receiversSpecifier () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_receiversSpecifier); + return result !is null ? new NSScriptObjectSpecifier(result) : null; + } + + public void resumeExecutionWithResult (id result) + { + OS.objc_msgSend(this.id, OS.sel_resumeExecutionWithResult_1, result !is null ? result.id : null); + } + + public NSAppleEventDescriptor scriptErrorExpectedTypeDescriptor () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_scriptErrorExpectedTypeDescriptor); + return result !is null ? new NSAppleEventDescriptor(result) : null; + } + + public int scriptErrorNumber () + { + return cast(int) OS.objc_msgSend(this.id, OS.sel_scriptErrorNumber); + } + + public NSAppleEventDescriptor scriptErrorOffendingObjectDescriptor () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_scriptErrorOffendingObjectDescriptor); + return result !is null ? new NSAppleEventDescriptor(result) : null; + } + + public NSString scriptErrorString () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_scriptErrorString); + return result !is null ? new NSString(result) : null; + } + + public void setArguments (NSDictionary args) + { + OS.objc_msgSend(this.id, OS.sel_setArguments_1, args !is null ? args.id : null); + } + + public void setDirectParameter (id directParameter) + { + OS.objc_msgSend(this.id, OS.sel_setDirectParameter_1, directParameter !is null ? directParameter.id : null); + } + + public void setReceiversSpecifier (NSScriptObjectSpecifier receiversRef) + { + OS.objc_msgSend(this.id, OS.sel_setReceiversSpecifier_1, receiversRef !is null ? receiversRef.id : null); + } + + public void setScriptErrorExpectedTypeDescriptor (NSAppleEventDescriptor errorExpectedTypeDescriptor) + { + OS.objc_msgSend(this.id, OS.sel_setScriptErrorExpectedTypeDescriptor_1, + errorExpectedTypeDescriptor !is null ? errorExpectedTypeDescriptor.id : null); + } + + public void setScriptErrorNumber (int errorNumber) + { + OS.objc_msgSend(this.id, OS.sel_setScriptErrorNumber_1, errorNumber); + } + + public void setScriptErrorOffendingObjectDescriptor (NSAppleEventDescriptor errorOffendingObjectDescriptor) + { + OS.objc_msgSend(this.id, OS.sel_setScriptErrorOffendingObjectDescriptor_1, + errorOffendingObjectDescriptor !is null ? errorOffendingObjectDescriptor.id : null); + } + + public void setScriptErrorString (NSString errorString) + { + OS.objc_msgSend(this.id, OS.sel_setScriptErrorString_1, errorString !is null ? errorString.id : null); + } + + public void suspendExecution () + { + OS.objc_msgSend(this.id, OS.sel_suspendExecution); + } + +}