Documentation

ETTextProtocols documentation

ETText <NSObject>

AuthorsGenerated by builder
Declared inETTextProtocols.h

Overview

The ETText protocol is implemented by all objects in a structured text tree. It describes an abstract way of interacting with regions of structured text, which may or or may not have children.


Default

- (unichar) characterAtIndex: (NSUInteger)anIndex

Returns the character at the specified index in the text object. This method is NSString-compatible.

    - (void) setCustomAttributes: (NSDictionary *)attributes range: (NSRange)aRange

    Sets custom attributes for a specified range. When sent to a leaf node, the range must cover the entire node. When sent to any other node, it will transform the tree as required to modify the specified range.

      - (NSUInteger) buildStyleFromIndex: (NSUInteger)anIndex withStyleBuilder: (ETStyleBuilder *)aBuilder

      Builds the style from the specified index in this text object. Returns the end of the range for which this style is valid.

        - (void) replaceCharactersInRange: (NSRange)aRange withString: (NSString *)aString

        Replaces the characters in the specified range with a string. This method is compatible with the same method in NSString and will transform the tree as required to support the modification.

          - (void) appendString: (NSString *)aString

          Appends the string to the current text object.

            - (id <ETText>) splitAtIndex: (NSUInteger)anIndex

            Splits the receiver at the specified index. The returned value is a new text tree containing all of the text before the index. The receiver contains only the elements after.

              - (void) visitWithVisitor: (id <ETTextVisitor>)aVisitor

              Visits the element and it's children using the specified visitor.

                - (NSString *) stringValue

                Returns a string representing the receiver.

                  - (void) setStringValue: (NSString *)aString

                  Sets a string representing the receiver.

                  The implementation must notify the parent using -[ETTextGroup childDidChange] .

                    - (void) replaceInParentWithTextNode: (id <ETText>)aNode

                    Replace this text node in its parent with the one given as the argument.