view dwt/internal/cocoa/NSScriptObjectSpecifier.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.NSScriptObjectSpecifier;

import dwt.internal.cocoa.id;
import dwt.internal.cocoa.NSAppleEventDescriptor;
import dwt.internal.cocoa.NSInteger;
import dwt.internal.cocoa.NSObject;
import dwt.internal.cocoa.NSScriptClassDescription;
import dwt.internal.cocoa.NSString;
import dwt.internal.cocoa.OS;
import objc = dwt.internal.objc.runtime;

public class NSScriptObjectSpecifier : NSObject
{

    public this ()
    {
        super();
    }

    public this (objc.id id)
    {
        super(id);
    }

    public NSScriptObjectSpecifier childSpecifier ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_childSpecifier);
        return result is this.id_ ? this : (result !is null ? new NSScriptObjectSpecifier(result) : null);
    }

    public NSScriptClassDescription containerClassDescription ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_containerClassDescription);
        return result !is null ? new NSScriptClassDescription(result) : null;
    }

    public bool containerIsObjectBeingTested ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_containerIsObjectBeingTested) !is null;
    }

    public bool containerIsRangeContainerObject ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_containerIsRangeContainerObject) !is null;
    }

    public NSScriptObjectSpecifier containerSpecifier ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_containerSpecifier);
        return result is this.id_ ? this : (result !is null ? new NSScriptObjectSpecifier(result) : null);
    }

    public NSAppleEventDescriptor descriptor ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_descriptor);
        return result !is null ? new NSAppleEventDescriptor(result) : null;
    }

    public NSInteger evaluationErrorNumber ()
    {
        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_evaluationErrorNumber);
    }

    public NSScriptObjectSpecifier evaluationErrorSpecifier ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_evaluationErrorSpecifier);
        return result is this.id_ ? this : (result !is null ? new NSScriptObjectSpecifier(result) : null);
    }

    public NSInteger* indicesOfObjectsByEvaluatingWithContainer (id container, NSInteger* count)
    {
        return cast(NSInteger*) OS.objc_msgSend(this.id_, OS.sel_indicesOfObjectsByEvaluatingWithContainer_1count_1, container !is null ? container.id_ : null, count);
    }

    public id initWithContainerClassDescription (NSScriptClassDescription classDesc, NSScriptObjectSpecifier container, NSString property)
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithContainerClassDescription_1containerSpecifier_1key_1,
                classDesc !is null ? classDesc.id_ : null, container !is null ? container.id_ : null, property !is null ? property.id_ : null);
        return result !is null ? new id(result) : null;
    }

    public id initWithContainerSpecifier (NSScriptObjectSpecifier container, NSString property)
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithContainerSpecifier_1key_1, container !is null ? container.id_ : null,
                property !is null ? property.id_ : null);
        return result !is null ? new id(result) : null;
    }

    public NSString key ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_key);
        return result !is null ? new NSString(result) : null;
    }

    public NSScriptClassDescription keyClassDescription ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_keyClassDescription);
        return result !is null ? new NSScriptClassDescription(result) : null;
    }

    public static NSScriptObjectSpecifier objectSpecifierWithDescriptor (NSAppleEventDescriptor descriptor)
    {
        objc.id result = OS.objc_msgSend(OS.class_NSScriptObjectSpecifier, OS.sel_objectSpecifierWithDescriptor_1,
                descriptor !is null ? descriptor.id_ : null);
        return result !is null ? new NSScriptObjectSpecifier(result) : null;
    }

    public id objectsByEvaluatingSpecifier ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_objectsByEvaluatingSpecifier);
        return result !is null ? new id(result) : null;
    }

    public id objectsByEvaluatingWithContainers (id containers)
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_objectsByEvaluatingWithContainers_1, containers !is null ? containers.id_ : null);
        return result !is null ? new id(result) : null;
    }

    public void setChildSpecifier (NSScriptObjectSpecifier child)
    {
        OS.objc_msgSend(this.id_, OS.sel_setChildSpecifier_1, child !is null ? child.id_ : null);
    }

    public void setContainerClassDescription (NSScriptClassDescription classDesc)
    {
        OS.objc_msgSend(this.id_, OS.sel_setContainerClassDescription_1, classDesc !is null ? classDesc.id_ : null);
    }

    public void setContainerIsObjectBeingTested (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setContainerIsObjectBeingTested_1, flag);
    }

    public void setContainerIsRangeContainerObject (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setContainerIsRangeContainerObject_1, flag);
    }

    public void setContainerSpecifier (NSScriptObjectSpecifier subRef)
    {
        OS.objc_msgSend(this.id_, OS.sel_setContainerSpecifier_1, subRef !is null ? subRef.id_ : null);
    }

    public void setEvaluationErrorNumber (NSInteger error)
    {
        OS.objc_msgSend(this.id_, OS.sel_setEvaluationErrorNumber_1, error);
    }

    public void setKey (NSString key)
    {
        OS.objc_msgSend(this.id_, OS.sel_setKey_1, key !is null ? key.id_ : null);
    }

}