35 - (void)textStorageWillProcessEditing:(
CPNotification)aNotification;
36 - (void)textStorageDidProcessEditing:(
CPNotification)aNotification;
58 unsigned _implementedDelegateMethods;
63 #pragma mark Init methods 92 #pragma mark Delegate methods 94 - (void)setDelegate:(
id <CPTextStorageDelegate>)aDelegate
96 if (_delegate === aDelegate)
99 _implementedDelegateMethods = 0;
100 _delegate = aDelegate;
104 if ([_delegate respondsToSelector:
@selector(textStorageWillProcessEditing:)])
107 if ([_delegate respondsToSelector:
@selector(textStorageDidProcessEditing:)])
114 #pragma mark Layout manager methods 118 if ([_layoutManagers containsObject:aManager])
121 [aManager setTextStorage:self];
122 [_layoutManagers addObject:aManager];
127 if (![_layoutManagers containsObject:aManager])
130 [aManager setTextStorage:nil];
131 [_layoutManagers removeObject:aManager];
134 - (void)invalidateAttributesInRange:(CPRange)aRange
141 #pragma mark Editing methods 143 - (void)processEditing
145 [
self _sendDelegateWillProcessEditingNotification];
147 [
self _sendDelegateDidProcessEditingNotification];
149 var c = [_layoutManagers count];
151 for (var i = 0; i < c; i++)
153 [[_layoutManagers objectAtIndex:i] textStorage:self
156 changeInLength:_changeInLength
157 invalidatedRange:_editedRange];
181 - (void)edited:(
unsigned)editedMask range:(CPRange)aRange changeInLength:(
int)lengthChange
187 _editedMask = editedMask;
188 _changeInLength = lengthChange;
189 copyRange.length += lengthChange;
190 _editedRange = copyRange;
195 _editedMask |= editedMask;
196 _changeInLength += lengthChange;
197 copyRange.length += lengthChange;
200 _editedRange = copyRange;
206 - (void)removeAttribute:(
CPString)anAttribute range:(CPRange)aRange
222 - (void)deleteCharactersInRange:(CPRange)aRange
230 - (void)replaceCharactersInRange:(CPRange)aRange withString:(
CPString)aString
259 - (void)_sendDelegateWillProcessEditingNotification
267 - (void)_sendDelegateDidProcessEditingNotification
306 return _foregroundColor;
314 _foregroundColor = aValue;
338 return _layoutManagers;
344 - (CPRange)editedRange
352 - (int)changeInLength
354 return _changeInLength;
360 - (void)setChangeInLength:(
int)aValue
362 _changeInLength = aValue;
368 - (unsigned)editedMask
376 - (void)setEditedMask:(
unsigned)aValue
378 _editedMask = aValue;
void invalidateAttributesInRange:(CPRange aRange)
function CPUnionRange(lhsRange, rhsRange)
void postNotificationName:object:(CPString aNotificationName, [object] id anObject)
void addAttributes:range:(CPDictionary aDictionary, [range] CPRange aRange)
CPAttributedString attributedSubstringFromRange:(CPRange aRange)
CPNotificationCenter defaultCenter()
A mutable key-value pair collection.
void edited:range:changeInLength:(unsigned editedMask, [range] CPRange aRange, [changeInLength] int lengthChange)
A mutable character string with attributes.
id initWithName:object:userInfo:(CPString aNotificationName, [object] id anObject, [userInfo] CPDictionary aUserInfo)
An immutable string (collection of characters).
CPTextStorageWillProcessEditingNotification
var CPTextStorageDelegate_textStorageWillProcessEditing_
CPTextStorageEditedAttributes
void encodeWithCoder:(CPCoder aCoder)
id< CPTextStorageDelegate > _delegate accessors(property=delegate)
void removeAttribute:range:(CPString anAttribute, [range] CPRange aRange)
A notification that can be posted to a CPNotificationCenter.
id initWithString:attributes:(CPString aString, [attributes] CPDictionary attributes)
var CPTextStorageDelegate_textStorageDidProcessEditing_
function CPMakeRangeCopy(aRange)
Defines methods for use when archiving & restoring (enc/decoding).
id initWithCoder:(CPCoder aCoder)
id initWithString:attributes:(CPString aString, [attributes] CPDictionary attributes)
Sends messages (CPNotification) between objects.
void replaceCharactersInRange:withAttributedString:(CPRange aRange, [withAttributedString] CPAttributedString aString)
CPTextStorageDidProcessEditingNotification
CPTextStorageEditedCharacters
void replaceCharactersInRange:withString:(CPRange aRange, [withString] CPString aString)
void deleteCharactersInRange:(CPRange aRange)
CPRange function CPMakeRange(location, length)