comparison dwt/internal/cocoa/NSTableView.d @ 45:d8635bb48c7c

Merge with SWT 3.5
author Jacob Carlborg <doob@me.com>
date Mon, 01 Dec 2008 17:07:00 +0100
parents f565d3a95c0a
children 62202ce0039f
comparison
equal deleted inserted replaced
44:ca5e494f2bbf 45:d8635bb48c7c
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others. 2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * 10 *
11 * Port to the D programming language: 11 * Port to the D programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com> 12 * Jacob Carlborg <doob@me.com>
13 *******************************************************************************/ 13 *******************************************************************************/
14 module dwt.internal.cocoa.NSTableView; 14 module dwt.internal.cocoa.NSTableView;
15 15
16 import dwt.internal.cocoa.CGFloat; 16 import dwt.dwthelper.utils;
17 import dwt.internal.cocoa.id; 17 import dwt.internal.c.Carbon;
18 import cocoa = dwt.internal.cocoa.id;
18 import dwt.internal.cocoa.NSArray; 19 import dwt.internal.cocoa.NSArray;
19 import dwt.internal.cocoa.NSCell; 20 import dwt.internal.cocoa.NSIndexSet;
20 import dwt.internal.cocoa.NSColor; 21 import dwt.internal.cocoa.NSColor;
21 import dwt.internal.cocoa.NSControl; 22 import dwt.internal.cocoa.NSControl;
22 import dwt.internal.cocoa.NSDragOperation;
23 import dwt.internal.cocoa.NSEnumerator;
24 import dwt.internal.cocoa.NSEvent;
25 import dwt.internal.cocoa.NSImage;
26 import dwt.internal.cocoa.NSIndexSet;
27 import dwt.internal.cocoa.NSInteger;
28 import dwt.internal.cocoa.NSNotification;
29 import dwt.internal.cocoa.NSPoint; 23 import dwt.internal.cocoa.NSPoint;
30 import dwt.internal.cocoa.NSRange; 24 import dwt.internal.cocoa.NSRange;
31 import dwt.internal.cocoa.NSRect; 25 import dwt.internal.cocoa.NSRect;
32 import dwt.internal.cocoa.NSSize; 26 import dwt.internal.cocoa.NSSize;
33 import dwt.internal.cocoa.NSString;
34 import dwt.internal.cocoa.NSTableColumn; 27 import dwt.internal.cocoa.NSTableColumn;
35 import dwt.internal.cocoa.NSTableHeaderView; 28 import dwt.internal.cocoa.NSTableHeaderView;
36 import dwt.internal.cocoa.NSText;
37 import dwt.internal.cocoa.NSView;
38 import dwt.internal.cocoa.OS; 29 import dwt.internal.cocoa.OS;
30 import dwt.internal.objc.cocoa.Cocoa;
39 import objc = dwt.internal.objc.runtime; 31 import objc = dwt.internal.objc.runtime;
40 32
41 enum NSTableViewColumnAutoresizingStyle : NSUInteger 33 enum NSTableViewColumnAutoresizingStyle : NSUInteger
42 { 34 {
43 NSTableViewNoColumnAutoresizing = 0, 35 NSTableViewNoColumnAutoresizing = 0,
46 NSTableViewReverseSequentialColumnAutoresizingStyle, 38 NSTableViewReverseSequentialColumnAutoresizingStyle,
47 NSTableViewLastColumnOnlyAutoresizingStyle, 39 NSTableViewLastColumnOnlyAutoresizingStyle,
48 NSTableViewFirstColumnOnlyAutoresizingStyle 40 NSTableViewFirstColumnOnlyAutoresizingStyle
49 } 41 }
50 42
51 alias NSTableViewColumnAutoresizingStyle.NSTableViewNoColumnAutoresizing NSTableViewNoColumnAutoresizing; 43 public class NSTableView : NSControl {
52 alias NSTableViewColumnAutoresizingStyle.NSTableViewUniformColumnAutoresizingStyle NSTableViewUniformColumnAutoresizingStyle; 44
53 alias NSTableViewColumnAutoresizingStyle.NSTableViewSequentialColumnAutoresizingStyle NSTableViewSequentialColumnAutoresizingStyle; 45 public this() {
54 alias NSTableViewColumnAutoresizingStyle.NSTableViewReverseSequentialColumnAutoresizingStyle NSTableViewReverseSequentialColumnAutoresizingStyle; 46 super();
55 alias NSTableViewColumnAutoresizingStyle.NSTableViewLastColumnOnlyAutoresizingStyle NSTableViewLastColumnOnlyAutoresizingStyle; 47 }
56 alias NSTableViewColumnAutoresizingStyle.NSTableViewFirstColumnOnlyAutoresizingStyle NSTableViewFirstColumnOnlyAutoresizingStyle; 48
57 49 public this(objc.id id) {
58 enum NSTableViewSelectionHighlightStyle : NSInteger 50 super(id);
59 { 51 }
60 NSTableViewSelectionHighlightStyleRegular = 0, 52
61 NSTableViewSelectionHighlightStyleSourceList = 1, 53 public this(cocoa.id id) {
62 } 54 super(id);
63 55 }
64 alias NSTableViewSelectionHighlightStyle.NSTableViewSelectionHighlightStyleRegular NSTableViewSelectionHighlightStyleRegular; 56
65 alias NSTableViewSelectionHighlightStyle.NSTableViewSelectionHighlightStyleSourceList NSTableViewSelectionHighlightStyleSourceList; 57 public void addTableColumn(NSTableColumn column) {
66 58 OS.objc_msgSend(this.id, OS.sel_addTableColumn_, column !is null ? column.id : null);
67 enum NSTableViewDropOperation : NSUInteger 59 }
68 { 60
69 NSTableViewDropOn, 61 public NSTableViewColumnAutoresizingStyle columnAutoresizingStyle() {
70 NSTableViewDropAbove 62 return cast(NSTableViewColumnAutoresizingStyle) OS.objc_msgSend(this.id, OS.sel_columnAutoresizingStyle);
71 } 63 }
72 64
73 alias NSTableViewDropOperation.NSTableViewDropOn NSTableViewDropOn; 65 public NSIndexSet columnIndexesInRect(NSRect rect) {
74 alias NSTableViewDropOperation.NSTableViewDropAbove NSTableViewDropAbove; 66 objc.id result = OS.objc_msgSend(this.id, OS.sel_columnIndexesInRect_, rect);
75 67 return result !is null ? new NSIndexSet(result) : null;
76 public class NSTableView : NSControl 68 }
77 { 69
78 70 public NSInteger columnWithIdentifier(cocoa.id identifier) {
79 public this () 71 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_columnWithIdentifier_, identifier !is null ? identifier.id : null);
80 { 72 }
81 super(); 73
82 } 74 public void deselectAll(cocoa.id sender) {
83 75 OS.objc_msgSend(this.id, OS.sel_deselectAll_, sender !is null ? sender.id : null);
84 public this (objc.id id) 76 }
85 { 77
86 super(id); 78 public void deselectRow(NSInteger row) {
87 } 79 OS.objc_msgSend(this.id, OS.sel_deselectRow_, row);
88 80 }
89 public void addTableColumn (NSTableColumn column) 81
90 { 82 public NSRect frameOfCellAtColumn(NSInteger column, NSInteger row) {
91 OS.objc_msgSend(this.id_, OS.sel_addTableColumn_1, column !is null ? column.id_ : null); 83 NSRect result = NSRect();
92 } 84 OS.objc_msgSend_stret(result, this.id, OS.sel_frameOfCellAtColumn_row_, column, row);
93 85 return result;
94 public bool allowsColumnReordering () 86 }
95 { 87
96 return OS.objc_msgSend(this.id_, OS.sel_allowsColumnReordering) !is null; 88 public NSTableHeaderView headerView() {
97 } 89 objc.id result = OS.objc_msgSend(this.id, OS.sel_headerView);
98 90 return result !is null ? new NSTableHeaderView(result) : null;
99 public bool allowsColumnResizing () 91 }
100 { 92
101 return OS.objc_msgSend(this.id_, OS.sel_allowsColumnResizing) !is null; 93 public void highlightSelectionInClipRect(NSRect clipRect) {
102 } 94 OS.objc_msgSend(this.id, OS.sel_highlightSelectionInClipRect_, clipRect);
103 95 }
104 public bool allowsColumnSelection () 96
105 { 97 public NSSize intercellSpacing() {
106 return OS.objc_msgSend(this.id_, OS.sel_allowsColumnSelection) !is null; 98 NSSize result = NSSize();
107 } 99 OS.objc_msgSend_stret(result, this.id, OS.sel_intercellSpacing);
108 100 return result;
109 public bool allowsEmptySelection () 101 }
110 { 102
111 return OS.objc_msgSend(this.id_, OS.sel_allowsEmptySelection) !is null; 103 public bool isRowSelected(NSInteger row) {
112 } 104 return OS.objc_msgSend_bool(this.id, OS.sel_isRowSelected_, row);
113 105 }
114 public bool allowsMultipleSelection () 106
115 { 107 public void moveColumn(NSInteger column, NSInteger newIndex) {
116 return OS.objc_msgSend(this.id_, OS.sel_allowsMultipleSelection) !is null; 108 OS.objc_msgSend(this.id, OS.sel_moveColumn_toColumn_, column, newIndex);
117 } 109 }
118 110
119 public bool allowsTypeSelect () 111 public void noteNumberOfRowsChanged() {
120 { 112 OS.objc_msgSend(this.id, OS.sel_noteNumberOfRowsChanged);
121 return OS.objc_msgSend(this.id_, OS.sel_allowsTypeSelect) !is null; 113 }
122 } 114
123 115 public NSInteger numberOfColumns() {
124 public bool autoresizesAllColumnsToFit () 116 return OS.objc_msgSend(this.id, OS.sel_numberOfColumns);
125 { 117 }
126 return OS.objc_msgSend(this.id_, OS.sel_autoresizesAllColumnsToFit) !is null; 118
127 } 119 public NSInteger numberOfRows() {
128 120 return OS.objc_msgSend(this.id, OS.sel_numberOfRows);
129 public NSString autosaveName () 121 }
130 { 122
131 objc.id result = OS.objc_msgSend(this.id_, OS.sel_autosaveName); 123 public NSInteger numberOfSelectedRows() {
132 return result !is null ? new NSString(result) : null; 124 return OS.objc_msgSend(this.id, OS.sel_numberOfSelectedRows);
133 } 125 }
134 126
135 public bool autosaveTableColumns () 127 public NSRect rectOfColumn(NSInteger column) {
136 { 128 NSRect result = NSRect();
137 return OS.objc_msgSend(this.id_, OS.sel_autosaveTableColumns) !is null; 129 OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfColumn_, column);
138 } 130 return result;
139 131 }
140 public NSColor backgroundColor () 132
141 { 133 public NSRect rectOfRow(NSInteger row) {
142 objc.id result = OS.objc_msgSend(this.id_, OS.sel_backgroundColor); 134 NSRect result = NSRect();
143 return result !is null ? new NSColor(result) : null; 135 OS.objc_msgSend_stret(result, this.id, OS.sel_rectOfRow_, row);
144 } 136 return result;
145 137 }
146 public bool canDragRowsWithIndexes (NSIndexSet rowIndexes, NSPoint mouseDownPoint) 138
147 { 139 public void reloadData() {
148 return OS.objc_msgSend(this.id_, OS.sel_canDragRowsWithIndexes_1atPoint_1, rowIndexes !is null ? rowIndexes.id_ : null, mouseDownPoint) !is null; 140 OS.objc_msgSend(this.id, OS.sel_reloadData);
149 } 141 }
150 142
151 public NSInteger clickedColumn () 143 public void removeTableColumn(NSTableColumn column) {
152 { 144 OS.objc_msgSend(this.id, OS.sel_removeTableColumn_, column !is null ? column.id : null);
153 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_clickedColumn); 145 }
154 } 146
155 147 public NSInteger rowAtPoint(NSPoint point) {
156 public NSInteger clickedRow () 148 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_rowAtPoint_, point);
157 { 149 }
158 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_clickedRow); 150
159 } 151 public CGFloat rowHeight() {
160 152 return cast(CGFloat) OS.objc_msgSend_fpret(this.id, OS.sel_rowHeight);
161 public NSTableViewColumnAutoresizingStyle columnAtPoint (NSPoint point) 153 }
162 { 154
163 return cast(NSTableViewColumnAutoresizingStyle) OS.objc_msgSend(this.id_, OS.sel_columnAtPoint_1, point); 155 public NSRange rowsInRect(NSRect rect) {
164 } 156 NSRange result = NSRange();
165 157 OS.objc_msgSend_stret(result, this.id, OS.sel_rowsInRect_, rect);
166 public NSInteger columnAutoresizingStyle () 158 return result;
167 { 159 }
168 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_columnAutoresizingStyle); 160
169 } 161 public void scrollColumnToVisible(NSInteger column) {
170 162 OS.objc_msgSend(this.id, OS.sel_scrollColumnToVisible_, column);
171 public NSIndexSet columnIndexesInRect (NSRect rect) 163 }
172 { 164
173 objc.id result = OS.objc_msgSend(this.id_, OS.sel_columnIndexesInRect_1, rect); 165 public void scrollRowToVisible(NSInteger row) {
174 return result !is null ? new NSIndexSet(result) : null; 166 OS.objc_msgSend(this.id, OS.sel_scrollRowToVisible_, row);
175 } 167 }
176 168
177 public NSInteger columnWithIdentifier (id identifier) 169 public void selectAll(cocoa.id sender) {
178 { 170 OS.objc_msgSend(this.id, OS.sel_selectAll_, sender !is null ? sender.id : null);
179 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_columnWithIdentifier_1, identifier !is null ? identifier.id_ : null); 171 }
180 } 172
181 173 public void selectRow(NSInteger row, bool extend) {
182 public NSRange columnsInRect (NSRect rect) 174 OS.objc_msgSend(this.id, OS.sel_selectRow_byExtendingSelection_, row, extend);
183 { 175 }
184 NSRange result; 176
185 OS.objc_msgSend_stret(&result, this.id_, OS.sel_columnsInRect_1, rect); 177 public void selectRowIndexes(NSIndexSet indexes, bool extend) {
186 return result; 178 OS.objc_msgSend(this.id, OS.sel_selectRowIndexes_byExtendingSelection_, indexes !is null ? indexes.id : null, extend);
187 } 179 }
188 180
189 public NSView cornerView () 181 public NSInteger selectedRow() {
190 { 182 return cast(NSInteger) OS.objc_msgSend(this.id, OS.sel_selectedRow);
191 objc.id result = OS.objc_msgSend(this.id_, OS.sel_cornerView); 183 }
192 return result !is null ? new NSView(result) : null; 184
193 } 185 public NSIndexSet selectedRowIndexes() {
194 186 objc.id result = OS.objc_msgSend(this.id, OS.sel_selectedRowIndexes);
195 public id dataSource () 187 return result !is null ? new NSIndexSet(result) : null;
196 { 188 }
197 objc.id result = OS.objc_msgSend(this.id_, OS.sel_dataSource); 189
198 return result !is null ? new id(result) : null; 190 public void setAllowsColumnReordering(bool flag) {
199 } 191 OS.objc_msgSend(this.id, OS.sel_setAllowsColumnReordering_, flag);
200 192 }
201 public id delegatee () 193
202 { 194 public void setAllowsMultipleSelection(bool flag) {
203 objc.id result = OS.objc_msgSend(this.id_, OS.sel_delegate); 195 OS.objc_msgSend(this.id, OS.sel_setAllowsMultipleSelection_, flag);
204 return result !is null ? new id(result) : null; 196 }
205 } 197
206 198 public void setBackgroundColor(NSColor color) {
207 public void deselectAll (id sender) 199 OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_, color !is null ? color.id : null);
208 { 200 }
209 OS.objc_msgSend(this.id_, OS.sel_deselectAll_1, sender !is null ? sender.id_ : null); 201
210 } 202 public void setColumnAutoresizingStyle(NSTableViewColumnAutoresizingStyle style) {
211 203 OS.objc_msgSend(this.id, OS.sel_setColumnAutoresizingStyle_, style);
212 public void deselectColumn (NSInteger column) 204 }
213 { 205
214 OS.objc_msgSend(this.id_, OS.sel_deselectColumn_1, column); 206 public void setDataSource(cocoa.id aSource) {
215 } 207 OS.objc_msgSend(this.id, OS.sel_setDataSource_, aSource !is null ? aSource.id : null);
216 208 }
217 public void deselectRow (NSInteger row) 209
218 { 210 public void setDelegate(cocoa.id delegate_) {
219 OS.objc_msgSend(this.id_, OS.sel_deselectRow_1, row); 211 OS.objc_msgSend(this.id, OS.sel_setDelegate_, delegate_ !is null ? delegate_.id : null);
220 } 212 }
221 213
222 public objc.SEL doubleAction () 214 public void setDoubleAction(objc.SEL aSelector) {
223 { 215 OS.objc_msgSend(this.id, OS.sel_setDoubleAction_, aSelector);
224 return cast(objc.SEL) OS.objc_msgSend(this.id_, OS.sel_doubleAction); 216 }
225 } 217
226 218 public void setHeaderView(NSTableHeaderView headerView) {
227 public NSImage dragImageForRows (NSArray dragRows, NSEvent dragEvent, NSPointPointer dragImageOffset) 219 OS.objc_msgSend(this.id, OS.sel_setHeaderView_, headerView !is null ? headerView.id : null);
228 { 220 }
229 objc.id result = OS.objc_msgSend(this.id_, OS.sel_dragImageForRows_1event_1dragImageOffset_1, dragRows !is null ? dragRows.id_ : null, 221
230 dragEvent !is null ? dragEvent.id_ : null, dragImageOffset); 222 public void setRowHeight(CGFloat rowHeight) {
231 return result !is null ? new NSImage(result) : null; 223 OS.objc_msgSend(this.id, OS.sel_setRowHeight_, rowHeight);
232 } 224 }
233 225
234 public NSImage dragImageForRowsWithIndexes (NSIndexSet dragRows, NSArray tableColumns, NSEvent dragEvent, NSPointPointer dragImageOffset) 226 public void setUsesAlternatingRowBackgroundColors(bool useAlternatingRowColors) {
235 { 227 OS.objc_msgSend(this.id, OS.sel_setUsesAlternatingRowBackgroundColors_, useAlternatingRowColors);
236 objc.id result = OS.objc_msgSend(this.id_, OS.sel_dragImageForRowsWithIndexes_1tableColumns_1event_1offset_1, 228 }
237 dragRows !is null ? dragRows.id_ : null, tableColumns !is null ? tableColumns.id_ : null, dragEvent !is null ? dragEvent.id_ : null, 229
238 dragImageOffset); 230 public NSArray tableColumns() {
239 return result !is null ? new NSImage(result) : null; 231 objc.id result = OS.objc_msgSend(this.id, OS.sel_tableColumns);
240 } 232 return result !is null ? new NSArray(result) : null;
241 233 }
242 public void drawBackgroundInClipRect (NSRect clipRect) 234
243 { 235 public void tile() {
244 OS.objc_msgSend(this.id_, OS.sel_drawBackgroundInClipRect_1, clipRect); 236 OS.objc_msgSend(this.id, OS.sel_tile);
245 } 237 }
246 238
247 public void drawGridInClipRect (NSRect clipRect) 239 public bool usesAlternatingRowBackgroundColors() {
248 { 240 return OS.objc_msgSend_bool(this.id, OS.sel_usesAlternatingRowBackgroundColors);
249 OS.objc_msgSend(this.id_, OS.sel_drawGridInClipRect_1, clipRect); 241 }
250 } 242
251 243 public static objc.Class cellClass() {
252 public void drawRow (NSInteger row, NSRect clipRect) 244 return cast(objc.Class) OS.objc_msgSend(OS.class_NSTableView, OS.sel_cellClass);
253 { 245 }
254 OS.objc_msgSend(this.id_, OS.sel_drawRow_1clipRect_1, row, clipRect); 246
255 } 247 public static void setCellClass(objc.Class factoryId) {
256 248 OS.objc_msgSend(OS.class_NSTableView, OS.sel_setCellClass_, factoryId);
257 public bool drawsGrid () 249 }
258 { 250
259 return OS.objc_msgSend(this.id_, OS.sel_drawsGrid) !is null; 251 }
260 }
261
262 public void editColumn (NSInteger column, NSInteger row, NSEvent theEvent, bool select)
263 {
264 OS.objc_msgSend(this.id_, OS.sel_editColumn_1row_1withEvent_1select_1, column, row, theEvent !is null ? theEvent.id_ : null, select);
265 }
266
267 public NSInteger editedColumn ()
268 {
269 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_editedColumn);
270 }
271
272 public NSInteger editedRow ()
273 {
274 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_editedRow);
275 }
276
277 public NSRect frameOfCellAtColumn (NSInteger column, NSInteger row)
278 {
279 NSRect result;
280 OS.objc_msgSend_stret(&result, this.id_, OS.sel_frameOfCellAtColumn_1row_1, column, row);
281 return result;
282 }
283
284 public NSColor gridColor ()
285 {
286 objc.id result = OS.objc_msgSend(this.id_, OS.sel_gridColor);
287 return result !is null ? new NSColor(result) : null;
288 }
289
290 public NSUInteger gridStyleMask ()
291 {
292 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_gridStyleMask);
293 }
294
295 public NSTableHeaderView headerView ()
296 {
297 objc.id result = OS.objc_msgSend(this.id_, OS.sel_headerView);
298 return result !is null ? new NSTableHeaderView(result) : null;
299 }
300
301 public void highlightSelectionInClipRect (NSRect clipRect)
302 {
303 OS.objc_msgSend(this.id_, OS.sel_highlightSelectionInClipRect_1, clipRect);
304 }
305
306 public NSTableColumn highlightedTableColumn ()
307 {
308 objc.id result = OS.objc_msgSend(this.id_, OS.sel_highlightedTableColumn);
309 return result !is null ? new NSTableColumn(result) : null;
310 }
311
312 public NSImage indicatorImageInTableColumn (NSTableColumn tc)
313 {
314 objc.id result = OS.objc_msgSend(this.id_, OS.sel_indicatorImageInTableColumn_1, tc !is null ? tc.id_ : null);
315 return result !is null ? new NSImage(result) : null;
316 }
317
318 public NSSize intercellSpacing ()
319 {
320 NSSize result;
321 OS.objc_msgSend_stret(&result, this.id_, OS.sel_intercellSpacing);
322 return result;
323 }
324
325 public bool isColumnSelected (NSInteger column)
326 {
327 return OS.objc_msgSend(this.id_, OS.sel_isColumnSelected_1, column) !is null;
328 }
329
330 public bool isRowSelected (NSInteger row)
331 {
332 return OS.objc_msgSend(this.id_, OS.sel_isRowSelected_1, row) !is null;
333 }
334
335 public void moveColumn (NSInteger column, NSInteger newIndex)
336 {
337 OS.objc_msgSend(this.id_, OS.sel_moveColumn_1toColumn_1, column, newIndex);
338 }
339
340 public void noteHeightOfRowsWithIndexesChanged (NSIndexSet indexSet)
341 {
342 OS.objc_msgSend(this.id_, OS.sel_noteHeightOfRowsWithIndexesChanged_1, indexSet !is null ? indexSet.id_ : null);
343 }
344
345 public void noteNumberOfRowsChanged ()
346 {
347 OS.objc_msgSend(this.id_, OS.sel_noteNumberOfRowsChanged);
348 }
349
350 public NSInteger numberOfColumns ()
351 {
352 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfColumns);
353 }
354
355 public NSInteger numberOfRows ()
356 {
357 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfRows);
358 }
359
360 public NSInteger numberOfSelectedColumns ()
361 {
362 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfSelectedColumns);
363 }
364
365 public NSInteger numberOfSelectedRows ()
366 {
367 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_numberOfSelectedRows);
368 }
369
370 public NSCell preparedCellAtColumn (NSInteger column, NSInteger row)
371 {
372 objc.id result = OS.objc_msgSend(this.id_, OS.sel_preparedCellAtColumn_1row_1, column, row);
373 return result !is null ? new NSCell(result) : null;
374 }
375
376 public NSRect rectOfColumn (NSInteger column)
377 {
378 NSRect result;
379 OS.objc_msgSend_stret(&result, this.id_, OS.sel_rectOfColumn_1, column);
380 return result;
381 }
382
383 public NSRect rectOfRow (NSInteger row)
384 {
385 NSRect result;
386 OS.objc_msgSend_stret(&result, this.id_, OS.sel_rectOfRow_1, row);
387 return result;
388 }
389
390 public void reloadData ()
391 {
392 OS.objc_msgSend(this.id_, OS.sel_reloadData);
393 }
394
395 public void removeTableColumn (NSTableColumn column)
396 {
397 OS.objc_msgSend(this.id_, OS.sel_removeTableColumn_1, column !is null ? column.id_ : null);
398 }
399
400 public NSInteger rowAtPoint (NSPoint point)
401 {
402 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_rowAtPoint_1, point);
403 }
404
405 public CGFloat rowHeight ()
406 {
407 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_rowHeight);
408 }
409
410 public NSRange rowsInRect (NSRect rect)
411 {
412 NSRange result;
413 OS.objc_msgSend_stret(&result, this.id_, OS.sel_rowsInRect_1, rect);
414 return result;
415 }
416
417 public void scrollColumnToVisible (NSInteger column)
418 {
419 OS.objc_msgSend(this.id_, OS.sel_scrollColumnToVisible_1, column);
420 }
421
422 public void scrollRowToVisible (NSInteger row)
423 {
424 OS.objc_msgSend(this.id_, OS.sel_scrollRowToVisible_1, row);
425 }
426
427 public void selectAll (id sender)
428 {
429 OS.objc_msgSend(this.id_, OS.sel_selectAll_1, sender !is null ? sender.id_ : null);
430 }
431
432 public void selectColumn (NSInteger column, bool extend)
433 {
434 OS.objc_msgSend(this.id_, OS.sel_selectColumn_1byExtendingSelection_1, column, extend);
435 }
436
437 public void selectColumnIndexes (NSIndexSet indexes, bool extend)
438 {
439 OS.objc_msgSend(this.id_, OS.sel_selectColumnIndexes_1byExtendingSelection_1, indexes !is null ? indexes.id_ : null, extend);
440 }
441
442 public void selectRow (NSInteger row, bool extend)
443 {
444 OS.objc_msgSend(this.id_, OS.sel_selectRow_1byExtendingSelection_1, row, extend);
445 }
446
447 public void selectRowIndexes (NSIndexSet indexes, bool extend)
448 {
449 OS.objc_msgSend(this.id_, OS.sel_selectRowIndexes_1byExtendingSelection_1, indexes !is null ? indexes.id_ : null, extend);
450 }
451
452 public NSInteger selectedColumn ()
453 {
454 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_selectedColumn);
455 }
456
457 public NSEnumerator selectedColumnEnumerator ()
458 {
459 objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedColumnEnumerator);
460 return result !is null ? new NSEnumerator(result) : null;
461 }
462
463 public NSIndexSet selectedColumnIndexes ()
464 {
465 objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedColumnIndexes);
466 return result !is null ? new NSIndexSet(result) : null;
467 }
468
469 public NSInteger selectedRow ()
470 {
471 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_selectedRow);
472 }
473
474 public NSEnumerator selectedRowEnumerator ()
475 {
476 objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedRowEnumerator);
477 return result !is null ? new NSEnumerator(result) : null;
478 }
479
480 public NSIndexSet selectedRowIndexes ()
481 {
482 objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedRowIndexes);
483 return result !is null ? new NSIndexSet(result) : null;
484 }
485
486 public NSTableViewSelectionHighlightStyle selectionHighlightStyle ()
487 {
488 return cast(NSTableViewSelectionHighlightStyle) OS.objc_msgSend(this.id_, OS.sel_selectionHighlightStyle);
489 }
490
491 public void setAllowsColumnReordering (bool flag)
492 {
493 OS.objc_msgSend(this.id_, OS.sel_setAllowsColumnReordering_1, flag);
494 }
495
496 public void setAllowsColumnResizing (bool flag)
497 {
498 OS.objc_msgSend(this.id_, OS.sel_setAllowsColumnResizing_1, flag);
499 }
500
501 public void setAllowsColumnSelection (bool flag)
502 {
503 OS.objc_msgSend(this.id_, OS.sel_setAllowsColumnSelection_1, flag);
504 }
505
506 public void setAllowsEmptySelection (bool flag)
507 {
508 OS.objc_msgSend(this.id_, OS.sel_setAllowsEmptySelection_1, flag);
509 }
510
511 public void setAllowsMultipleSelection (bool flag)
512 {
513 OS.objc_msgSend(this.id_, OS.sel_setAllowsMultipleSelection_1, flag);
514 }
515
516 public void setAllowsTypeSelect (bool value)
517 {
518 OS.objc_msgSend(this.id_, OS.sel_setAllowsTypeSelect_1, value);
519 }
520
521 public void setAutoresizesAllColumnsToFit (bool flag)
522 {
523 OS.objc_msgSend(this.id_, OS.sel_setAutoresizesAllColumnsToFit_1, flag);
524 }
525
526 public void setAutosaveName (NSString name)
527 {
528 OS.objc_msgSend(this.id_, OS.sel_setAutosaveName_1, name !is null ? name.id_ : null);
529 }
530
531 public void setAutosaveTableColumns (bool save)
532 {
533 OS.objc_msgSend(this.id_, OS.sel_setAutosaveTableColumns_1, save);
534 }
535
536 public void setBackgroundColor (NSColor color)
537 {
538 OS.objc_msgSend(this.id_, OS.sel_setBackgroundColor_1, color !is null ? color.id_ : null);
539 }
540
541 public void setColumnAutoresizingStyle (NSTableViewColumnAutoresizingStyle style)
542 {
543 OS.objc_msgSend(this.id_, OS.sel_setColumnAutoresizingStyle_1, style);
544 }
545
546 public void setCornerView (NSView cornerView)
547 {
548 OS.objc_msgSend(this.id_, OS.sel_setCornerView_1, cornerView !is null ? cornerView.id_ : null);
549 }
550
551 public void setDataSource (id aSource)
552 {
553 OS.objc_msgSend(this.id_, OS.sel_setDataSource_1, aSource !is null ? aSource.id_ : null);
554 }
555
556 public void setDelegate (id delegatee)
557 {
558 OS.objc_msgSend(this.id_, OS.sel_setDelegate_1, delegatee !is null ? delegatee.id_ : null);
559 }
560
561 public void setDoubleAction (objc.SEL aSelector)
562 {
563 OS.objc_msgSend(this.id_, OS.sel_setDoubleAction_1, aSelector);
564 }
565
566 public void setDraggingSourceOperationMask (NSDragOperation mask, bool isLocal)
567 {
568 OS.objc_msgSend(this.id_, OS.sel_setDraggingSourceOperationMask_1forLocal_1, mask, isLocal);
569 }
570
571 public void setDrawsGrid (bool flag)
572 {
573 OS.objc_msgSend(this.id_, OS.sel_setDrawsGrid_1, flag);
574 }
575
576 public void setDropRow (NSInteger row, NSTableViewDropOperation op)
577 {
578 OS.objc_msgSend(this.id_, OS.sel_setDropRow_1dropOperation_1, row, op);
579 }
580
581 public void setGridColor (NSColor color)
582 {
583 OS.objc_msgSend(this.id_, OS.sel_setGridColor_1, color !is null ? color.id_ : null);
584 }
585
586 public void setGridStyleMask (NSUInteger gridType)
587 {
588 OS.objc_msgSend(this.id_, OS.sel_setGridStyleMask_1, gridType);
589 }
590
591 public void setHeaderView (NSTableHeaderView headerView)
592 {
593 OS.objc_msgSend(this.id_, OS.sel_setHeaderView_1, headerView !is null ? headerView.id_ : null);
594 }
595
596 public void setHighlightedTableColumn (NSTableColumn tc)
597 {
598 OS.objc_msgSend(this.id_, OS.sel_setHighlightedTableColumn_1, tc !is null ? tc.id_ : null);
599 }
600
601 public void setIndicatorImage (NSImage anImage, NSTableColumn tc)
602 {
603 OS.objc_msgSend(this.id_, OS.sel_setIndicatorImage_1inTableColumn_1, anImage !is null ? anImage.id_ : null, tc !is null ? tc.id_ : null);
604 }
605
606 public void setIntercellSpacing (NSSize aSize)
607 {
608 OS.objc_msgSend(this.id_, OS.sel_setIntercellSpacing_1, aSize);
609 }
610
611 public void setRowHeight (CGFloat rowHeight)
612 {
613 OS.objc_msgSend(this.id_, OS.sel_setRowHeight_1, rowHeight);
614 }
615
616 public void setSelectionHighlightStyle (NSTableViewSelectionHighlightStyle selectionHighlightStyle)
617 {
618 OS.objc_msgSend(this.id_, OS.sel_setSelectionHighlightStyle_1, selectionHighlightStyle);
619 }
620
621 public void setSortDescriptors (NSArray array)
622 {
623 OS.objc_msgSend(this.id_, OS.sel_setSortDescriptors_1, array !is null ? array.id_ : null);
624 }
625
626 public void setUsesAlternatingRowBackgroundColors (bool useAlternatingRowColors)
627 {
628 OS.objc_msgSend(this.id_, OS.sel_setUsesAlternatingRowBackgroundColors_1, useAlternatingRowColors);
629 }
630
631 public void setVerticalMotionCanBeginDrag (bool flag)
632 {
633 OS.objc_msgSend(this.id_, OS.sel_setVerticalMotionCanBeginDrag_1, flag);
634 }
635
636 public void sizeLastColumnToFit ()
637 {
638 OS.objc_msgSend(this.id_, OS.sel_sizeLastColumnToFit);
639 }
640
641 public void sizeToFit ()
642 {
643 OS.objc_msgSend(this.id_, OS.sel_sizeToFit);
644 }
645
646 public NSArray sortDescriptors ()
647 {
648 objc.id result = OS.objc_msgSend(this.id_, OS.sel_sortDescriptors);
649 return result !is null ? new NSArray(result) : null;
650 }
651
652 public NSTableColumn tableColumnWithIdentifier (id identifier)
653 {
654 objc.id result = OS.objc_msgSend(this.id_, OS.sel_tableColumnWithIdentifier_1, identifier !is null ? identifier.id_ : null);
655 return result !is null ? new NSTableColumn(result) : null;
656 }
657
658 public NSArray tableColumns ()
659 {
660 objc.id result = OS.objc_msgSend(this.id_, OS.sel_tableColumns);
661 return result !is null ? new NSArray(result) : null;
662 }
663
664 public void textDidBeginEditing (NSNotification notification)
665 {
666 OS.objc_msgSend(this.id_, OS.sel_textDidBeginEditing_1, notification !is null ? notification.id_ : null);
667 }
668
669 public void textDidChange (NSNotification notification)
670 {
671 OS.objc_msgSend(this.id_, OS.sel_textDidChange_1, notification !is null ? notification.id_ : null);
672 }
673
674 public void textDidEndEditing (NSNotification notification)
675 {
676 OS.objc_msgSend(this.id_, OS.sel_textDidEndEditing_1, notification !is null ? notification.id_ : null);
677 }
678
679 public bool textShouldBeginEditing (NSText textObject)
680 {
681 return OS.objc_msgSend(this.id_, OS.sel_textShouldBeginEditing_1, textObject !is null ? textObject.id_ : null) !is null;
682 }
683
684 public bool textShouldEndEditing (NSText textObject)
685 {
686 return OS.objc_msgSend(this.id_, OS.sel_textShouldEndEditing_1, textObject !is null ? textObject.id_ : null) !is null;
687 }
688
689 public void tile ()
690 {
691 OS.objc_msgSend(this.id_, OS.sel_tile);
692 }
693
694 public bool usesAlternatingRowBackgroundColors ()
695 {
696 return OS.objc_msgSend(this.id_, OS.sel_usesAlternatingRowBackgroundColors) !is null;
697 }
698
699 public bool verticalMotionCanBeginDrag ()
700 {
701 return OS.objc_msgSend(this.id_, OS.sel_verticalMotionCanBeginDrag) !is null;
702 }
703
704 }