comparison dwt/internal/cocoa/NSRuleEditor.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.NSRuleEditor;
15
16 import dwt.internal.cocoa.CGFloat;
17 import dwt.internal.cocoa.id;
18 import dwt.internal.cocoa.NSArray;
19 import dwt.internal.cocoa.NSControl;
20 import dwt.internal.cocoa.NSDictionary;
21 import dwt.internal.cocoa.NSIndexSet;
22 import dwt.internal.cocoa.NSInteger;
23 import dwt.internal.cocoa.NSPredicate;
24 import dwt.internal.cocoa.NSString;
25 import dwt.internal.cocoa.OS;
26 import objc = dwt.internal.objc.runtime;
27
28 enum NSRuleEditorRowType : NSUInteger
29 {
30 NSRuleEditorRowTypeSimple,
31 NSRuleEditorRowTypeCompound
32 }
33
34 alias NSRuleEditorRowType.NSRuleEditorRowTypeSimple NSRuleEditorRowTypeSimple;
35 alias NSRuleEditorRowType.NSRuleEditorRowTypeCompound NSRuleEditorRowTypeCompound;
36
37 enum NSRuleEditorNestingMode : NSUInteger
38 {
39 NSRuleEditorNestingModeSingle,
40 NSRuleEditorNestingModeList,
41 NSRuleEditorNestingModeCompound,
42 NSRuleEditorNestingModeSimple
43 }
44
45 alias NSRuleEditorNestingMode.NSRuleEditorNestingModeSingle NSRuleEditorNestingModeSingle;
46 alias NSRuleEditorNestingMode.NSRuleEditorNestingModeList NSRuleEditorNestingModeList;
47 alias NSRuleEditorNestingMode.NSRuleEditorNestingModeCompound NSRuleEditorNestingModeCompound;
48 alias NSRuleEditorNestingMode.NSRuleEditorNestingModeSimple NSRuleEditorNestingModeSimple;
49
50 public class NSRuleEditor : NSControl
51 {
52
53 public this ()
54 {
55 super();
56 }
57
58 public this (objc.id id)
59 {
60 super(id);
61 }
62
63 public void addRow (id sender)
64 {
65 OS.objc_msgSend(this.id, OS.sel_addRow_1, sender !is null ? sender.id : null);
66 }
67
68 public bool canRemoveAllRows ()
69 {
70 return OS.objc_msgSend(this.id, OS.sel_canRemoveAllRows) !is null;
71 }
72
73 public NSArray criteriaForRow (NSInteger row)
74 {
75 objc.id result = OS.objc_msgSend(this.id, OS.sel_criteriaForRow_1, row);
76 return result !is null ? new NSArray(result) : null;
77 }
78
79 public NSString criteriaKeyPath ()
80 {
81 objc.id result = OS.objc_msgSend(this.id, OS.sel_criteriaKeyPath);
82 return result !is null ? new NSString(result) : null;
83 }
84
85 public id delegatee ()
86 {
87 objc.id result = OS.objc_msgSend(this.id, OS.sel_delegate);
88 return result !is null ? new id(result) : null;
89 }
90
91 public NSArray displayValuesForRow (NSInteger row)
92 {
93 objc.id result = OS.objc_msgSend(this.id, OS.sel_displayValuesForRow_1, row);
94 return result !is null ? new NSArray(result) : null;
95 }
96
97 public NSString displayValuesKeyPath ()
98 {
99 objc.id result = OS.objc_msgSend(this.id, OS.sel_displayValuesKeyPath);
100 return result !is null ? new NSString(result) : null;
101 }
102
103 public NSDictionary formattingDictionary ()
104 {
105 objc.id result = OS.objc_msgSend(this.id, OS.sel_formattingDictionary);
106 return result !is null ? new NSDictionary(result) : null;
107 }
108
109 public NSString formattingStringsFilename ()
110 {
111 objc.id result = OS.objc_msgSend(this.id, OS.sel_formattingStringsFilename);
112 return result !is null ? new NSString(result) : null;
113 }
114
115 public void insertRowAtIndex (NSInteger rowIndex, NSRuleEditorRowType rowType, NSInteger parentRow, bool shouldAnimate)
116 {
117 OS.objc_msgSend(this.id, OS.sel_insertRowAtIndex_1withType_1asSubrowOfRow_1animate_1, rowIndex, rowType, parentRow, shouldAnimate);
118 }
119
120 public bool isEditable ()
121 {
122 return OS.objc_msgSend(this.id, OS.sel_isEditable) !is null;
123 }
124
125 public NSRuleEditorNestingMode nestingMode ()
126 {
127 return cast(NSRuleEditorNestingMode) OS.objc_msgSend(this.id, OS.sel_nestingMode);
128 }
129
130 public NSInteger numberOfRows ()
131 {
132 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_numberOfRows);
133 }
134
135 public NSInteger parentRowForRow (NSInteger rowIndex)
136 {
137 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_parentRowForRow_1, rowIndex);
138 }
139
140 public NSPredicate predicate ()
141 {
142 objc.id result = OS.objc_msgSend(this.id, OS.sel_predicate);
143 return result !is null ? new NSPredicate(result) : null;
144 }
145
146 public NSPredicate predicateForRow (NSInteger row)
147 {
148 objc.id result = OS.objc_msgSend(this.id, OS.sel_predicateForRow_1, row);
149 return result !is null ? new NSPredicate(result) : null;
150 }
151
152 public void reloadCriteria ()
153 {
154 OS.objc_msgSend(this.id, OS.sel_reloadCriteria);
155 }
156
157 public void reloadPredicate ()
158 {
159 OS.objc_msgSend(this.id, OS.sel_reloadPredicate);
160 }
161
162 public void removeRowAtIndex (NSInteger rowIndex)
163 {
164 OS.objc_msgSend(this.id, OS.sel_removeRowAtIndex_1, rowIndex);
165 }
166
167 public void removeRowsAtIndexes (NSIndexSet rowIndexes, bool includeSubrows)
168 {
169 OS.objc_msgSend(this.id, OS.sel_removeRowsAtIndexes_1includeSubrows_1, rowIndexes !is null ? rowIndexes.id : null, includeSubrows);
170 }
171
172 public objc.Class rowClass ()
173 {
174 return cast(objc.Class) OS.objc_msgSend(this.id, OS.sel_rowClass);
175 }
176
177 public NSInteger rowForDisplayValue (id displayValue)
178 {
179 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_rowForDisplayValue_1, displayValue !is null ? displayValue.id : null);
180 }
181
182 public CGFloat rowHeight ()
183 {
184 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_rowHeight);
185 }
186
187 public NSRuleEditorRowType rowTypeForRow (NSInteger rowIndex)
188 {
189 return cast(NSRuleEditorRowType) OS.objc_msgSend(this.id, OS.sel_rowTypeForRow_1, rowIndex);
190 }
191
192 public NSString rowTypeKeyPath ()
193 {
194 objc.id result = OS.objc_msgSend(this.id, OS.sel_rowTypeKeyPath);
195 return result !is null ? new NSString(result) : null;
196 }
197
198 public void selectRowIndexes (NSIndexSet indexes, bool extend)
199 {
200 OS.objc_msgSend(this.id, OS.sel_selectRowIndexes_1byExtendingSelection_1, indexes !is null ? indexes.id : null, extend);
201 }
202
203 public NSIndexSet selectedRowIndexes ()
204 {
205 objc.id result = OS.objc_msgSend(this.id, OS.sel_selectedRowIndexes);
206 return result !is null ? new NSIndexSet(result) : null;
207 }
208
209 public void setCanRemoveAllRows (bool val)
210 {
211 OS.objc_msgSend(this.id, OS.sel_setCanRemoveAllRows_1, val);
212 }
213
214 public void setCriteria (NSArray criteria, NSArray values, NSInteger rowIndex)
215 {
216 OS.objc_msgSend(this.id, OS.sel_setCriteria_1andDisplayValues_1forRowAtIndex_1, criteria !is null ? criteria.id : null,
217 values !is null ? values.id : null, rowIndex);
218 }
219
220 public void setCriteriaKeyPath (NSString keyPath)
221 {
222 OS.objc_msgSend(this.id, OS.sel_setCriteriaKeyPath_1, keyPath !is null ? keyPath.id : null);
223 }
224
225 public void setDelegate (id delegatee)
226 {
227 OS.objc_msgSend(this.id, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id : null);
228 }
229
230 public void setDisplayValuesKeyPath (NSString keyPath)
231 {
232 OS.objc_msgSend(this.id, OS.sel_setDisplayValuesKeyPath_1, keyPath !is null ? keyPath.id : null);
233 }
234
235 public void setEditable (bool editable)
236 {
237 OS.objc_msgSend(this.id, OS.sel_setEditable_1, editable);
238 }
239
240 public void setFormattingDictionary (NSDictionary dictionary)
241 {
242 OS.objc_msgSend(this.id, OS.sel_setFormattingDictionary_1, dictionary !is null ? dictionary.id : null);
243 }
244
245 public void setFormattingStringsFilename (NSString stringsFilename)
246 {
247 OS.objc_msgSend(this.id, OS.sel_setFormattingStringsFilename_1, stringsFilename !is null ? stringsFilename.id : null);
248 }
249
250 public void setNestingMode (NSRuleEditorNestingMode mode)
251 {
252 OS.objc_msgSend(this.id, OS.sel_setNestingMode_1, mode);
253 }
254
255 public void setRowClass (objc.Class rowClass)
256 {
257 OS.objc_msgSend(this.id, OS.sel_setRowClass_1, rowClass);
258 }
259
260 public void setRowHeight (CGFloat height)
261 {
262 OS.objc_msgSend(this.id, OS.sel_setRowHeight_1, height);
263 }
264
265 public void setRowTypeKeyPath (NSString keyPath)
266 {
267 OS.objc_msgSend(this.id, OS.sel_setRowTypeKeyPath_1, keyPath !is null ? keyPath.id : null);
268 }
269
270 public void setSubrowsKeyPath (NSString keyPath)
271 {
272 OS.objc_msgSend(this.id, OS.sel_setSubrowsKeyPath_1, keyPath !is null ? keyPath.id : null);
273 }
274
275 public NSIndexSet subrowIndexesForRow (NSInteger rowIndex)
276 {
277 objc.id result = OS.objc_msgSend(this.id, OS.sel_subrowIndexesForRow_1, rowIndex);
278 return result !is null ? new NSIndexSet(result) : null;
279 }
280
281 public NSString subrowsKeyPath ()
282 {
283 objc.id result = OS.objc_msgSend(this.id, OS.sel_subrowsKeyPath);
284 return result !is null ? new NSString(result) : null;
285 }
286
287 }