home *** CD-ROM | disk | FTP | other *** search
- /*
- NSText.h
- Application Kit
- Copyright (c) 1994 NeXT, Inc. All rights reserved.
- */
-
- #import "NSView.h"
- #import "NSSpellChecker.h"
-
- @class NSColor;
- @class NSFont;
-
- typedef enum _NSTextAlignment {
- NSLeftTextAlignment = 0, /* Visually left aligned */
- NSRightTextAlignment = 1, /* Visually right aligned */
- NSCenterTextAlignment = 2,
- NSJustifiedTextAlignment = 3,
- NSNaturalTextAlignment = 4 /* Indicates the default alignment for script */
- } NSTextAlignment;
-
-
- @interface NSText : NSView
-
- - (NSString *)string;
- - (void)setString:(NSString *)string;
- - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)string;
-
- - (NSData *)RTFFromRange:(NSRange)range;
- - (NSData *)RTFDFromRange:(NSRange)range;
- - (void)replaceCharactersInRange:(NSRange)range withRTF:(NSData *)rtfData;
- - (void)replaceCharactersInRange:(NSRange)range withRTFD:(NSData *)rtfdData;
-
- - (BOOL)writeRTFDToFile:(NSString *)path atomically:(BOOL)flag;
- - (BOOL)readRTFDFromFile:(NSString *)path;
-
- - (BOOL)isEditable;
- - setEditable:(BOOL)flag;
- - (BOOL)isSelectable;
- - setSelectable:(BOOL)flag;
- - (BOOL)isRichText;
- - setRichText:(BOOL)flag;
- - (BOOL)importsGraphics;
- - setImportsGraphics:(BOOL)flag;
- - (id)delegate;
- - setDelegate:(id)anObject;
-
- - setFont:(NSFont *)obj;
- - (NSFont *)font;
- - setTextColor:(NXColor)color;
- - (NXColor)textColor;
- - setBackgroundColor:(NXColor)color;
- - (NXColor)backgroundColor;
- - setDrawsBackground:(BOOL)flag;
- - (BOOL)drawsBackground;
- - (NSTextAlignment)alignment;
- - setAlignment:(NSTextAlignment)mode;
-
- - (void)setFieldEditor:(BOOL)flag; /* A BOOL to indicate whether to end on CR, TAB, etc */
- - (BOOL)isFieldEditor;
-
- - (void)setTextColor:(NXColor)color range:(NSRange)range;
- - (void)setFont:(NXColor)font range:(NSRange)range;
-
- - (BOOL)usesFontPanel;
- - setUsesFontPanel:(BOOL)flag;
-
- - (NSSize)maxSize;
- - setMaxSize:(NSSize)newMaxSize;
- - (NSSize)minSize;
- - setMinSize:(NSSize)newMinSize;
-
- - (BOOL)isHorizontallyResizable;
- - setHorizontallyResizable:(BOOL)flag;
- - (BOOL)isVerticallyResizable;
- - setVerticallyResizable:(BOOL)flag;
-
- - sizeToFit;
-
- - copy:(id)sender;
- - copyFont:(id)sender;
- - copyRuler:(id)sender;
- - cut:(id)sender;
- - delete:(id)sender;
- - paste:(id)sender;
- - pasteFont:(id)sender;
- - pasteRuler:(id)sender;
- - selectAll:(id)sender;
- - changeFont:(id)sender;
- - alignLeft:(id)sender;
- - alignRight:(id)sender;
- - alignCenter:(id)sender;
- - subscript:(id)sender;
- - superscript:(id)sender;
- - underline:(id)sender;
- - unscript:(id)sender;
- - showGuessPanel:(id)sender;
- - checkSpelling:(id)sender;
- - toggleRuler:(id)sender;
-
- - (BOOL)isRulerVisible;
-
- - (NSRange)selectedRange;
- - (void)setSelectedRange:(NSRange)range;
-
- - (void)scrollRangeToVisible:(NSRange)range;
-
- @end
-
- @interface NSObject(NSTextDelegate)
- - (BOOL)textShouldBeginEditing:(NSText *)textObject; /* YES means do it */
- - (BOOL)textShouldEndEditing:(NSText *)textObject; /* YES means do it */
- - textDidBeginEditing:(NSNotification *)textObject;
- - textDidEndEditing:(NSNotification *)textObject;
- - textDidChange:(NSNotification *)textObject; /* Any keyDown or paste which changes the contents causes this */
- @end
-
- /* Notifications */
- extern NSString *NSTextDidBeginEditingNotification;
- extern NSString *NSTextDidEndEditingNotification;
- extern NSString *NSTextDidChangeNotification;
-
-
- @interface NSText(ObsoleteAfterColorConversion)
- - setBackgroundGray:(float)value;
- - (float)backgroundGray;
- - setTextGray:(float)value;
- - (float)textGray;
- - (float)selGray;
- @end