Mercurial > projects > dwt-mac
diff dwt/internal/cocoa/NSToolbarItem.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/NSToolbarItem.d Sat Aug 09 17:00:02 2008 +0200 @@ -0,0 +1,220 @@ +/******************************************************************************* + * 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.NSToolbarItem; + +import dwt.internal.cocoa.id; +import dwt.internal.cocoa.NSImage; +import dwt.internal.cocoa.NSInteger; +import dwt.internal.cocoa.NSMenuItem; +import dwt.internal.cocoa.NSObject; +import dwt.internal.cocoa.NSSize; +import dwt.internal.cocoa.NSString; +import dwt.internal.cocoa.NSToolbar; +import dwt.internal.cocoa.NSView; +import dwt.internal.cocoa.OS; +import objc = dwt.internal.objc.runtime; + +public class NSToolbarItem : NSObject +{ + + 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 bool allowsDuplicatesInToolbar () + { + return OS.objc_msgSend(this.id, OS.sel_allowsDuplicatesInToolbar) !is null; + } + + public bool autovalidates () + { + return OS.objc_msgSend(this.id, OS.sel_autovalidates) !is null; + } + + public NSImage image () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_image); + return result !is null ? new NSImage(result) : null; + } + + public id initWithItemIdentifier (NSString itemIdentifier) + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithItemIdentifier_1, itemIdentifier !is null ? itemIdentifier.id : null); + return result !is null ? new id(result) : null; + } + + public bool isEnabled () + { + return OS.objc_msgSend(this.id, OS.sel_isEnabled) !is null; + } + + public NSString itemIdentifier () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_itemIdentifier); + return result !is null ? new NSString(result) : null; + } + + public NSString label () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_label); + return result !is null ? new NSString(result) : null; + } + + public NSSize maxSize () + { + NSSize result; + OS.objc_msgSend_stret(result, this.id, OS.sel_maxSize); + return result; + } + + public NSMenuItem menuFormRepresentation () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_menuFormRepresentation); + return result !is null ? new NSMenuItem(result) : null; + } + + public NSSize minSize () + { + NSSize result; + OS.objc_msgSend_stret(result, this.id, OS.sel_minSize); + return result; + } + + public NSString paletteLabel () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_paletteLabel); + return result !is null ? new NSString(result) : null; + } + + public void setAction (objc.SEL action) + { + OS.objc_msgSend(this.id, OS.sel_setAction_1, action); + } + + public void setAutovalidates (bool resistance) + { + OS.objc_msgSend(this.id, OS.sel_setAutovalidates_1, resistance); + } + + public void setEnabled (bool enabled) + { + OS.objc_msgSend(this.id, OS.sel_setEnabled_1, enabled); + } + + public void setImage (NSImage image) + { + OS.objc_msgSend(this.id, OS.sel_setImage_1, image !is null ? image.id : null); + } + + public void setLabel (NSString label) + { + OS.objc_msgSend(this.id, OS.sel_setLabel_1, label !is null ? label.id : null); + } + + public void setMaxSize (NSSize size) + { + OS.objc_msgSend(this.id, OS.sel_setMaxSize_1, size); + } + + public void setMenuFormRepresentation (NSMenuItem menuItem) + { + OS.objc_msgSend(this.id, OS.sel_setMenuFormRepresentation_1, menuItem !is null ? menuItem.id : null); + } + + public void setMinSize (NSSize size) + { + OS.objc_msgSend(this.id, OS.sel_setMinSize_1, size); + } + + public void setPaletteLabel (NSString paletteLabel) + { + OS.objc_msgSend(this.id, OS.sel_setPaletteLabel_1, paletteLabel !is null ? paletteLabel.id : null); + } + + public void setTag (NSInteger tag) + { + OS.objc_msgSend(this.id, OS.sel_setTag_1, tag); + } + + public void setTarget (id target) + { + OS.objc_msgSend(this.id, OS.sel_setTarget_1, target !is null ? target.id : null); + } + + public void setToolTip (NSString toolTip) + { + OS.objc_msgSend(this.id, OS.sel_setToolTip_1, toolTip !is null ? toolTip.id : null); + } + + public void setView (NSView view) + { + OS.objc_msgSend(this.id, OS.sel_setView_1, view !is null ? view.id : null); + } + + public void setVisibilityPriority (NSInteger visibilityPriority) + { + OS.objc_msgSend(this.id, OS.sel_setVisibilityPriority_1, visibilityPriority); + } + + 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; + } + + public NSString toolTip () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_toolTip); + return result !is null ? new NSString(result) : null; + } + + public NSToolbar toolbar () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_toolbar); + return result !is null ? new NSToolbar(result) : null; + } + + public void validate () + { + OS.objc_msgSend(this.id, OS.sel_validate); + } + + public NSView view () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_view); + return result !is null ? new NSView(result) : null; + } + + public NSInteger visibilityPriority () + { + return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_visibilityPriority); + } + +}