Mercurial > projects > dwt-mac
diff dwt/internal/cocoa/NSCollectionView.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/NSCollectionView.d Sat Aug 09 17:00:02 2008 +0200 @@ -0,0 +1,156 @@ +/******************************************************************************* + * 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.NSCollectionView; + +import dwt.internal.cocoa.NSArray; +import dwt.internal.cocoa.NSCollectionViewItem; +import dwt.internal.cocoa.NSIndexSet; +import dwt.internal.cocoa.NSSize; +import dwt.internal.cocoa.NSView; +import dwt.internal.cocoa.OS; +import objc = dwt.internal.objc.runtime; + +public class NSCollectionView : NSView +{ + + public this () + { + super(); + } + + public this (objc.id id) + { + super(id); + } + + public bool allowsMultipleSelection () + { + return OS.objc_msgSend(this.id, OS.sel_allowsMultipleSelection) !is null; + } + + public NSArray backgroundColors () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_backgroundColors); + return result !is null ? new NSArray(result) : null; + } + + public NSArray content () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_content); + return result !is null ? new NSArray(result) : null; + } + + public bool isFirstResponder () + { + return OS.objc_msgSend(this.id, OS.sel_isFirstResponder) !is null; + } + + public bool isSelectable () + { + return OS.objc_msgSend(this.id, OS.sel_isSelectable) !is null; + } + + public NSCollectionViewItem itemPrototype () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_itemPrototype); + return result !is null ? new NSCollectionViewItem(result) : null; + } + + public NSSize maxItemSize () + { + NSSize result; + OS.objc_msgSend_stret(result, this.id, OS.sel_maxItemSize); + return result; + } + + public NSUInteger maxNumberOfColumns () + { + return OS.objc_msgSend(this.id, OS.sel_maxNumberOfColumns); + } + + public NSUInteger maxNumberOfRows () + { + return OS.objc_msgSend(this.id, OS.sel_maxNumberOfRows); + } + + public NSSize minItemSize () + { + NSSize result; + OS.objc_msgSend_stret(result, this.id, OS.sel_minItemSize); + return result; + } + + public NSCollectionViewItem newItemForRepresentedObject (id object) + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_newItemForRepresentedObject_1, object !is null ? object.id : null); + return result !is null ? new NSCollectionViewItem(result) : null; + } + + public NSIndexSet selectionIndexes () + { + objc.id result = OS.objc_msgSend(this.id, OS.sel_selectionIndexes); + return result !is null ? new NSIndexSet(result) : null; + } + + public void setAllowsMultipleSelection (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setAllowsMultipleSelection_1, flag); + } + + public void setBackgroundColors (NSArray colors) + { + OS.objc_msgSend(this.id, OS.sel_setBackgroundColors_1, colors !is null ? colors.id : null); + } + + public void setContent (NSArray content) + { + OS.objc_msgSend(this.id, OS.sel_setContent_1, content !is null ? content.id : null); + } + + public void setItemPrototype (NSCollectionViewItem prototype) + { + OS.objc_msgSend(this.id, OS.sel_setItemPrototype_1, prototype !is null ? prototype.id : null); + } + + public void setMaxItemSize (NSSize size) + { + OS.objc_msgSend(this.id, OS.sel_setMaxItemSize_1, size); + } + + public void setMaxNumberOfColumns (NSUInteger number) + { + OS.objc_msgSend(this.id, OS.sel_setMaxNumberOfColumns_1, number); + } + + public void setMaxNumberOfRows (NSUInteger number) + { + OS.objc_msgSend(this.id, OS.sel_setMaxNumberOfRows_1, number); + } + + public void setMinItemSize (NSSize size) + { + OS.objc_msgSend(this.id, OS.sel_setMinItemSize_1, size); + } + + public void setSelectable (bool flag) + { + OS.objc_msgSend(this.id, OS.sel_setSelectable_1, flag); + } + + public void setSelectionIndexes (NSIndexSet indexes) + { + OS.objc_msgSend(this.id, OS.sel_setSelectionIndexes_1, indexes !is null ? indexes.id : null); + } + +}