Mercurial > projects > dstep
comparison dstep/appkit/NSCollectionView.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | |
children | b9de51448c6b |
comparison
equal
deleted
inserted
replaced
15:7ff919f595d5 | 16:19885b43130e |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Sep 24, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.appkit.NSCollectionView; | |
8 | |
9 import dstep.appkit.NSAnimation; | |
10 import dstep.appkit.NSView; | |
11 import dstep.foundation.NSArray; | |
12 import dstep.foundation.NSCoder; | |
13 import dstep.foundation.NSData; | |
14 import dstep.foundation.NSGeometry; | |
15 import dstep.foundation.NSIndexSet; | |
16 import dstep.foundation.NSObjCRuntime; | |
17 import dstep.foundation.NSObject; | |
18 import dstep.foundation.NSSet; | |
19 import dstep.foundation.NSZone; | |
20 import dstep.objc.bridge.Bridge; | |
21 import dstep.objc.objc; | |
22 | |
23 class NSCollectionViewItem : NSObject, INSCopying, INSCoding | |
24 { | |
25 mixin (ObjcWrap); | |
26 | |
27 this (NSCoder aDecoder) | |
28 { | |
29 super(typeof(this).alloc.initWithCoder(aDecoder).objcObject); | |
30 } | |
31 | |
32 void encodeWithCoder (NSCoder aCoder) | |
33 { | |
34 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder); | |
35 } | |
36 | |
37 typeof(this) initWithCoder (NSCoder aDecoder) | |
38 { | |
39 return invokeObjcSelf!(typeof(this), "initWithCoder:", NSCoder)(aDecoder); | |
40 } | |
41 | |
42 typeof(this) copyWithZone (NSZone* zone) | |
43 { | |
44 return invokeObjcSelf!(typeof(this), "copyWithZone:", NSZone*)(zone); | |
45 } | |
46 | |
47 NSCollectionView collectionView () | |
48 { | |
49 return invokeObjcSelf!(NSCollectionView, "collectionView"); | |
50 } | |
51 | |
52 void setRepresentedObject (Object object) | |
53 { | |
54 return invokeObjcSelf!(void, "setRepresentedObject:", Object)(object); | |
55 } | |
56 | |
57 Object representedObject () | |
58 { | |
59 return invokeObjcSelf!(Object, "representedObject"); | |
60 } | |
61 | |
62 void setView (NSView view) | |
63 { | |
64 return invokeObjcSelf!(void, "setView:", NSView)(view); | |
65 } | |
66 | |
67 NSView view () | |
68 { | |
69 return invokeObjcSelf!(NSView, "view"); | |
70 } | |
71 | |
72 void setSelected (bool flag) | |
73 { | |
74 return invokeObjcSelf!(void, "setSelected:", bool)(flag); | |
75 } | |
76 | |
77 bool isSelected () | |
78 { | |
79 return invokeObjcSelf!(bool, "isSelected"); | |
80 } | |
81 | |
82 } | |
83 | |
84 class NSCollectionView : NSView | |
85 { | |
86 mixin (ObjcWrap); | |
87 | |
88 bool isFirstResponder () | |
89 { | |
90 return invokeObjcSelf!(bool, "isFirstResponder"); | |
91 } | |
92 | |
93 void setContent (NSArray content) | |
94 { | |
95 return invokeObjcSelf!(void, "setContent:", NSArray)(content); | |
96 } | |
97 | |
98 NSArray content () | |
99 { | |
100 return invokeObjcSelf!(NSArray, "content"); | |
101 } | |
102 | |
103 void setSelectable (bool flag) | |
104 { | |
105 return invokeObjcSelf!(void, "setSelectable:", bool)(flag); | |
106 } | |
107 | |
108 bool isSelectable () | |
109 { | |
110 return invokeObjcSelf!(bool, "isSelectable"); | |
111 } | |
112 | |
113 void setAllowsMultipleSelection (bool flag) | |
114 { | |
115 return invokeObjcSelf!(void, "setAllowsMultipleSelection:", bool)(flag); | |
116 } | |
117 | |
118 bool allowsMultipleSelection () | |
119 { | |
120 return invokeObjcSelf!(bool, "allowsMultipleSelection"); | |
121 } | |
122 | |
123 void setSelectionIndexes (NSIndexSet indexes) | |
124 { | |
125 return invokeObjcSelf!(void, "setSelectionIndexes:", NSIndexSet)(indexes); | |
126 } | |
127 | |
128 NSIndexSet selectionIndexes () | |
129 { | |
130 return invokeObjcSelf!(NSIndexSet, "selectionIndexes"); | |
131 } | |
132 | |
133 NSCollectionViewItem newItemForRepresentedObject (Object object) | |
134 { | |
135 return invokeObjcSelf!(NSCollectionViewItem, "newItemForRepresentedObject:", Object)(object); | |
136 } | |
137 | |
138 void setItemPrototype (NSCollectionViewItem prototype) | |
139 { | |
140 return invokeObjcSelf!(void, "setItemPrototype:", NSCollectionViewItem)(prototype); | |
141 } | |
142 | |
143 NSCollectionViewItem itemPrototype () | |
144 { | |
145 return invokeObjcSelf!(NSCollectionViewItem, "itemPrototype"); | |
146 } | |
147 | |
148 void setMaxNumberOfRows (NSUInteger number) | |
149 { | |
150 return invokeObjcSelf!(void, "setMaxNumberOfRows:", NSUInteger)(number); | |
151 } | |
152 | |
153 NSUInteger maxNumberOfRows () | |
154 { | |
155 return invokeObjcSelf!(NSUInteger, "maxNumberOfRows"); | |
156 } | |
157 | |
158 void setMaxNumberOfColumns (NSUInteger number) | |
159 { | |
160 return invokeObjcSelf!(void, "setMaxNumberOfColumns:", NSUInteger)(number); | |
161 } | |
162 | |
163 NSUInteger maxNumberOfColumns () | |
164 { | |
165 return invokeObjcSelf!(NSUInteger, "maxNumberOfColumns"); | |
166 } | |
167 | |
168 void setMinItemSize (NSSize size) | |
169 { | |
170 return invokeObjcSelf!(void, "setMinItemSize:", NSSize)(size); | |
171 } | |
172 | |
173 NSSize minItemSize () | |
174 { | |
175 return invokeObjcSelf!(NSSize, "minItemSize"); | |
176 } | |
177 | |
178 void setMaxItemSize (NSSize size) | |
179 { | |
180 return invokeObjcSelf!(void, "setMaxItemSize:", NSSize)(size); | |
181 } | |
182 | |
183 NSSize maxItemSize () | |
184 { | |
185 return invokeObjcSelf!(NSSize, "maxItemSize"); | |
186 } | |
187 | |
188 void setBackgroundColors (NSArray colors) | |
189 { | |
190 return invokeObjcSelf!(void, "setBackgroundColors:", NSArray)(colors); | |
191 } | |
192 | |
193 NSArray backgroundColors () | |
194 { | |
195 return invokeObjcSelf!(NSArray, "backgroundColors"); | |
196 } | |
197 } | |
198 |