Mercurial > projects > dwt-mac
comparison dwt/internal/cocoa/NSTreeController.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.NSTreeController; | |
15 | |
16 import dwt.internal.cocoa.id; | |
17 import dwt.internal.cocoa.NSArray; | |
18 import dwt.internal.cocoa.NSIndexPath; | |
19 import dwt.internal.cocoa.NSObjectController; | |
20 import dwt.internal.cocoa.NSString; | |
21 import dwt.internal.cocoa.NSTreeNode; | |
22 import dwt.internal.cocoa.OS; | |
23 import objc = dwt.internal.objc.runtime; | |
24 | |
25 public class NSTreeController : NSObjectController | |
26 { | |
27 | |
28 public this () | |
29 { | |
30 super(); | |
31 } | |
32 | |
33 public this (objc.id id) | |
34 { | |
35 super(id); | |
36 } | |
37 | |
38 public void add (id sender) | |
39 { | |
40 OS.objc_msgSend(this.id, OS.sel_add_1, sender !is null ? sender.id : null); | |
41 } | |
42 | |
43 public void addChild (id sender) | |
44 { | |
45 OS.objc_msgSend(this.id, OS.sel_addChild_1, sender !is null ? sender.id : null); | |
46 } | |
47 | |
48 public bool addSelectionIndexPaths (NSArray indexPaths) | |
49 { | |
50 return OS.objc_msgSend(this.id, OS.sel_addSelectionIndexPaths_1, indexPaths !is null ? indexPaths.id : null) !is null; | |
51 } | |
52 | |
53 public bool alwaysUsesMultipleValuesMarker () | |
54 { | |
55 return OS.objc_msgSend(this.id, OS.sel_alwaysUsesMultipleValuesMarker) !is null; | |
56 } | |
57 | |
58 public id arrangedObjects () | |
59 { | |
60 objc.id result = OS.objc_msgSend(this.id, OS.sel_arrangedObjects); | |
61 return result !is null ? new id(result) : null; | |
62 } | |
63 | |
64 public bool avoidsEmptySelection () | |
65 { | |
66 return OS.objc_msgSend(this.id, OS.sel_avoidsEmptySelection) !is null; | |
67 } | |
68 | |
69 public bool canAddChild () | |
70 { | |
71 return OS.objc_msgSend(this.id, OS.sel_canAddChild) !is null; | |
72 } | |
73 | |
74 public bool canInsert () | |
75 { | |
76 return OS.objc_msgSend(this.id, OS.sel_canInsert) !is null; | |
77 } | |
78 | |
79 public bool canInsertChild () | |
80 { | |
81 return OS.objc_msgSend(this.id, OS.sel_canInsertChild) !is null; | |
82 } | |
83 | |
84 public NSString childrenKeyPath () | |
85 { | |
86 objc.id result = OS.objc_msgSend(this.id, OS.sel_childrenKeyPath); | |
87 return result !is null ? new NSString(result) : null; | |
88 } | |
89 | |
90 public NSString childrenKeyPathForNode (NSTreeNode node) | |
91 { | |
92 objc.id result = OS.objc_msgSend(this.id, OS.sel_childrenKeyPathForNode_1, node !is null ? node.id : null); | |
93 return result !is null ? new NSString(result) : null; | |
94 } | |
95 | |
96 public id content () | |
97 { | |
98 objc.id result = OS.objc_msgSend(this.id, OS.sel_content); | |
99 return result !is null ? new id(result) : null; | |
100 } | |
101 | |
102 public NSString countKeyPath () | |
103 { | |
104 objc.id result = OS.objc_msgSend(this.id, OS.sel_countKeyPath); | |
105 return result !is null ? new NSString(result) : null; | |
106 } | |
107 | |
108 public NSString countKeyPathForNode (NSTreeNode node) | |
109 { | |
110 objc.id result = OS.objc_msgSend(this.id, OS.sel_countKeyPathForNode_1, node !is null ? node.id : null); | |
111 return result !is null ? new NSString(result) : null; | |
112 } | |
113 | |
114 public void insert (id sender) | |
115 { | |
116 OS.objc_msgSend(this.id, OS.sel_insert_1, sender !is null ? sender.id : null); | |
117 } | |
118 | |
119 public void insertChild (id sender) | |
120 { | |
121 OS.objc_msgSend(this.id, OS.sel_insertChild_1, sender !is null ? sender.id : null); | |
122 } | |
123 | |
124 public void insertObject (id object, NSIndexPath indexPath) | |
125 { | |
126 OS.objc_msgSend(this.id, OS.sel_insertObject_1atArrangedObjectIndexPath_1, object !is null ? object.id : null, | |
127 indexPath !is null ? indexPath.id : null); | |
128 } | |
129 | |
130 public void insertObjects (NSArray objects, NSArray indexPaths) | |
131 { | |
132 OS.objc_msgSend(this.id, OS.sel_insertObjects_1atArrangedObjectIndexPaths_1, objects !is null ? objects.id : null, | |
133 indexPaths !is null ? indexPaths.id : null); | |
134 } | |
135 | |
136 public NSString leafKeyPath () | |
137 { | |
138 objc.id result = OS.objc_msgSend(this.id, OS.sel_leafKeyPath); | |
139 return result !is null ? new NSString(result) : null; | |
140 } | |
141 | |
142 public NSString leafKeyPathForNode (NSTreeNode node) | |
143 { | |
144 objc.id result = OS.objc_msgSend(this.id, OS.sel_leafKeyPathForNode_1, node !is null ? node.id : null); | |
145 return result !is null ? new NSString(result) : null; | |
146 } | |
147 | |
148 public void moveNode (NSTreeNode node, NSIndexPath indexPath) | |
149 { | |
150 OS.objc_msgSend(this.id, OS.sel_moveNode_1toIndexPath_1, node !is null ? node.id : null, indexPath !is null ? indexPath.id : null); | |
151 } | |
152 | |
153 public void moveNodes (NSArray nodes, NSIndexPath startingIndexPath) | |
154 { | |
155 OS.objc_msgSend(this.id, OS.sel_moveNodes_1toIndexPath_1, nodes !is null ? nodes.id : null, | |
156 startingIndexPath !is null ? startingIndexPath.id : null); | |
157 } | |
158 | |
159 public bool preservesSelection () | |
160 { | |
161 return OS.objc_msgSend(this.id, OS.sel_preservesSelection) !is null; | |
162 } | |
163 | |
164 public void rearrangeObjects () | |
165 { | |
166 OS.objc_msgSend(this.id, OS.sel_rearrangeObjects); | |
167 } | |
168 | |
169 public void remove (id sender) | |
170 { | |
171 OS.objc_msgSend(this.id, OS.sel_remove_1, sender !is null ? sender.id : null); | |
172 } | |
173 | |
174 public void removeObjectAtArrangedObjectIndexPath (NSIndexPath indexPath) | |
175 { | |
176 OS.objc_msgSend(this.id, OS.sel_removeObjectAtArrangedObjectIndexPath_1, indexPath !is null ? indexPath.id : null); | |
177 } | |
178 | |
179 public void removeObjectsAtArrangedObjectIndexPaths (NSArray indexPaths) | |
180 { | |
181 OS.objc_msgSend(this.id, OS.sel_removeObjectsAtArrangedObjectIndexPaths_1, indexPaths !is null ? indexPaths.id : null); | |
182 } | |
183 | |
184 public bool removeSelectionIndexPaths (NSArray indexPaths) | |
185 { | |
186 return OS.objc_msgSend(this.id, OS.sel_removeSelectionIndexPaths_1, indexPaths !is null ? indexPaths.id : null) !is null; | |
187 } | |
188 | |
189 public NSArray selectedNodes () | |
190 { | |
191 objc.id result = OS.objc_msgSend(this.id, OS.sel_selectedNodes); | |
192 return result !is null ? new NSArray(result) : null; | |
193 } | |
194 | |
195 public NSArray selectedObjects () | |
196 { | |
197 objc.id result = OS.objc_msgSend(this.id, OS.sel_selectedObjects); | |
198 return result !is null ? new NSArray(result) : null; | |
199 } | |
200 | |
201 public NSIndexPath selectionIndexPath () | |
202 { | |
203 objc.id result = OS.objc_msgSend(this.id, OS.sel_selectionIndexPath); | |
204 return result !is null ? new NSIndexPath(result) : null; | |
205 } | |
206 | |
207 public NSArray selectionIndexPaths () | |
208 { | |
209 objc.id result = OS.objc_msgSend(this.id, OS.sel_selectionIndexPaths); | |
210 return result !is null ? new NSArray(result) : null; | |
211 } | |
212 | |
213 public bool selectsInsertedObjects () | |
214 { | |
215 return OS.objc_msgSend(this.id, OS.sel_selectsInsertedObjects) !is null; | |
216 } | |
217 | |
218 public void setAlwaysUsesMultipleValuesMarker (bool flag) | |
219 { | |
220 OS.objc_msgSend(this.id, OS.sel_setAlwaysUsesMultipleValuesMarker_1, flag); | |
221 } | |
222 | |
223 public void setAvoidsEmptySelection (bool flag) | |
224 { | |
225 OS.objc_msgSend(this.id, OS.sel_setAvoidsEmptySelection_1, flag); | |
226 } | |
227 | |
228 public void setChildrenKeyPath (NSString keyPath) | |
229 { | |
230 OS.objc_msgSend(this.id, OS.sel_setChildrenKeyPath_1, keyPath !is null ? keyPath.id : null); | |
231 } | |
232 | |
233 public void setContent (id content) | |
234 { | |
235 OS.objc_msgSend(this.id, OS.sel_setContent_1, content !is null ? content.id : null); | |
236 } | |
237 | |
238 public void setCountKeyPath (NSString keyPath) | |
239 { | |
240 OS.objc_msgSend(this.id, OS.sel_setCountKeyPath_1, keyPath !is null ? keyPath.id : null); | |
241 } | |
242 | |
243 public void setLeafKeyPath (NSString keyPath) | |
244 { | |
245 OS.objc_msgSend(this.id, OS.sel_setLeafKeyPath_1, keyPath !is null ? keyPath.id : null); | |
246 } | |
247 | |
248 public void setPreservesSelection (bool flag) | |
249 { | |
250 OS.objc_msgSend(this.id, OS.sel_setPreservesSelection_1, flag); | |
251 } | |
252 | |
253 public bool setSelectionIndexPath (NSIndexPath indexPath) | |
254 { | |
255 return OS.objc_msgSend(this.id, OS.sel_setSelectionIndexPath_1, indexPath !is null ? indexPath.id : null) !is null; | |
256 } | |
257 | |
258 public bool setSelectionIndexPaths (NSArray indexPaths) | |
259 { | |
260 return OS.objc_msgSend(this.id, OS.sel_setSelectionIndexPaths_1, indexPaths !is null ? indexPaths.id : null) !is null; | |
261 } | |
262 | |
263 public void setSelectsInsertedObjects (bool flag) | |
264 { | |
265 OS.objc_msgSend(this.id, OS.sel_setSelectsInsertedObjects_1, flag); | |
266 } | |
267 | |
268 public void setSortDescriptors (NSArray sortDescriptors) | |
269 { | |
270 OS.objc_msgSend(this.id, OS.sel_setSortDescriptors_1, sortDescriptors !is null ? sortDescriptors.id : null); | |
271 } | |
272 | |
273 public NSArray sortDescriptors () | |
274 { | |
275 objc.id result = OS.objc_msgSend(this.id, OS.sel_sortDescriptors); | |
276 return result !is null ? new NSArray(result) : null; | |
277 } | |
278 | |
279 } |