-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathETStyleBuilder.h
43 lines (40 loc) · 1.31 KB
/
ETStyleBuilder.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
#import <Foundation/NSObject.h>
@class NSMutableDictionary;
@class NSDictionary;
@protocol ETStyleTransformer
- (NSDictionary*)presentationAttributesForType: (id)aType;
@end
/**
* The ETStyleBuilder class is used to construct a presentation style for a
* specific region of text in the tree. It is passed down from the root of the
* tree to the leaf, collecting attributes from styles and from overrides as it
* goes.
*/
@interface ETStyleBuilder : NSObject
{
NSMutableDictionary *styleTransformers;
}
/**
* The current style. This can be modified externally if required. It should
* be reset to nil if you wish to reuse the style builder.
*/
@property (nonatomic, retain) NSMutableDictionary *style;
/**
* Registers a style transformer. Style transformers are used to generate
* presentation styles from semantic style information.
*
* Note: NOT YET IMPLEMENTED.
*/
- (void)registerTransformer: (id<ETStyleTransformer>)aTransformer
forTypeNamed: (NSString*)styleName;
/**
* Adds attributes from the specified style. This method is empty in the
* superclass. Subclasses implementing different styling policies should
* override this method.
*/
- (void)addAttributesForStyle: (id)style;
/**
* Adds custom presentation attributes.
*/
- (void)addCustomAttributes: (NSDictionary*)attributes;
@end