Skip to content
Newer
Older
100644 81 lines (54 sloc) 1.72 KB
1bf64de @odrobnik replaced own rounded rect with UIBezierPath
odrobnik authored
1 //
2 // DTCSSStylesheet.h
3 // CoreTextExtensions
4 //
5 // Created by Oliver Drobnik on 9/5/11.
6 // Copyright (c) 2011 Drobnik.com. All rights reserved.
7 //
8
afd603b @odrobnik Mac Compatibility Mode: for Mac based UnitTest to compare generated o…
odrobnik authored
9 #import <Foundation/Foundation.h>
05aa188 @dhoerl Looking real good now - no leaks
dhoerl authored
10
8cd0941 @odrobnik Implemented simple rule-based Stylesheet support. Thanks to Dawson To…
odrobnik authored
11 @class DTHTMLElement;
12
ce4f80a @odrobnik Cleanup and added AppleDoc comments
odrobnik authored
13 /**
14 This class represents a CSS style sheet used for specifying formatting for certain CSS selectors.
15
16 It supports matching styles by class, by id or by tag name. Hierarchy matching is not supported yet.
17 */
371429d @odrobnik Implmeneted NSCopying
odrobnik authored
18 @interface DTCSSStylesheet : NSObject <NSCopying>
8cd0941 @odrobnik Implemented simple rule-based Stylesheet support. Thanks to Dawson To…
odrobnik authored
19
3d10aac @odrobnik moved default style sheet into default.css, this is included in binar…
odrobnik authored
20
ce4f80a @odrobnik Cleanup and added AppleDoc comments
odrobnik authored
21 /**
22 @name Creating Stylesheets
23 */
24
25 /**
26 Creates the default stylesheet.
27
28 This stylesheet is based on the standard styles that Webkit provides for these tags. This stylesheet is loaded from an embedded copy of default.css.
29 */
3d10aac @odrobnik moved default style sheet into default.css, this is included in binar…
odrobnik authored
30 + (DTCSSStylesheet *)defaultStyleSheet;
31
ce4f80a @odrobnik Cleanup and added AppleDoc comments
odrobnik authored
32
33 /**
34 Creates a stylesheet with a given style block
35
36 @param css The CSS string for the style block
37 */
8cd0941 @odrobnik Implemented simple rule-based Stylesheet support. Thanks to Dawson To…
odrobnik authored
38 - (id)initWithStyleBlock:(NSString *)css;
39
40
ce4f80a @odrobnik Cleanup and added AppleDoc comments
odrobnik authored
41 /**
42 @name Working with CSS Style Blocks
43 */
44
45
46 /**
47 Parses a style block string and adds the found style rules to the receiver.
48
49 @param css The CSS string for the style block
50 */
8cd0941 @odrobnik Implemented simple rule-based Stylesheet support. Thanks to Dawson To…
odrobnik authored
51 - (void)parseStyleBlock:(NSString *)css;
52
53
ce4f80a @odrobnik Cleanup and added AppleDoc comments
odrobnik authored
54 /**
55 Merges styles from given stylesheet into the receiver
56
57 @param stylesheet the stylesheet to merge
58 */
59 - (void)mergeStylesheet:(DTCSSStylesheet *)stylesheet;
60
61
62 /**
63 @name Accessing Style Information
64 */
65
66 /**
67 Returns a dictionary that contains the merged style for a given element and the applicable style rules from the receiver.
68
69 @param element The HTML element.
70 @returns The merged style dictionary containing only styles which selector matches the element
71 */
8cd0941 @odrobnik Implemented simple rule-based Stylesheet support. Thanks to Dawson To…
odrobnik authored
72 - (NSDictionary *)mergedStyleDictionaryForElement:(DTHTMLElement *)element;
1bf64de @odrobnik replaced own rounded rect with UIBezierPath
odrobnik authored
73
7c41509 @sbeigel Added "merge stylesheet" functionality
sbeigel authored
74
ce4f80a @odrobnik Cleanup and added AppleDoc comments
odrobnik authored
75 /**
76 Returns a dictionary of the styles of the receiver
77 */
eaac650 @odrobnik Exposed styles dictionary for external use
odrobnik authored
78 - (NSDictionary *)styles;
79
1bf64de @odrobnik replaced own rounded rect with UIBezierPath
odrobnik authored
80 @end
Something went wrong with that request. Please try again.