home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / IntermediateFrameworks3 / AppKit.framework / Headers / NSText.h < prev    next >
Text File  |  1996-01-22  |  3KB  |  122 lines

  1. /*
  2.     NSText.h
  3.     Application Kit
  4.     Copyright (c) 1994 NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import "NSView.h"
  8. #import "NSSpellChecker.h"
  9.  
  10. @class NSColor;
  11. @class NSFont;
  12.  
  13. typedef enum _NSTextAlignment {
  14.     NSLeftTextAlignment        = 0, /* Visually left aligned */
  15.     NSRightTextAlignment    = 1, /* Visually right aligned */
  16.     NSCenterTextAlignment    = 2,
  17.     NSJustifiedTextAlignment    = 3,
  18.     NSNaturalTextAlignment    = 4  /* Indicates the default alignment for script */
  19. } NSTextAlignment;
  20.  
  21.  
  22. @interface NSText : NSView 
  23.  
  24. - (NSString *)string;
  25. - (void)setString:(NSString *)string;
  26. - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)string;
  27.  
  28. - (NSData *)RTFFromRange:(NSRange)range;
  29. - (NSData *)RTFDFromRange:(NSRange)range;
  30. - (void)replaceCharactersInRange:(NSRange)range withRTF:(NSData *)rtfData;
  31. - (void)replaceCharactersInRange:(NSRange)range withRTFD:(NSData *)rtfdData;
  32.  
  33. - (BOOL)writeRTFDToFile:(NSString *)path atomically:(BOOL)flag;
  34. - (BOOL)readRTFDFromFile:(NSString *)path;
  35.  
  36. - (BOOL)isEditable;
  37. - setEditable:(BOOL)flag;
  38. - (BOOL)isSelectable;
  39. - setSelectable:(BOOL)flag;
  40. - (BOOL)isRichText;
  41. - setRichText:(BOOL)flag;
  42. - (BOOL)importsGraphics;
  43. - setImportsGraphics:(BOOL)flag;
  44. - (id)delegate;
  45. - setDelegate:(id)anObject;
  46.  
  47. - setFont:(NSFont *)obj;
  48. - (NSFont *)font;
  49. - setTextColor:(NSColor *)color;
  50. - (NSColor *)textColor;
  51. - setBackgroundColor:(NSColor *)color;
  52. - (NSColor *)backgroundColor;
  53. - setDrawsBackground:(BOOL)flag;
  54. - (BOOL)drawsBackground;
  55. - (NSTextAlignment)alignment;
  56. - setAlignment:(NSTextAlignment)mode;
  57.  
  58. - (void)setFieldEditor:(BOOL)flag; /* A BOOL to indicate whether to end on CR, TAB, etc */
  59. - (BOOL)isFieldEditor;
  60.  
  61. - (void)setTextColor:(NSColor *)color range:(NSRange)range;
  62. - (void)setFont:(NSColor *)font range:(NSRange)range;
  63.  
  64. - (BOOL)usesFontPanel;
  65. - setUsesFontPanel:(BOOL)flag;
  66.  
  67. - (NSSize)maxSize;
  68. - setMaxSize:(NSSize)newMaxSize;
  69. - (NSSize)minSize;
  70. - setMinSize:(NSSize)newMinSize;
  71.  
  72. - (BOOL)isHorizontallyResizable;
  73. - setHorizontallyResizable:(BOOL)flag;
  74. - (BOOL)isVerticallyResizable;
  75. - setVerticallyResizable:(BOOL)flag;
  76.  
  77. - sizeToFit;
  78.  
  79. - copy:(id)sender;
  80. - copyFont:(id)sender;
  81. - copyRuler:(id)sender;
  82. - cut:(id)sender;
  83. - delete:(id)sender;
  84. - paste:(id)sender;
  85. - pasteFont:(id)sender;
  86. - pasteRuler:(id)sender;
  87. - selectAll:(id)sender;
  88. - changeFont:(id)sender;
  89. - alignLeft:(id)sender;
  90. - alignRight:(id)sender;
  91. - alignCenter:(id)sender;
  92. - subscript:(id)sender;
  93. - superscript:(id)sender;
  94. - underline:(id)sender;
  95. - unscript:(id)sender;
  96. - showGuessPanel:(id)sender;
  97. - checkSpelling:(id)sender;
  98. - toggleRuler:(id)sender;
  99.  
  100. - (BOOL)isRulerVisible;
  101.  
  102. - (NSRange)selectedRange;
  103. - (void)setSelectedRange:(NSRange)range;
  104.  
  105. - (void)scrollRangeToVisible:(NSRange)range;
  106.  
  107. @end
  108.  
  109. @interface NSObject(NSTextDelegate)
  110. - (BOOL)textShouldBeginEditing:(NSText *)textObject; /* YES means do it */
  111. - (BOOL)textShouldEndEditing:(NSText *)textObject; /* YES means do it */
  112. - textDidBeginEditing:(NSNotification *)textObject;
  113. - textDidEndEditing:(NSNotification *)textObject;
  114. - textDidChange:(NSNotification *)textObject; /* Any keyDown or paste which changes the contents causes this */
  115. @end
  116.  
  117. /* Notifications */
  118. extern NSString *NSTextDidBeginEditingNotification;
  119. extern NSString *NSTextDidEndEditingNotification;
  120. extern NSString *NSTextDidChangeNotification;
  121.  
  122.