36 - (BOOL)textShouldBeginEditing:(
CPText)aTextObject;
37 - (BOOL)textShouldEndEditing:(
CPText)aTextObject;
55 @
typedef CPTextMovement
67 @
typedef CPWritingDirection
72 @
typedef CPTextAlignment
114 - (void)setSelectable:(BOOL)flag
116 [
self willChangeValueForKey:@"selectable"];
117 _isSelectable = flag;
118 [
self didChangeValueForKey:@"selectable"];
124 - (void)setEditable:(BOOL)flag
126 [
self willChangeValueForKey:@"editable"];
128 [
self didChangeValueForKey:@"editable"];
134 - (void)changeFont:(
id)sender
136 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
139 - (void)copy:(
id)sender
149 [pasteboard declareTypes:[CPStringPboardType] owner:nil];
150 [pasteboard setString:[[
self stringValue] substringWithRange:selectedRange] forType:CPStringPboardType];
153 - (id)_plainStringForPasting
158 - (id)_stringForPasting
161 dataForPasting = [pasteboard stringForType:CPRTFPboardType],
162 stringForPasting = [pasteboard stringForType:CPStringPboardType];
164 if (dataForPasting || [stringForPasting hasPrefix:
"{\\rtf1\\ansi"])
165 stringForPasting = [[_CPRTFParser new] parseRTF:dataForPasting ? dataForPasting : stringForPasting];
168 stringForPasting = stringForPasting._string;
170 return stringForPasting;
173 - (void)paste:(
id)sender
175 var stringForPasting = [
self _stringForPasting];
177 if (stringForPasting)
178 [
self insertText:stringForPasting];
181 - (void)copyFont:(
id)sender
183 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
186 - (void)delete:(
id)sender
188 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
193 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
200 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
207 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
214 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
221 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
223 return CGSizeMake(0,0);
228 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
229 return CGSizeMake(0,0);
232 - (void)pasteFont:(
id)sender
234 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
237 - (void)replaceCharactersInRange:(CPRange)aRange withString:(
CPString)aString
239 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
242 - (void)scrollRangeToVisible:(CPRange)aRange
244 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
247 - (void)selectedAll:(
id)sender
249 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
254 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
261 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
264 - (void)setFont:(
CPFont)aFont range:(CPRange)aRange
266 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
269 - (void)setHorizontallyResizable:(BOOL)flag
271 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
274 - (void)setMaxSize:(CGSize)aSize
276 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
279 - (void)setMinSize:(CGSize)aSize
281 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
289 - (void)setUsesFontPanel:(BOOL)flag
291 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
294 - (void)setVerticallyResizable:(BOOL)flag
296 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
301 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
306 - (void)underline:(
id)sender
308 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
313 _CPRaiseInvalidAbstractInvocation(
self, _cmd);
332 [
self setSelectable:[aCoder decodeBoolForKey:CPTextViewIsSelectableKey]];
333 [
self setEditable:[aCoder decodeBoolForKey:CPTextViewIsEditableKey]];
334 [
self setRichText:[aCoder decodeBoolForKey:CPTextViewIsRichTextKey]];
343 [aCoder encodeBool:_isEditable forKey:CPTextViewIsEditableKey];
344 [aCoder encodeBool:_isSelectable forKey:CPTextViewIsSelectableKey];
345 [aCoder encodeBool:_isRichText forKey:CPTextViewIsRichTextKey];
363 - (void)setEditable:(BOOL)aValue
365 _isEditable = aValue;
373 return _isSelectable;
379 - (void)setSelectable:(BOOL)aValue
381 _isSelectable = aValue;
395 - (void)setRichText:(BOOL)aValue
397 _isRichText = aValue;
CPTextViewDidChangeSelectionNotification
id initWithCoder:(CPCoder aCoder)
var CPTextViewIsSelectableKey
CPWritingDirectionRightToLeft
CPString stringForType:(CPString aType)
CPForegroundColorAttributeName
A mutable character string with attributes.
CPAttachmentAttributeName
An immutable string (collection of characters).
BOOL isVerticallyResizable()
CPBackgroundColorAttributeName
void encodeWithCoder:(CPCoder aCoder)
CPTextMovement CPIllegalTextMovement
CPTextDidEndEditingNotification
A notification that can be posted to a CPNotificationCenter.
CPTextViewDidChangeTypingAttributesNotification
void setSelectable:(BOOL flag)
CPTextDidChangeNotification
CPUnderlineStyleAttributeName
CPWritingDirectionLeftToRight
Defines methods for use when archiving & restoring (enc/decoding).
CPParagraphSeparatorCharacter
CPSuperscriptAttributeName
CPTextAlignment CPLeftTextAlignment
CPCarriageReturnCharacter
CPBaselineOffsetAttributeName
CPTextDidBeginEditingNotification
var CPTextViewIsEditableKey
void setEditable:(BOOL flag)
CPWritingDirection CPWritingDirectionNatural
CPRange function CPMakeRange(location, length)
void replaceCharactersInRange:withString:(CPRange aRange, [withString] CPString aString)
void setRichText:(BOOL aValue)
var CPTextViewIsRichTextKey
BOOL isHorizontallyResizable()