view dwt/internal/cocoa/NSScriptCommandDescription.d @ 1:8b48be5454ce

The internal cocoa classes compile now
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Tue, 19 Aug 2008 17:35:17 +0200
parents 380af2bdd8e5
children f565d3a95c0a
line wrap: on
line source

/*******************************************************************************
 * 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;
    }

}