TTStyledText Class Reference
Public Member Functions | |
| (id) | - initWithNode: |
| (void) | - layoutFrames |
| (void) | - layoutIfNeeded |
| (void) | - setNeedsLayout |
| Called to indicate that the layout needs to be re-calculated. | |
| (void) | - drawAtPoint: |
| Draws the text at a point. | |
| (void) | - drawAtPoint:highlighted: |
| Draws the text at a point with optional highlighting. | |
| (TTStyledBoxFrame *) | - hitTest: |
| Determines which frame is intersected by a point. | |
| (TTStyledFrame *) | - getFrameForNode: |
| Finds the frame that represents the node. | |
| (void) | - addChild: |
| (void) | - addText: |
| (void) | - insertChild:atIndex: |
| (TTStyledNode *) | - getElementByClassName: |
| (void) | - stopLoadingImages |
| Cancels all network requests. | |
Static Public Member Functions | |
| (TTStyledText *) | + textFromXHTML: |
| Constructs styled text with XHTML tags turned into style nodes. | |
| (TTStyledText *) | + textFromXHTML:lineBreaks:URLs: |
| (TTStyledText *) | + textWithURLs: |
| Constructs styled text with all URLs transformed into links. | |
| (TTStyledText *) | + textWithURLs:lineBreaks: |
Protected Attributes | |
| TTStyledNode * | _rootNode |
| TTStyledFrame * | _rootFrame |
| UIFont * | _font |
| CGFloat | _width |
| CGFloat | _height |
| NSMutableArray * | _invalidImages |
| NSMutableArray * | _imageRequests |
| id< TTStyledTextDelegate > | _delegate |
Properties | |
| id< TTStyledTextDelegate > | delegate |
| TTStyledNode * | rootNode |
| The first in the sequence of nodes that contain the styled text. | |
| TTStyledFrame * | rootFrame |
| The first in the sequence of frames of text calculated by the layout. | |
| UIFont * | font |
| The font that will be used to measure and draw all text. | |
| CGFloat | width |
| The width that the text should be constrained to fit within. | |
| CGFloat | height |
| The height of the text. | |
| BOOL | needsLayout |
| Indicates if the text needs layout to recalculate its size. | |
| NSMutableArray * | invalidImages |
| Images that require loading. | |
Member Function Documentation
| - (void) drawAtPoint: | (CGPoint) | point | ||
| highlighted: | (BOOL) | highlighted | ||
Draws the text at a point with optional highlighting.
If highlighted is YES, text colors will be ignored and all text will be drawn in the same color.
| - (TTStyledFrame *) getFrameForNode: | (TTStyledNode*) | node |
Finds the frame that represents the node.
If multiple frames represent a node, such as an inline frame with line breaks, the first frame in the sequence will be returned.
| + (TTStyledText *) textFromXHTML: | (NSString*) | source |
Constructs styled text with XHTML tags turned into style nodes.
Only the following XHTML tags are supported: b, i, img, a. The source must be a well-formed XHTML fragment. You do not need to enclose the source in an tag -- it can be any string with XHTML tags throughout.
| + (TTStyledText *) textWithURLs: | (NSString*) | source |
Constructs styled text with all URLs transformed into links.
Only URLs are parsed, not HTML markup. URLs are turned into links.
Property Documentation
- (CGFloat) height [read, assign] |
The height of the text.
The height is automatically calculated based on the width and the size of word-wrapped text.
The documentation for this class was generated from the following files:
- Three20Style/Headers/TTStyledText.h
- Three20Style/Sources/TTStyledText.m
