comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:380af2bdd8e5
1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *
11 * Port to the D Programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com>
13 *******************************************************************************/
14 module dwt.internal.cocoa.NSCollectionView;
15
16 import dwt.internal.cocoa.NSArray;
17 import dwt.internal.cocoa.NSCollectionViewItem;
18 import dwt.internal.cocoa.NSIndexSet;
19 import dwt.internal.cocoa.NSSize;
20 import dwt.internal.cocoa.NSView;
21 import dwt.internal.cocoa.OS;
22 import objc = dwt.internal.objc.runtime;
23
24 public class NSCollectionView : NSView
25 {
26
27 public this ()
28 {
29 super();
30 }
31
32 public this (objc.id id)
33 {
34 super(id);
35 }
36
37 public bool allowsMultipleSelection ()
38 {
39 return OS.objc_msgSend(this.id, OS.sel_allowsMultipleSelection) !is null;
40 }
41
42 public NSArray backgroundColors ()
43 {
44 objc.id result = OS.objc_msgSend(this.id, OS.sel_backgroundColors);
45 return result !is null ? new NSArray(result) : null;
46 }
47
48 public NSArray content ()
49 {
50 objc.id result = OS.objc_msgSend(this.id, OS.sel_content);
51 return result !is null ? new NSArray(result) : null;
52 }
53
54 public bool isFirstResponder ()
55 {
56 return OS.objc_msgSend(this.id, OS.sel_isFirstResponder) !is null;
57 }
58
59 public bool isSelectable ()
60 {
61 return OS.objc_msgSend(this.id, OS.sel_isSelectable) !is null;
62 }
63
64 public NSCollectionViewItem itemPrototype ()
65 {
66 objc.id result = OS.objc_msgSend(this.id, OS.sel_itemPrototype);
67 return result !is null ? new NSCollectionViewItem(result) : null;
68 }
69
70 public NSSize maxItemSize ()
71 {
72 NSSize result;
73 OS.objc_msgSend_stret(result, this.id, OS.sel_maxItemSize);
74 return result;
75 }
76
77 public NSUInteger maxNumberOfColumns ()
78 {
79 return OS.objc_msgSend(this.id, OS.sel_maxNumberOfColumns);
80 }
81
82 public NSUInteger maxNumberOfRows ()
83 {
84 return OS.objc_msgSend(this.id, OS.sel_maxNumberOfRows);
85 }
86
87 public NSSize minItemSize ()
88 {
89 NSSize result;
90 OS.objc_msgSend_stret(result, this.id, OS.sel_minItemSize);
91 return result;
92 }
93
94 public NSCollectionViewItem newItemForRepresentedObject (id object)
95 {
96 objc.id result = OS.objc_msgSend(this.id, OS.sel_newItemForRepresentedObject_1, object !is null ? object.id : null);
97 return result !is null ? new NSCollectionViewItem(result) : null;
98 }
99
100 public NSIndexSet selectionIndexes ()
101 {
102 objc.id result = OS.objc_msgSend(this.id, OS.sel_selectionIndexes);
103 return result !is null ? new NSIndexSet(result) : null;
104 }
105
106 public void setAllowsMultipleSelection (bool flag)
107 {
108 OS.objc_msgSend(this.id, OS.sel_setAllowsMultipleSelection_1, flag);
109 }
110
111 public void setBackgroundColors (NSArray colors)
112 {
113 OS.objc_msgSend(this.id, OS.sel_setBackgroundColors_1, colors !is null ? colors.id : null);
114 }
115
116 public void setContent (NSArray content)
117 {
118 OS.objc_msgSend(this.id, OS.sel_setContent_1, content !is null ? content.id : null);
119 }
120
121 public void setItemPrototype (NSCollectionViewItem prototype)
122 {
123 OS.objc_msgSend(this.id, OS.sel_setItemPrototype_1, prototype !is null ? prototype.id : null);
124 }
125
126 public void setMaxItemSize (NSSize size)
127 {
128 OS.objc_msgSend(this.id, OS.sel_setMaxItemSize_1, size);
129 }
130
131 public void setMaxNumberOfColumns (NSUInteger number)
132 {
133 OS.objc_msgSend(this.id, OS.sel_setMaxNumberOfColumns_1, number);
134 }
135
136 public void setMaxNumberOfRows (NSUInteger number)
137 {
138 OS.objc_msgSend(this.id, OS.sel_setMaxNumberOfRows_1, number);
139 }
140
141 public void setMinItemSize (NSSize size)
142 {
143 OS.objc_msgSend(this.id, OS.sel_setMinItemSize_1, size);
144 }
145
146 public void setSelectable (bool flag)
147 {
148 OS.objc_msgSend(this.id, OS.sel_setSelectable_1, flag);
149 }
150
151 public void setSelectionIndexes (NSIndexSet indexes)
152 {
153 OS.objc_msgSend(this.id, OS.sel_setSelectionIndexes_1, indexes !is null ? indexes.id : null);
154 }
155
156 }