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

import dwt.internal.cocoa.id;
import dwt.internal.cocoa.NSCell;
import dwt.internal.cocoa.NSFont;
import dwt.internal.cocoa.NSImage;
import dwt.internal.cocoa.NSInteger;
import dwt.internal.cocoa.NSString;
import dwt.internal.cocoa.NSView;
import dwt.internal.cocoa.OS;
import objc = dwt.internal.objc.runtime;

public class NSActionCell : NSCell
{
    public this ()
    {
        super();
    }

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

    public objc.SEL action ()
    {
        return cast(objc.SEL) OS.objc_msgSend(this.id_, OS.sel_action);
    }

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

    public double doubleValue ()
    {
        return cast(double) OS.objc_msgSend_fpret(this.id_, OS.sel_doubleValue);
    }

    public float floatValue ()
    {
        return cast(float) OS.objc_msgSend_fpret(this.id_, OS.sel_floatValue);
    }

    public int intValue ()
    {
        return cast(int) OS.objc_msgSend(this.id_, OS.sel_intValue);
    }

    public NSInteger integerValue ()
    {
        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_integerValue);
    }

    public void setAction (objc.SEL aSelector)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAction_1, aSelector);
    }

    public void setAlignment (objc.id mode)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAlignment_1, mode);
    }

    public void setBezeled (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setBezeled_1, flag);
    }

    public void setBordered (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setBordered_1, flag);
    }

    public void setControlView (NSView view)
    {
        OS.objc_msgSend(this.id_, OS.sel_setControlView_1, view !is null ? view.id_ : null);
    }

    public void setEnabled (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setEnabled_1, flag);
    }

    public void setFloatingPointFormat (bool autoRange, NSUInteger leftDigits, NSUInteger rightDigits)
    {
        OS.objc_msgSend(this.id_, OS.sel_setFloatingPointFormat_1left_1right_1, autoRange, leftDigits, rightDigits);
    }

    public void setFont (NSFont fontObj)
    {
        OS.objc_msgSend(this.id_, OS.sel_setFont_1, fontObj !is null ? fontObj.id_ : null);
    }

    public void setImage (NSImage image)
    {
        OS.objc_msgSend(this.id_, OS.sel_setImage_1, image !is null ? image.id_ : null);
    }

    public void setObjectValue (id obj)
    {
        OS.objc_msgSend(this.id_, OS.sel_setObjectValue_1, obj !is null ? obj.id_ : null);
    }

    public void setTag (NSInteger anInt)
    {
        OS.objc_msgSend(this.id_, OS.sel_setTag_1, anInt);
    }

    public void setTarget (id anObject)
    {
        OS.objc_msgSend(this.id_, OS.sel_setTarget_1, anObject !is null ? anObject.id_ : null);
    }

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

    public NSInteger tag ()
    {
        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_tag);
    }

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

}