/usr/include/GNUstep/AppKit/NSText.h is in libgnustep-gui-dev 0.22.0-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | /* -*-objc-*-
NSText.h
The text object
Copyright (C) 1996 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: 1996
Author: Felipe A. Rodriguez <far@ix.netcom.com>
Date: July 1998
Author: Daniel Böhringer <boehring@biomed.ruhr-uni-bochum.de>
Date: August 1998
Author: Nicola Pero <n.pero@mi.flashnet.it>
Date: December 2000
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _GNUstep_H_NSText
#define _GNUstep_H_NSText
/*
* The NSText class is now an abstract class. When you allocate an
* instance of NSText, an instance of NSTextView is always allocated
* instead.
*
* But you can still subclass NSText to implement your own text
* editing class not derived from NSTextView. NSText declares general
* methods that a text editing object should have; it has some helper
* methods which are simple wrappers around the real basic editing
* methods. The real editing methods are not implemented in NSText,
* which is why it is abstract. To make a working subclass, you need to
* implement these methods, marked as "PRIMITIVE" below.
*
* The working subclass could potentially be implemented in absolutely
* *any* way you want. I have been told that some versions of Emacs can
* be embedded as an X subwindow inside alien widgets and windows - so
* yes, potentially if you are able to figure out how to embed Emacs
* inside the GNUstep NSView tree, you can write a subclass of NSText
* which just uses Emacs. */
#import <Foundation/NSObject.h>
#import <Foundation/NSRange.h>
#import <AppKit/NSView.h>
#import <AppKit/NSSpellProtocol.h>
//#import <AppKit/NSStringDrawing.h>
@class NSAttributedString;
@class NSData;
@class NSNotification;
@class NSString;
@class NSColor;
@class NSFont;
typedef enum _NSTextAlignment {
NSLeftTextAlignment = 0,
NSRightTextAlignment,
NSCenterTextAlignment,
NSJustifiedTextAlignment,
NSNaturalTextAlignment
} NSTextAlignment;
enum {
NSIllegalTextMovement = 0,
NSReturnTextMovement = 0x10,
NSTabTextMovement = 0x11,
NSBacktabTextMovement = 0x12,
NSLeftTextMovement = 0x13,
NSRightTextMovement = 0x14,
NSUpTextMovement = 0x15,
NSDownTextMovement = 0x16
};
enum {
NSParagraphSeparatorCharacter = 0x2029,
NSLineSeparatorCharacter = 0x2028,
NSTabCharacter = 0x0009,
NSFormFeedCharacter = 0x000c,
NSNewlineCharacter = 0x000a,
NSCarriageReturnCharacter = 0x000d,
NSEnterCharacter = 0x0003,
NSBackspaceCharacter = 0x0008,
NSBackTabCharacter = 0x0019,
NSDeleteCharacter = 0x007f,
};
/* The following are required by the original openstep doc. */
enum {
NSBackspaceKey = 8,
NSCarriageReturnKey = 13,
NSDeleteKey = 0x7f,
NSBacktabKey = 25
};
@interface NSText : NSView <NSChangeSpelling, NSIgnoreMisspelledWords>
{
}
/*
* Getting and Setting Contents
*/
/* these aren't in OPENSTEP */
- (void) replaceCharactersInRange: (NSRange)aRange
withRTF: (NSData*)rtfData;
- (void) replaceCharactersInRange: (NSRange)aRange
withRTFD: (NSData*)rtfdData;
/* PRIMITIVE */
- (void) replaceCharactersInRange: (NSRange)aRange
withString: (NSString*)aString;
/* PRIMITIVE */
-(void) replaceCharactersInRange: (NSRange)aRange /* GNUstep extension */
withAttributedString: (NSAttributedString *)attrString;
/* PRIMITIVE */
- (void) setString: (NSString*)aString;
/* PRIMITIVE */
- (NSString*) string;
/*
* Old fashioned OpenStep methods (wrappers for the previous ones)
*/
- (void) replaceRange: (NSRange)aRange withString: (NSString*)aString; /* not OPENSTEP */
- (void) replaceRange: (NSRange)aRange withRTF: (NSData*)rtfData;
- (void) replaceRange: (NSRange)aRange withRTFD: (NSData*)rtfdData;
- (void) setText: (NSString*)aString;
- (void) setText: (NSString*)aString range: (NSRange)aRange; /* not OPENSTEP */
- (NSString*) text;
/*
* Graphic attributes
*/
/* PRIMITIVE */
- (NSColor*) backgroundColor;
/* PRIMITIVE */
- (BOOL) drawsBackground;
/* PRIMITIVE */
- (void) setBackgroundColor: (NSColor*)color;
/* PRIMITIVE */
- (void) setDrawsBackground: (BOOL)flag;
/*
* Managing Global Characteristics
*/
- (BOOL) importsGraphics; /* PRIMITIVE */
- (BOOL) isEditable; /* PRIMITIVE */
- (BOOL) isFieldEditor; /* PRIMITIVE */
- (BOOL) isRichText; /* PRIMITIVE */
- (BOOL) isSelectable; /* PRIMITIVE */
- (void) setEditable: (BOOL)flag; /* PRIMITIVE */
- (void) setFieldEditor: (BOOL)flag; /* PRIMITIVE */
- (void) setImportsGraphics: (BOOL)flag; /* PRIMITIVE */
- (void) setRichText: (BOOL)flag; /* PRIMITIVE */
- (void) setSelectable: (BOOL)flag; /* PRIMITIVE */
/*
* Using the font panel
*/
- (void) setUsesFontPanel: (BOOL)flag; /* PRIMITIVE */
- (BOOL) usesFontPanel; /* PRIMITIVE */
/*
* Managing the Ruler
*/
- (BOOL) isRulerVisible; /* PRIMITIVE */
- (void) toggleRuler: (id)sender; /* PRIMITIVE */
/*
* Managing the Selection
*/
- (NSRange) selectedRange;
- (void) setSelectedRange: (NSRange)range;
/*
* Responding to Editing Commands
*/
- (void) copy: (id)sender; /* PRIMITIVE */
- (void) copyFont: (id)sender; /* PRIMITIVE */
- (void) copyRuler: (id)sender; /* PRIMITIVE */
- (void) cut: (id)sender;
- (void) delete: (id)sender; /* PRIMITIVE */
- (void) paste: (id)sender; /* PRIMITIVE */
- (void) pasteFont: (id)sender; /* PRIMITIVE */
- (void) pasteRuler: (id)sender; /* PRIMITIVE */
- (void) selectAll: (id)sender;
/*
* Managing Font
*/
- (void) changeFont: (id)sender; /* PRIMITIVE */
- (NSFont*) font; /* PRIMITIVE */
- (void) setFont: (NSFont*)font; /* PRIMITIVE */
- (void) setFont: (NSFont*)font range: (NSRange)aRange; /* PRIMITIVE */
/* Old OpenStep name for the same method. */
- (void) setFont: (NSFont*)font ofRange: (NSRange)aRange;
/*
* Managing Alignment
*/
- (NSTextAlignment) alignment; /* PRIMITIVE */
- (void) setAlignment: (NSTextAlignment)mode; /* PRIMITIVE */
- (void) alignCenter: (id)sender; /* PRIMITIVE */
- (void) alignLeft: (id)sender; /* PRIMITIVE */
- (void) alignRight: (id)sender; /* PRIMITIVE */
/*
* Text colour
*/
- (void) setTextColor: (NSColor*)color range: (NSRange)aRange; /* PRIMITIVE */ /* not OPENSTEP */
- (void) setColor: (NSColor*)color ofRange: (NSRange)aRange; /* PRIMITIVE */
- (void) setTextColor: (NSColor*)color; /* PRIMITIVE */
- (NSColor*) textColor; /* PRIMITIVE */
/*
* Text attributes
*/
- (void) subscript: (id)sender; /* PRIMITIVE */
- (void) superscript: (id)sender; /* PRIMITIVE */
- (void) underline: (id)sender; /* PRIMITIVE */
- (void) unscript: (id)sender; /* PRIMITIVE */
/*
* Reading and Writing RTFD Files
*/
-(BOOL) readRTFDFromFile: (NSString*)path; /* PRIMITIVE */
-(BOOL) writeRTFDToFile: (NSString*)path atomically: (BOOL)flag; /* PRIMITIVE */
-(NSData*) RTFDFromRange: (NSRange)aRange; /* PRIMITIVE */
-(NSData*) RTFFromRange: (NSRange)aRange; /* PRIMITIVE */
/*
* Sizing the Frame Rectangle
*/
- (BOOL) isHorizontallyResizable; /* PRIMITIVE */
- (BOOL) isVerticallyResizable; /* PRIMITIVE */
- (NSSize) maxSize; /* PRIMITIVE */
- (NSSize) minSize; /* PRIMITIVE */
- (void) setHorizontallyResizable: (BOOL)flag; /* PRIMITIVE */
- (void) setMaxSize: (NSSize)newMaxSize; /* PRIMITIVE */
- (void) setMinSize: (NSSize)newMinSize; /* PRIMITIVE */
- (void) setVerticallyResizable: (BOOL)flag; /* PRIMITIVE */
- (void) sizeToFit; /* PRIMITIVE */
/*
* Spelling
*/
- (void) checkSpelling: (id)sender; /* PRIMITIVE */
- (void) showGuessPanel: (id)sender;
/*
* Scrolling
*/
- (void) scrollRangeToVisible: (NSRange)aRange; /* PRIMITIVE */
/*
* Managing the Delegate
*/
- (id) delegate; /* PRIMITIVE */
- (void) setDelegate: (id)anObject; /* PRIMITIVE */
/*
* NSChangeSpelling protocol
*/
- (void) changeSpelling: (id)sender; /* PRIMITIVE */
/*
* NSIgnoreMisspelledWords protocol
*/
- (void) ignoreSpelling: (id)sender; /* PRIMITIVE */ /* not OPENSTEP */
@end
@interface NSText (GNUstepExtensions)
- (unsigned) textLength; /* PRIMITIVE */
@end
/* Notifications */
APPKIT_EXPORT NSString *NSTextDidBeginEditingNotification;
APPKIT_EXPORT NSString *NSTextDidEndEditingNotification;
APPKIT_EXPORT NSString *NSTextDidChangeNotification;
@interface NSObject (NSTextDelegate)
- (BOOL) textShouldBeginEditing: (NSText*)textObject; /* YES means do it */
- (BOOL) textShouldEndEditing: (NSText*)textObject; /* YES means do it */
- (void) textDidBeginEditing: (NSNotification*)notification;
- (void) textDidEndEditing: (NSNotification*)notification;
- (void) textDidChange: (NSNotification*)notification; /* Any keyDown or paste which changes the contents causes this */
@end
#endif // _GNUstep_H_NSText
|