forked from jerrykrinock/ClassesObjC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSSDocInPrefs.h
64 lines (54 loc) · 1.63 KB
/
SSDocInPrefs.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#import <Cocoa/Cocoa.h>
////////////////////////////////////////////////
// ACCESSOR MACROS
//
// These macros may be used in the document .m file
// to generate accessors
//
// Note: SSBIDA = Sheep Systems Built-In Document Accessor
////////////////////////////////////////////////
// for objects (O)
#define SSBIDAO(NAME,SETNAME,KEY) - (void)SETNAME:(id)in { \
[self setObject:in forKey:KEY] ; \
} \
\
- (id)NAME { \
return [self objectForKey:KEY] ; \
} \
// for integer (I)
#define SSBIDAI(NAME,SETNAME,KEY) - (void)SETNAME:(int)in { \
[self setInteger:in forKey:KEY] ; \
} \
\
- (int)NAME { \
return [self integerForKey:KEY] ; \
} \
// for BOOL (B)
#define SSBIDAB(NAME,SETNAME,KEY) - (void)SETNAME:(BOOL)in { \
[self setBool:in forKey:KEY] ; \
} \
\
- (BOOL)NAME { \
return [self boolForKey:KEY] ; \
} \
@interface SSDocInPrefs : NSObject
{
NSString* _aggregateKey ;
NSString* _documentKey ;
NSDictionary* _defaultDefaults ;
}
- (id)initWithAggregateKey:(NSString*)aggregateName
documentKey:(NSString*)documentKey
defaultDefaults:(NSDictionary*)defaultDefaults ;
+ (id)SSBuiltInDocumentWithAggregateKey:(NSString*)aggregateKey
documentKey:(NSString*)documentKey
defaultDefaults:(NSDictionary*)defaultDefaults ;
- (void)setObject:(id)object forKey:(NSString*)attributeKey ;
- (id)objectForKey:(NSString*)attributeKey ;
- (void)setBool:(BOOL)yn forKey:(NSString*)attributeKey ;
- (BOOL)boolForKey:(NSString*)attributeKey ;
- (void)setInteger:(int)n forKey:(NSString*)attributeKey ;
- (int)integerForKey:(NSString*)attributeKey ;
- (void)removeObjectForKey:(NSString*)attributeKey ;
- (void)removeAllAttributes ;
@end