/usr/include/GNUstep/AppKit/NSTableView.h is in libgnustep-gui-dev 0.24.0-3.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 | /*
NSTableView.h
The table class.
Copyright (C) 2000 Free Software Foundation, Inc.
Author: Nicola Pero <n.pero@mi.flashnet.it>
Date: March 2000
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _GNUstep_H_NSTableView
#define _GNUstep_H_NSTableView
#import <AppKit/NSControl.h>
#import <AppKit/NSDragging.h>
#import <AppKit/NSUserInterfaceValidation.h>
@class NSArray;
@class NSIndexSet;
@class NSMutableIndexSet;
@class NSTableColumn;
@class NSTableHeaderView;
@class NSText;
@class NSImage;
@class NSURL;
typedef enum _NSTableViewDropOperation {
NSTableViewDropOn,
NSTableViewDropAbove
} NSTableViewDropOperation;
enum {
NSTableViewGridNone = 0,
NSTableViewSolidVerticalGridLineMask = 1 << 0,
NSTableViewSolidHorizontalGridLineMask = 1 << 1,
NSTableViewDashedHorizontalGridLineMask = 1 << 3
};
typedef NSUInteger NSTableViewGridLineStyle;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
typedef enum _NSTableViewColumnAutoresizingStyle
{
NSTableViewNoColumnAutoresizing = 0,
NSTableViewUniformColumnAutoresizingStyle,
NSTableViewSequentialColumnAutoresizingStyle,
NSTableViewReverseSequentialColumnAutoresizingStyle,
NSTableViewLastColumnOnlyAutoresizingStyle,
NSTableViewFirstColumnOnlyAutoresizingStyle
} NSTableViewColumnAutoresizingStyle;
#endif
@interface NSTableView : NSControl <NSUserInterfaceValidations>
{
/*
* Real Ivars
*/
id _dataSource;
NSMutableArray *_tableColumns;
BOOL _drawsGrid;
NSColor *_gridColor;
NSColor *_backgroundColor;
float _rowHeight;
NSSize _intercellSpacing;
id _delegate;
NSTableHeaderView *_headerView;
NSView *_cornerView;
SEL _action;
SEL _doubleAction;
id _target;
int _clickedRow;
int _clickedColumn;
NSTableColumn *_highlightedTableColumn;
NSMutableIndexSet *_selectedColumns;
NSMutableIndexSet *_selectedRows;
int _selectedColumn;
int _selectedRow;
BOOL _allowsMultipleSelection;
BOOL _allowsEmptySelection;
BOOL _allowsColumnSelection;
BOOL _allowsColumnResizing;
BOOL _allowsColumnReordering;
BOOL _autoresizesAllColumnsToFit;
BOOL _selectingColumns;
NSText *_textObject;
int _editedRow;
int _editedColumn;
NSCell *_editedCell;
BOOL _autosaveTableColumns;
NSString *_autosaveName;
BOOL _verticalMotionDrag;
NSArray *_sortDescriptors;
/*
* Ivars Acting as Control...
*/
BOOL _isValidating;
/*
* Ivars Acting as Cache
*/
int _numberOfRows;
int _numberOfColumns;
/* YES if _delegate responds to
tableView:willDisplayCell:forTableColumn:row: */
BOOL _del_responds;
/* YES if _dataSource responds to
tableView:setObjectValue:forTableColumn:row: */
BOOL _dataSource_editable;
/*
* We cache column origins (precisely, the x coordinate of the left
* origin of each column). When a column width is changed through
* [NSTableColumn setWidth:], then [NSTableView tile] gets called,
* which updates the cache. */
float *_columnOrigins;
/*
* We keep the superview's width in order to know when to
* size the last column to fit
*/
float _superview_width;
/* if YES [which happens only during a sizeToFit], we are doing
computations on sizes so we ignore tile (produced for example by
the NSTableColumns) during the computation. We perform a global
tile at the end */
BOOL _tilingDisabled;
NSDragOperation _draggingSourceOperationMaskForLocal;
NSDragOperation _draggingSourceOperationMaskForRemote;
}
/* Data Source */
- (void) setDataSource: (id)anObject;
- (id) dataSource;
/* Loading data */
- (void) reloadData;
/* Target-action */
- (void) setDoubleAction: (SEL)aSelector;
- (SEL) doubleAction;
- (NSInteger) clickedColumn;
- (NSInteger) clickedRow;
/* Configuration */
- (void) setAllowsColumnReordering: (BOOL)flag;
- (BOOL) allowsColumnReordering;
- (void) setAllowsColumnResizing: (BOOL)flag;
- (BOOL) allowsColumnResizing;
- (void) setAllowsMultipleSelection: (BOOL)flag;
- (BOOL) allowsMultipleSelection;
- (void) setAllowsEmptySelection: (BOOL)flag;
- (BOOL) allowsEmptySelection;
- (void) setAllowsColumnSelection: (BOOL)flag;
- (BOOL) allowsColumnSelection;
/* Drawing Attributes */
- (void) setIntercellSpacing: (NSSize)aSize;
- (NSSize) intercellSpacing;
- (void) setRowHeight: (CGFloat)rowHeight;
- (CGFloat) rowHeight;
- (void) setBackgroundColor: (NSColor *)aColor;
- (NSColor *) backgroundColor;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
- (void) setUsesAlternatingRowBackgroundColors: (BOOL)useAlternatingRowColors;
- (BOOL) usesAlternatingRowBackgroundColors;
#endif
/* Columns */
- (void) addTableColumn: (NSTableColumn *)aColumn;
- (void) removeTableColumn: (NSTableColumn *)aColumn;
- (void) moveColumn: (NSInteger)columnIndex toColumn: (NSInteger)newIndex;
- (NSArray *) tableColumns;
- (NSInteger) columnWithIdentifier: (id)identifier;
- (NSTableColumn *) tableColumnWithIdentifier: (id)anObject;
/* Selecting Columns and Rows */
- (void) selectColumn: (NSInteger) columnIndex byExtendingSelection: (BOOL)flag;
- (void) selectRow: (NSInteger) rowIndex byExtendingSelection: (BOOL)flag;
- (void) selectColumnIndexes: (NSIndexSet *)indexes byExtendingSelection: (BOOL)extend;
- (void) selectRowIndexes: (NSIndexSet *)indexes byExtendingSelection: (BOOL)extend;
- (NSIndexSet *) selectedColumnIndexes;
- (NSIndexSet *) selectedRowIndexes;
- (void) deselectColumn: (NSInteger)columnIndex;
- (void) deselectRow: (NSInteger)rowIndex;
- (NSInteger) numberOfSelectedColumns;
- (NSInteger) numberOfSelectedRows;
- (NSInteger) selectedColumn;
- (NSInteger) selectedRow;
- (BOOL) isColumnSelected: (NSInteger)columnIndex;
- (BOOL) isRowSelected: (NSInteger)rowIndex;
- (NSEnumerator *) selectedColumnEnumerator;
- (NSEnumerator *) selectedRowEnumerator;
- (void) selectAll: (id)sender;
- (void) deselectAll: (id)sender;
/* Table Dimensions */
- (NSInteger) numberOfColumns;
- (NSInteger) numberOfRows;
/* Grid Drawing attributes */
- (void) setDrawsGrid: (BOOL)flag;
- (BOOL) drawsGrid;
- (void) setGridColor: (NSColor *)aColor;
- (NSColor *) gridColor;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
- (void) setGridStyleMask: (NSTableViewGridLineStyle)gridType;
- (NSTableViewGridLineStyle) gridStyleMask;
#endif
/* Proving Cells */
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
- (NSCell *) preparedCellAtColumn: (NSInteger)columnIndex row: (NSInteger)rowIndex;
#endif
/* Editing Cells */
/* ALL TODOS */
- (void) editColumn: (NSInteger)columnIndex
row: (NSInteger)rowIndex
withEvent: (NSEvent *)theEvent
select: (BOOL)flag;
- (NSInteger) editedRow;
- (NSInteger) editedColumn;
/* Auxiliary Components */
- (void) setHeaderView: (NSTableHeaderView*)aHeaderView;
- (NSTableHeaderView*) headerView;
- (void) setCornerView: (NSView*)aView;
- (NSView*) cornerView;
/* Layout */
- (NSRect) rectOfColumn: (NSInteger)columnIndex;
- (NSRect) rectOfRow: (NSInteger)rowIndex;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
- (NSIndexSet *) columnIndexesInRect: (NSRect)aRect;
#endif
- (NSRange) columnsInRect: (NSRect)aRect;
- (NSRange) rowsInRect: (NSRect)aRect;
- (NSInteger) columnAtPoint: (NSPoint)aPoint;
- (NSInteger) rowAtPoint: (NSPoint)aPoint;
- (NSRect) frameOfCellAtColumn: (NSInteger)columnIndex
row: (NSInteger)rowIndex;
- (void) setAutoresizesAllColumnsToFit: (BOOL)flag;
- (BOOL) autoresizesAllColumnsToFit;
- (void) sizeLastColumnToFit;
- (void) noteNumberOfRowsChanged;
- (void) tile;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
- (NSTableViewColumnAutoresizingStyle) columnAutoresizingStyle;
- (void) setColumnAutoresizingStyle: (NSTableViewColumnAutoresizingStyle)style;
- (void) noteHeightOfRowsWithIndexesChanged: (NSIndexSet*)indexes;
#endif
/* Drawing */
- (void) drawRow: (NSInteger)rowIndex clipRect: (NSRect)clipRect;
- (void) drawGridInClipRect: (NSRect)aRect;
- (void) highlightSelectionInClipRect: (NSRect)clipRect;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
- (void) drawBackgroundInClipRect: (NSRect)clipRect;
#endif
/* Scrolling */
- (void) scrollRowToVisible: (NSInteger)rowIndex;
- (void) scrollColumnToVisible: (NSInteger)columnIndex;
/* Text delegate methods */
- (BOOL) textShouldBeginEditing: (NSText *)textObject;
- (void) textDidBeginEditing: (NSNotification *)aNotification;
- (void) textDidChange: (NSNotification *)aNotification;
- (BOOL) textShouldEndEditing: (NSText *)textObject;
- (void) textDidEndEditing: (NSNotification *)aNotification;
/* Persistence */
- (NSString *) autosaveName;
- (BOOL) autosaveTableColumns;
- (void) setAutosaveName: (NSString *)name;
- (void) setAutosaveTableColumns: (BOOL)flag;
/* Delegate */
- (void) setDelegate: (id)anObject;
- (id) delegate;
/* indicator image */
/* NB: ALL TODOS */
- (NSImage *) indicatorImageInTableColumn: (NSTableColumn *)aTableColumn;
- (void) setIndicatorImage: (NSImage *)anImage
inTableColumn: (NSTableColumn *)aTableColumn;
/* highlighting columns */
/* NB: ALL TODOS */
- (NSTableColumn *) highlightedTableColumn;
- (void) setHighlightedTableColumn: (NSTableColumn *)aTableColumn;
/* dragging rows */
/* NB: ALL TODOS */
- (NSImage*) dragImageForRows: (NSArray*)dragRows
event: (NSEvent*)dragEvent
dragImageOffset: (NSPoint*)dragImageOffset;
- (void) setDropRow: (NSInteger)row
dropOperation: (NSTableViewDropOperation)operation;
- (void) setVerticalMotionCanBeginDrag: (BOOL)flag;
- (BOOL) verticalMotionCanBeginDrag;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
- (BOOL) canDragRowsWithIndexes: (NSIndexSet*)indexes
atPoint: (NSPoint)point;
- (NSImage *) dragImageForRowsWithIndexes: (NSIndexSet*)rows
tableColumns: (NSArray*)cols
event: (NSEvent*)event
offset: (NSPoint*)offset;
- (void) setDraggingSourceOperationMask: (NSDragOperation)mask
forLocal: (BOOL)isLocal;
#endif
/* sorting */
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
- (void) setSortDescriptors: (NSArray *)array;
- (NSArray *) sortDescriptors;
#endif
@end /* interface of NSTableView */
@interface NSTableView (GNUPrivate)
- (void) _sendDoubleActionForColumn: (NSInteger)columnIndex;
- (void) _selectColumn: (NSInteger)columnIndex
modifiers: (unsigned int)modifiers;
@end
/*
* Informal protocol NSTableDataSource
*/
@protocol NSTableViewDataSource
#ifdef __OBJC2__
@optional
#else
@end
@interface NSObject (NSTableDataSource)
#endif
/**
* Returns the number of records that the data source manages for <em>aTableView</em>.
*/
- (NSInteger) numberOfRowsInTableView: (NSTableView *)aTableView;
- (id) tableView: (NSTableView *)aTableView
objectValueForTableColumn: (NSTableColumn *)aTableColumn
row: (NSInteger)rowIndex;
- (void) tableView: (NSTableView *)aTableView
setObjectValue: (id)anObject
forTableColumn: (NSTableColumn *)aTableColumn
row: (NSInteger)rowIndex;
/* Dragging */
- (BOOL) tableView: (NSTableView*)tableView
acceptDrop: (id <NSDraggingInfo>)info
row: (NSInteger)row
dropOperation: (NSTableViewDropOperation)operation;
- (NSDragOperation) tableView: (NSTableView*)tableView
validateDrop: (id <NSDraggingInfo>)info
proposedRow: (NSInteger)row
proposedDropOperation: (NSTableViewDropOperation)operation;
- (BOOL) tableView: (NSTableView*)tableView
writeRows: (NSArray*)rows
toPasteboard: (NSPasteboard*)pboard;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
- (void) tableView: (NSTableView*)tableView
sortDescriptorsDidChange: (NSArray *)oldSortDescriptors;
#endif
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
- (BOOL) tableView: (NSTableView*)tableView
writeRowsWithIndexes: (NSIndexSet*)rows
toPasteboard: (NSPasteboard*)pboard;
- (NSArray *) tableView: (NSTableView *)aTableView
namesOfPromisedFilesDroppedAtDestination: (NSURL *)dropDestination
forDraggedRowsWithIndexes: (NSIndexSet *)indexSet;
#endif
@end
APPKIT_EXPORT NSString *NSTableViewColumnDidMoveNotification;
APPKIT_EXPORT NSString *NSTableViewColumnDidResizeNotification;
APPKIT_EXPORT NSString *NSTableViewSelectionDidChangeNotification;
APPKIT_EXPORT NSString *NSTableViewSelectionIsChangingNotification;
/*
* Methods Implemented by the Delegate
*/
@protocol NSTableViewDelegate <NSObject>
#ifdef __OBJC2__
@optional
#else
@end
@interface NSObject (NSTableViewDelegate)
#endif
- (BOOL) selectionShouldChangeInTableView: (NSTableView *)aTableView;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_3, GS_API_LATEST)
- (void) tableView: (NSTableView*)tableView
didClickTableColumn: (NSTableColumn *)tableColumn;
- (void) tableView: (NSTableView*)tableView
didDragTableColumn: (NSTableColumn *)tableColumn;
- (void) tableView: (NSTableView*)tableView
mouseDownInHeaderOfTableColumn: (NSTableColumn *)tableColumn;
#endif
- (BOOL)tableView: (NSTableView *)aTableView
shouldEditTableColumn: (NSTableColumn *)aTableColumn
row: (NSInteger)rowIndex;
- (BOOL) tableView: (NSTableView *)aTableView
shouldSelectRow: (NSInteger)rowIndex;
- (BOOL) tableView: (NSTableView *)aTableView
shouldSelectTableColumn: (NSTableColumn *)aTableColumn;
- (void) tableView: (NSTableView *)aTableView
willDisplayCell: (id)aCell
forTableColumn: (NSTableColumn *)aTableColumn
row: (NSInteger)rowIndex;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
- (NSCell *) tableView: (NSTableView *)aTableView
dataCellForTableColumn: (NSTableColumn *)aTableColumn
row: (NSInteger)rowIndex;
#endif
- (void) tableViewColumnDidMove: (NSNotification *)aNotification;
- (void) tableViewColumnDidResize: (NSNotification *)aNotification;
- (void) tableViewSelectionDidChange: (NSNotification *)aNotification;
- (void) tableViewSelectionIsChanging: (NSNotification *)aNotification;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
- (CGFloat) tableView: (NSTableView *)tableView
heightOfRow: (NSInteger)row;
- (NSString *) tableView: (NSTableView *)tableView
toolTipForCell: (NSCell *)cell
rect: (NSRect *)rect
tableColumn: (NSTableColumn *)col
row: (NSInteger)row
mouseLocation: (NSPoint)mouse;
#endif
@end
#endif /* _GNUstep_H_NSTableView */
|