Mercurial > projects > dwt-mac
diff dwt/internal/cocoa/NSOutlineView.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/NSOutlineView.d Sat Aug 09 17:00:02 2008 +0200 @@ -0,0 +1,172 @@ +/******************************************************************************* + * 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.NSOutlineView; + +import dwt.internal.cocoa.CGFloat; +import dwt.internal.cocoa.NSInteger; +import dwt.internal.cocoa.NSRect; +import dwt.internal.cocoa.NSTableColumn; +import dwt.internal.cocoa.NSTableView; +import dwt.internal.cocoa.OS; +import objc = dwt.internal.objc.runtime; + +public class NSOutlineView : NSTableView +{ + + public this () + { + super(); + } + + public this (objc.id id) + { + super(id); + } + + public bool autoresizesOutlineColumn () + { + return OS.objc_msgSend(this.id, OS.sel_autoresizesOutlineColumn) !is null; + } + + public bool autosaveExpandedItems () + { + return OS.objc_msgSend(this.id, OS.sel_autosaveExpandedItems) !is null; + } + + public void collapseItem_ (id item) + { + OS.objc_msgSend(this.id, OS.sel_collapseItem_1, item !is null ? item.id : null); + } + + public void collapseItem_collapseChildren_ (id item, bool collapseChildren) + { + OS.objc_msgSend(this.id, OS.sel_collapseItem_1collapseChildren_1, item !is null ? item.id : null, collapseChildren); + } + + public void expandItem_ (id item) + { + OS.objc_msgSend(this.id, OS.sel_expandItem_1, item !is null ? item.id : null); + } + + public void expandItem_expandChildren_ (id item, bool expandChildren) + { + OS.objc_msgSend(this.id, OS.sel_expandItem_1expandChildren_1, item !is null ? item.id : null, expandChildren); + } + + public NSRect frameOfOutlineCellAtRow (NSInteger row) + { + NSRect result; + OS.objc_msgSend_stret(result, this.id, OS.sel_frameOfOutlineCellAtRow_1, row); + return result; + } + + public bool indentationMarkerFollowsCell () + { + return OS.objc_msgSend(this.id, OS.sel_indentationMarkerFollowsCell) !is null; + } + + public CGFloat indentationPerLevel () + { + return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_indentationPerLevel); + } + + public bool isExpandable (id item) + { + return OS.objc_msgSend(this.id, OS.sel_isExpandable_1, item !is null ? item.id : null) !is null; + } + + public bool isItemExpanded (id item) + { + return OS.objc_msgSend(this.id, OS.sel_isItemExpanded_1, item !is null ? item.id : null) !is null; + } + + public id itemAtRow (NSInteger row) + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_itemAtRow_1, row); + return result !is null ? new id(result) : null; + } + + public NSInteger levelForItem (id item) + { + return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_levelForItem_1, item !is null ? item.id : null); + } + + public NSInteger levelForRow (NSInteger row) + { + return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_levelForRow_1, row); + } + + public NSTableColumn outlineTableColumn () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_outlineTableColumn); + return result !is null ? new NSTableColumn(result) : null; + } + + public id parentForItem (id item) + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_parentForItem_1, item !is null ? item.id : null); + return result !is null ? new id(result) : null; + } + + public void reloadItem_ (id item) + { + OS.objc_msgSend(this.id, OS.sel_reloadItem_1, item !is null ? item.id : null); + } + + public void reloadItem_reloadChildren_ (id item, bool reloadChildren) + { + OS.objc_msgSend(this.id, OS.sel_reloadItem_1reloadChildren_1, item !is null ? item.id : null, reloadChildren); + } + + public NSInteger rowForItem (id item) + { + return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_rowForItem_1, item !is null ? item.id : null); + } + + public void setAutoresizesOutlineColumn (bool resize) + { + OS.objc_msgSend(this.id, OS.sel_setAutoresizesOutlineColumn_1, resize); + } + + public void setAutosaveExpandedItems (bool save) + { + OS.objc_msgSend(this.id, OS.sel_setAutosaveExpandedItems_1, save); + } + + public void setDropItem (id item, NSInteger index) + { + OS.objc_msgSend(this.id, OS.sel_setDropItem_1dropChildIndex_1, item !is null ? item.id : null, index); + } + + public void setIndentationMarkerFollowsCell (bool drawInCell) + { + OS.objc_msgSend(this.id, OS.sel_setIndentationMarkerFollowsCell_1, drawInCell); + } + + public void setIndentationPerLevel (CGFloat indentationPerLevel) + { + OS.objc_msgSend(this.id, OS.sel_setIndentationPerLevel_1, indentationPerLevel); + } + + public void setOutlineTableColumn (NSTableColumn outlineTableColumn) + { + OS.objc_msgSend(this.id, OS.sel_setOutlineTableColumn_1, outlineTableColumn !is null ? outlineTableColumn.id : null); + } + + public bool shouldCollapseAutoExpandedItemsForDeposited (bool deposited) + { + return OS.objc_msgSend(this.id, OS.sel_shouldCollapseAutoExpandedItemsForDeposited_1, deposited) !is null; + } + +}