NSTextStorage

NSTextStorage Mac OS X 10.0

This subclass of NSMutableAttributedString is the data model for Cocoa's text-handling system. NSTextStorage manages one or more NSLayoutManagers, which are responsible for determining how the text should be displayed. Two additional classes have an equally important role in the text-handling system, as does NSTextStorage: NSTextContainer and NSTextView. In terms of the Model-View-Controller pattern, NSTextStorage is the model, NSTextView is the view, and NSLayoutManager and NSTextContainer serve as controllers between the data layer and the view layer.

figs/cocn_15108.gif

@interface NSTextStorage : NSMutableAttributedString
 // Accessor Methods
   - (void)setParagraphs:(NSArray *)paragraphs;
   - (NSArray *)paragraphs;
   - (void)setForegroundColor:(NSColor *)color;
   - (NSColor *)foregroundColor;
   - (void)setCharacters:(NSArray *)characters;
   - (NSArray *)characters;
   - (void)setAttributeRuns:(NSArray *)attributeRuns;
   - (NSArray *)attributeRuns;
   - (void)setDelegate:(id)delegate;
   - (id)delegate;
   - (void)setWords:(NSArray *)words;
   - (NSArray *)words;
   - (void)setFont:(NSFont *)font;
   - (NSFont *)font;
 // Instance Methods
   - (void)addLayoutManager:(NSLayoutManager *)obj;
   - (int)changeInLength;
   - (void)edited:(unsigned)editedMask range:(NSRange)range changeInLength:(int)delta;
   - (unsigned)editedMask;
   - (NSRange)editedRange;
   - (void)ensureAttributesAreFixedInRange:(NSRange)range;
   - (BOOL)fixesAttributesLazily;
   - (void)invalidateAttributesInRange:(NSRange)range;
   - (NSArray *)layoutManagers;
   - (void)processEditing;
   - (void)removeLayoutManager:(NSLayoutManager *)obj;
// Methods Implemented by the Delegate
   - (void)textStorageDidProcessEditing:(NSNotification *)notification;
   - (void)textStorageWillProcessEditing:(NSNotification *)notification;
// Notifications
   NSTextStorageDidProcessEditingNotification;
   NSTextStorageWillProcessEditingNotification;



    Part II: API Quick Reference
    Chapter 13. Foundation Classes