home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.0
/
NeXTSTEP3.0.iso
/
NextDeveloper
/
Headers
/
dbkit
/
DBTableView.h
< prev
next >
Wrap
Text File
|
1992-07-09
|
6KB
|
235 lines
/*
** DBTableView.h
** Database Kit, Release 3.0
** Copyright (c) 1992, NeXT Computer, Inc. All rights reserved.
*/
#import <appkit/graphics.h>
#import <appkit/ScrollView.h>
#import <dbkit/tableProtocols.h>
typedef enum {
DB_RADIOMODE = 0,
DB_LISTMODE = 2, /* these defs are same as NX_xxxx */
DB_NOSELECT = 5
} DBSelectionMode;
@interface DBTableView : ScrollView
{
@private
struct {
unsigned int hideRows:1,
hideColumns:1,
editingAllowed:1,
dynamicRows:1,
dynamicColumns:1,
radioMode:1,
listMode:1,
allowEmpty:1,
gridVisible:1,
useArrowKeys:1,
allowsReordering:1,
allowsResizing:1,
unused:1,
clicks:3,
:16;
} _tvFlags;
unsigned int _tvReserved[3];
unsigned int _startVec,
_lastDragVec;
int _lastSelVector;
id _dragImage;
id _textFmt; /* default formatters */
id _editFmt;
@protected
id dataSource;
id delegate; /* gets doubleClick message */
id rowLayout; /* row/col layout info */
id columnLayout;
id rowHeading; /* shows row/col headings */
id columnHeading;
id rowsClip; /* clip views for headings */
id columnsClip;
id gridView; /* the actual data view */
id rowSel;
id columnSel;
id cornerView; /* view in upper left corner */
id target;
SEL doubleAction;
SEL action;
}
- initFrame:(const NXRect *) newFrame;
- free;
- setDataSource:aSource;
- dataSource;
- setDelegate:newDelegate;
- delegate;
- (BOOL) dynamicRows;
- (BOOL) dynamicColumns;
- setRowHeadingVisible: (BOOL) flag;
- (BOOL) isRowHeadingVisible;
- setColumnHeadingVisible: (BOOL) flag;
- (BOOL) isColumnHeadingVisible;
- setIntercell:(const NXSize *) aSize;
- getIntercell:(NXSize *) theSize;
- setGridVisible:(BOOL) flag;
- (BOOL) isGridVisible;
- acceptArrowKeys:(BOOL) flag;
- (BOOL) doesAcceptArrowKeys;
- allowVectorReordering:(BOOL) flag;
- (BOOL) doesAllowVectorReordering;
- allowVectorResizing:(BOOL) flag;
- (BOOL) d$ YllowVectorResizing;
- (BOOL) isHorizScrollerVisible;
- setHorizScrollerRequired:(BOOL) flag;
- (BOOL) isVertScrollerVisible;
- setVertScrollerRequired:(BOOL) flag;
/*
* Displaying the view
*/
- drawSelf:(const NXRect *) rects :(int) count;
/*
* Handling rows/columns
*/
- columnList;
- rowList;
- (unsigned int) columnCount;
- (unsigned int) rowCount;
- (id <DBTableVectors>) rowAt:(unsigned int) aPosition;
- (id <DBTableVectors>) columnAt:(unsigned int) aPosition;
- addColumn:identifier withTitle:(const char *) title;
- addColumn:identifier withFormatter:formatter andTitle:(const char *) title at:(unsigned int) aPosition;
- addRow:identifier withTitle:(const char *) title;
- addRow:identifier withFormatter:formatter andTitle:(const char *) title at:(unsigned int) aPosition;
- addColumn:aColumn at:(unsigned int) aPosition;
- removeColumnAt:(unsigned int) aPosition;
- addRow:aRow at:(unsigned int) aPosition;
- removeRowAt:(unsigned int) aPosition;
- (BOOL) moveColumnFrom:(unsigned int) oldPos to:(unsigned int) newPos;
- (BOOL) moveRowFrom:(unsigned int) oldPos to:(unsigned int) newPos;
- formatterAt:(unsigned int) row :(unsigned int) column;
/*
* Editing support.
*/
- editFieldAt:(unsigned int) row :(unsigned int) column;
- setEditable:(BOOL) flag;
- (BOOL) isEditable;
- endEditing;
/*
* Dealing with the selection
*/
- setMode:(int) newMode;
- (int) mode;
- allowEmptySel:(BOOL) flag;
- (BOOL) doesAllowEmptySel;
- (unsigned int) selectedRowCount;
- (unsigned int) selectedColumnCount;
- (int) selectedRow;
- (int) selectedColumn;
- (BOOL) isRowSelected:(unsigned int) row; /* for either mode */
- (BOOL) isColumnSelected:(unsigned int) column;
- deselectAll:sender; /* for List mode selection */
- selectAll:sender;
- setRowSelectionOn:(unsigned int) start :(unsigned int) end to:(BOOL) flag;
- setColumnSelectionOn:(unsigned int) start :(unsigned int) end to:(BOOL) flag;
- selectRow:(unsigned int) row byExtension:(BOOL) flag;
- selectColumn:(unsigned int) column byExtension:(BOOL) flag;
- deselectRow:(unsigned int) row;
- deselectColumn:(unsigned int) column;
- (unsigned int) selectedRowAfter:(unsigned int) aRow;
- (unsigned int) selectedColumnAfter:(unsigned int) aColumn;
- sendAction:(SEL) anAction to:anObject forSelectedRows:(BOOL) flag;
- sendAction:(SEL) anAction to:anObject fo$ `ectedColumns:(BOOL) flag;
/*
* Setting and finding out about pieces of the table.
*/
- rowHeading;
- setRowHeading:newRowHeading;
- columnHeading;
- setColumnHeading:newColumnHeading;
/*
* Notifications of change
*/
- rowsChangedFrom:(unsigned int) startRow to:(unsigned int) endRow;
- columnsChangedFrom:(unsigned int) startColumn to:(unsigned int) endColumn;
- reloadData:sender; /* update layout & redisplay all data */
- layoutChanged:sender; /* # rows, # cols or size changed */
/*
* Scrolling and other view methods
*/
- scrollRowToVisible:(unsigned int) row;
- scrollColumnToVisible:(unsigned int) column;
- scrollClip:aClip to:(const NXPoint *)newOrigin;
- sizeTo:(NXCoord) width:(NXCoord) height;
- (BOOL) acceptsFirstResponder;
- tile;
/*
* Target and Action
*/
- setAction:(SEL)aSelector;
- (SEL)action;
- setDoubleAction:(SEL)aSelector;
- (SEL)doubleAction;
- setTarget:anObject;
- target;
/*
* Archiving
*/
- read:(NXTypedStream *) stream;
- write:(NXTypedStream *) stream;
- finishUnarchiving;
@end
@interface Object(DBTableViewDelegate)
- tableViewDidChangeSelection:aTableView;
- (BOOL) tableViewWillChangeSelection:aTableView;
- tableView:sender movedColumnFrom:(unsigned int) old to:(unsigned int) new;
- tableView:sender movedRowFrom:(unsigned int) old to:(unsigned int) new;
@end