The R Project SVN R-packages

Rev

Rev 5708 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
714 iacus 1
/*
2
 *  R.app : a Cocoa front end to: "R A Computer Language for Statistical Data Analysis"
3
 *  
4
 *  R.app Copyright notes:
1254 iacus 5
 *                     Copyright (C) 2004-5  The R Foundation
714 iacus 6
 *                     written by Stefano M. Iacus and Simon Urbanek
7
 *
8
 *                  
9
 *  R Copyright notes:
10
 *                     Copyright (C) 1995-1996   Robert Gentleman and Ross Ihaka
11
 *                     Copyright (C) 1998-2001   The R Development Core Team
12
 *                     Copyright (C) 2002-2004   The R Foundation
13
 *
14
 *  This program is free software; you can redistribute it and/or modify
15
 *  it under the terms of the GNU General Public License as published by
16
 *  the Free Software Foundation; either version 2 of the License, or
17
 *  (at your option) any later version.
18
 *
19
 *  This program is distributed in the hope that it will be useful,
20
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
 *  GNU General Public License for more details.
23
 *
24
 *  A copy of the GNU General Public License is available via WWW at
25
 *  http://www.gnu.org/copyleft/gpl.html.  You can also obtain it by
26
 *  writing to the Free Software Foundation, Inc., 59 Temple Place,
27
 *  Suite 330, Boston, MA  02111-1307  USA.
28
 */
700 urbaneks 29
 
30
#import <Cocoa/Cocoa.h>
31
 
5235 urbaneks 32
/* for pre-10.5 compatibility */
33
#ifndef NSINTEGER_DEFINED
34
#if __LP64__ || NS_BUILD_32_LIKE_64
35
typedef long NSInteger;
36
typedef unsigned long NSUInteger;
37
#else
38
typedef int NSInteger;
39
typedef unsigned int NSUInteger;
40
#endif
41
#define NSINTEGER_DEFINED 1
42
#endif
43
 
5708 urbaneks 44
@protocol NSTableViewDataSource <NSObject>
45
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView;
46
- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row;
47
@optional
48
- (void)tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row;
49
- (void)tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray *)oldDescriptors;
50
- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard;
51
- (NSDragOperation)tableView:(NSTableView *)tableView validateDrop:(id <NSDraggingInfo>)info proposedRow:(NSInteger)row proposedDropOperation:(NSTableViewDropOperation)dropOperation;
52
- (BOOL)tableView:(NSTableView *)tableView acceptDrop:(id <NSDraggingInfo>)info row:(NSInteger)row dropOperation:(NSTableViewDropOperation)dropOperation;
53
- (NSArray *)tableView:(NSTableView *)tableView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination forDraggedRowsWithIndexes:(NSIndexSet *)indexSet;
54
@end
55
 
5707 urbaneks 56
@interface SortableDataSource : NSObject <NSTableViewDataSource> {
700 urbaneks 57
    NSMutableArray *col;
58
    NSMutableArray *colNames;
5235 urbaneks 59
    NSUInteger rows;
700 urbaneks 60
    int *sortMap, *invSortMap;
1878 urbaneks 61
	int *filter, filterLen;
700 urbaneks 62
}
63
 
64
- (void) addColumn: (NSArray*) colCont withName: (NSString*) name;
65
- (void) addColumnOfLength: (int) clen withCStrings: (char**) cstr name: (NSString*) name;
926 urbaneks 66
- (void) addColumnOfLength: (int) clen withUTF8Strings: (char**) cstr name: (NSString*) name;
700 urbaneks 67
- (void) reset;
68
- (unsigned) count;
1878 urbaneks 69
- (unsigned) rows;
70
- (id) objectAtColumn: (NSString*) name row: (int) row; 
71
- (id) objectAtColumn: (NSString*) name index: (int) row; // index ignores filter
72
- (void) setFilter: (int*) f length: (int) fl;
73
- (void) resetFilter;
700 urbaneks 74
 
75
- (int)  numberOfRowsInTableView:(NSTableView *)tableView;
76
- (id)   tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row;
77
- (void) tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(int)row;
78
- (void) tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray *) oldDescriptors;
79
 
80
@end