Mercurial > projects > dstep
comparison dstep/appkit/NSTreeController.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.NSTreeController; | |
8 | |
9 import dstep.appkit.NSObjectController; | |
10 import dstep.appkit.NSTreeNode; | |
11 import dstep.foundation.NSArray; | |
12 import dstep.foundation.NSIndexPath; | |
13 import dstep.foundation.NSString; | |
14 import dstep.objc.bridge.Bridge; | |
15 import dstep.objc.objc; | |
16 | |
17 class NSTreeController : NSObjectController | |
18 { | |
19 mixin (ObjcWrap); | |
20 | |
21 void rearrangeObjects () | |
22 { | |
23 return invokeObjcSelf!(void, "rearrangeObjects"); | |
24 } | |
25 | |
26 Object arrangedObjects () | |
27 { | |
28 return invokeObjcSelf!(Object, "arrangedObjects"); | |
29 } | |
30 | |
31 void setChildrenKeyPath (NSString keyPath) | |
32 { | |
33 return invokeObjcSelf!(void, "setChildrenKeyPath:", NSString)(keyPath); | |
34 } | |
35 | |
36 NSString childrenKeyPath () | |
37 { | |
38 return invokeObjcSelf!(NSString, "childrenKeyPath"); | |
39 } | |
40 | |
41 void setCountKeyPath (NSString keyPath) | |
42 { | |
43 return invokeObjcSelf!(void, "setCountKeyPath:", NSString)(keyPath); | |
44 } | |
45 | |
46 NSString countKeyPath () | |
47 { | |
48 return invokeObjcSelf!(NSString, "countKeyPath"); | |
49 } | |
50 | |
51 void setLeafKeyPath (NSString keyPath) | |
52 { | |
53 return invokeObjcSelf!(void, "setLeafKeyPath:", NSString)(keyPath); | |
54 } | |
55 | |
56 NSString leafKeyPath () | |
57 { | |
58 return invokeObjcSelf!(NSString, "leafKeyPath"); | |
59 } | |
60 | |
61 void setSortDescriptors (NSArray sortDescriptors) | |
62 { | |
63 return invokeObjcSelf!(void, "setSortDescriptors:", NSArray)(sortDescriptors); | |
64 } | |
65 | |
66 NSArray sortDescriptors () | |
67 { | |
68 return invokeObjcSelf!(NSArray, "sortDescriptors"); | |
69 } | |
70 | |
71 Object content () | |
72 { | |
73 return invokeObjcSelf!(Object, "content"); | |
74 } | |
75 | |
76 void setContent (Object content) | |
77 { | |
78 return invokeObjcSelf!(void, "setContent:", Object)(content); | |
79 } | |
80 | |
81 void add (Object sender) | |
82 { | |
83 return invokeObjcSelf!(void, "add:", Object)(sender); | |
84 } | |
85 | |
86 void remove (Object sender) | |
87 { | |
88 return invokeObjcSelf!(void, "remove:", Object)(sender); | |
89 } | |
90 | |
91 void addChild (Object sender) | |
92 { | |
93 return invokeObjcSelf!(void, "addChild:", Object)(sender); | |
94 } | |
95 | |
96 void insert (Object sender) | |
97 { | |
98 return invokeObjcSelf!(void, "insert:", Object)(sender); | |
99 } | |
100 | |
101 void insertChild (Object sender) | |
102 { | |
103 return invokeObjcSelf!(void, "insertChild:", Object)(sender); | |
104 } | |
105 | |
106 bool canInsert () | |
107 { | |
108 return invokeObjcSelf!(bool, "canInsert"); | |
109 } | |
110 | |
111 bool canInsertChild () | |
112 { | |
113 return invokeObjcSelf!(bool, "canInsertChild"); | |
114 } | |
115 | |
116 bool canAddChild () | |
117 { | |
118 return invokeObjcSelf!(bool, "canAddChild"); | |
119 } | |
120 | |
121 void insertObject (Object object, NSIndexPath indexPath) | |
122 { | |
123 return invokeObjcSelf!(void, "insertObject:atArrangedObjectIndexPath:", Object, NSIndexPath)(object, indexPath); | |
124 } | |
125 | |
126 void insertObjects (NSArray objects, NSArray indexPaths) | |
127 { | |
128 return invokeObjcSelf!(void, "insertObjects:atArrangedObjectIndexPaths:", NSArray, NSArray)(objects, indexPaths); | |
129 } | |
130 | |
131 void removeObjectAtArrangedObjectIndexPath (NSIndexPath indexPath) | |
132 { | |
133 return invokeObjcSelf!(void, "removeObjectAtArrangedObjectIndexPath:", NSIndexPath)(indexPath); | |
134 } | |
135 | |
136 void removeObjectsAtArrangedObjectIndexPaths (NSArray indexPaths) | |
137 { | |
138 return invokeObjcSelf!(void, "removeObjectsAtArrangedObjectIndexPaths:", NSArray)(indexPaths); | |
139 } | |
140 | |
141 void setAvoidsEmptySelection (bool flag) | |
142 { | |
143 return invokeObjcSelf!(void, "setAvoidsEmptySelection:", bool)(flag); | |
144 } | |
145 | |
146 bool avoidsEmptySelection () | |
147 { | |
148 return invokeObjcSelf!(bool, "avoidsEmptySelection"); | |
149 } | |
150 | |
151 void setPreservesSelection (bool flag) | |
152 { | |
153 return invokeObjcSelf!(void, "setPreservesSelection:", bool)(flag); | |
154 } | |
155 | |
156 bool preservesSelection () | |
157 { | |
158 return invokeObjcSelf!(bool, "preservesSelection"); | |
159 } | |
160 | |
161 void setSelectsInsertedObjects (bool flag) | |
162 { | |
163 return invokeObjcSelf!(void, "setSelectsInsertedObjects:", bool)(flag); | |
164 } | |
165 | |
166 bool selectsInsertedObjects () | |
167 { | |
168 return invokeObjcSelf!(bool, "selectsInsertedObjects"); | |
169 } | |
170 | |
171 void setAlwaysUsesMultipleValuesMarker (bool flag) | |
172 { | |
173 return invokeObjcSelf!(void, "setAlwaysUsesMultipleValuesMarker:", bool)(flag); | |
174 } | |
175 | |
176 bool alwaysUsesMultipleValuesMarker () | |
177 { | |
178 return invokeObjcSelf!(bool, "alwaysUsesMultipleValuesMarker"); | |
179 } | |
180 | |
181 NSArray selectedObjects () | |
182 { | |
183 return invokeObjcSelf!(NSArray, "selectedObjects"); | |
184 } | |
185 | |
186 bool setSelectionIndexPaths (NSArray indexPaths) | |
187 { | |
188 return invokeObjcSelf!(bool, "setSelectionIndexPaths:", NSArray)(indexPaths); | |
189 } | |
190 | |
191 NSArray selectionIndexPaths () | |
192 { | |
193 return invokeObjcSelf!(NSArray, "selectionIndexPaths"); | |
194 } | |
195 | |
196 bool setSelectionIndexPath (NSIndexPath indexPath) | |
197 { | |
198 return invokeObjcSelf!(bool, "setSelectionIndexPath:", NSIndexPath)(indexPath); | |
199 } | |
200 | |
201 NSIndexPath selectionIndexPath () | |
202 { | |
203 return invokeObjcSelf!(NSIndexPath, "selectionIndexPath"); | |
204 } | |
205 | |
206 bool addSelectionIndexPaths (NSArray indexPaths) | |
207 { | |
208 return invokeObjcSelf!(bool, "addSelectionIndexPaths:", NSArray)(indexPaths); | |
209 } | |
210 | |
211 bool removeSelectionIndexPaths (NSArray indexPaths) | |
212 { | |
213 return invokeObjcSelf!(bool, "removeSelectionIndexPaths:", NSArray)(indexPaths); | |
214 } | |
215 | |
216 NSArray selectedNodes () | |
217 { | |
218 return invokeObjcSelf!(NSArray, "selectedNodes"); | |
219 } | |
220 | |
221 void moveNode (NSTreeNode node, NSIndexPath indexPath) | |
222 { | |
223 return invokeObjcSelf!(void, "moveNode:toIndexPath:", NSTreeNode, NSIndexPath)(node, indexPath); | |
224 } | |
225 | |
226 void moveNodes (NSArray nodes, NSIndexPath startingIndexPath) | |
227 { | |
228 return invokeObjcSelf!(void, "moveNodes:toIndexPath:", NSArray, NSIndexPath)(nodes, startingIndexPath); | |
229 } | |
230 | |
231 NSString childrenKeyPathForNode (NSTreeNode node) | |
232 { | |
233 return invokeObjcSelf!(NSString, "childrenKeyPathForNode:", NSTreeNode)(node); | |
234 } | |
235 | |
236 NSString countKeyPathForNode (NSTreeNode node) | |
237 { | |
238 return invokeObjcSelf!(NSString, "countKeyPathForNode:", NSTreeNode)(node); | |
239 } | |
240 | |
241 NSString leafKeyPathForNode (NSTreeNode node) | |
242 { | |
243 return invokeObjcSelf!(NSString, "leafKeyPathForNode:", NSTreeNode)(node); | |
244 } | |
245 } | |
246 |