forked from martinhewitson/TeXnicle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImageTextCell.h
42 lines (31 loc) · 1.3 KB
/
ImageTextCell.h
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
//
// ImageTextCell.h
// SofaControl
//
// Created by Martin Kahr on 10.10.06.
// Copyright 2006 CASE Apps. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface ImageTextCell : NSTextFieldCell {
NSObject* delegate;
NSString* iconKeyPath;
NSString* primaryTextKeyPath;
NSString* secondaryTextKeyPath;
}
- (void) setDataDelegate: (NSObject*) aDelegate;
- (void) setIconKeyPath: (NSString*) path;
- (void) setPrimaryTextKeyPath: (NSString*) path;
- (void) setSecondaryTextKeyPath: (NSString*) path;
@end
@interface NSObject(ImageTextCellDelegate)
- (NSImage*) iconForCell: (ImageTextCell*) cell data: (NSObject*) data;
- (NSString*) primaryTextForCell: (ImageTextCell*) cell data: (NSObject*) data;
- (NSString*) secondaryTextForCell: (ImageTextCell*) cell data: (NSObject*) data;
// optional: give the delegate a chance to set a different data object
// This is especially useful for those cases where you do not want that NSCell creates copies of your data objects (e.g. Core Data objects).
// In this case you bind a value to the NSTableColumn that enables you to retrieve the correct data object. You retrieve the objects
// in the method dataElementForCell
- (NSObject*) dataElementForCell: (ImageTextCell*) cell;
// optional
- (BOOL) disabledForCell: (ImageTextCell*) cell data: (NSObject*) data;
@end