Browse CVS Repository
Contents of /undmail/guiproto/MailBoxTableDataSource.m
Parent Directory
| Revision Log
| Revision Graph
Revision 1.2 -
( show annotations)
( download)
Sun Jan 26 14:50:49 2003 UTC
(21 years, 2 months ago)
by footashida
Branch: MAIN
Changes since 1.1: +3 -1 lines
*** empty log message ***
| 1 |
#import "MailBoxTableDataSource.h" |
| 2 |
#import "DUMMailBox.h" |
| 3 |
#import "DUMMail.h" |
| 4 |
|
| 5 |
@implementation MailBoxTableDataSource |
| 6 |
-(id)initWithMailBox:(DUMMailBox *)newMailBox{ |
| 7 |
self = [super init]; |
| 8 |
mailBox = newMailBox; |
| 9 |
[mailBox retain]; |
| 10 |
return self; |
| 11 |
} |
| 12 |
-(void)changeMailBox:(DUMMailBox *)newMailBox{ |
| 13 |
[mailBox release]; |
| 14 |
mailBox = newMailBox; |
| 15 |
[mailBox retain]; |
| 16 |
} |
| 17 |
- (int)numberOfRowsInTableView:(NSTableView *)aTableView{ |
| 18 |
return [mailBox countMail]; |
| 19 |
} |
| 20 |
- (id)tableView:(NSTableView *)aTableView |
| 21 |
objectValueForTableColumn:(NSTableColumn *)aTableColumn |
| 22 |
row:(int)rowIndex{ |
| 23 |
DUMMail *mail = [mailBox mailAtIndex:rowIndex]; |
| 24 |
if([[aTableColumn identifier] isEqual:@"FROM"]){ |
| 25 |
return [mail from]; |
| 26 |
}else if([[aTableColumn identifier] isEqual:@"SUBJECT"]){ |
| 27 |
return [mail subject]; |
| 28 |
}else{ |
| 29 |
return @""; |
| 30 |
} |
| 31 |
} |
| 32 |
-(DUMMailBox *)mailBox{ |
| 33 |
return mailBox; |
| 34 |
} |
| 35 |
@end |
|