NSText.inc 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. { Parsed from AppKit.framework NSText.h }
  2. {$ifdef TYPES}
  3. type
  4. NSTextPtr = ^NSText;
  5. NSTextDelegateProtocolPtr = ^NSTextDelegateProtocol;
  6. {$endif}
  7. {$ifdef TYPES}
  8. const
  9. NSEnterCharacter = $0003;
  10. NSBackspaceCharacter = $0008;
  11. NSTabCharacter = $0009;
  12. NSNewlineCharacter = $000a;
  13. NSFormFeedCharacter = $000c;
  14. NSCarriageReturnCharacter = $000d;
  15. NSBackTabCharacter = $0019;
  16. NSDeleteCharacter = $007f;
  17. NSLineSeparatorCharacter = $2028;
  18. NSParagraphSeparatorCharacter = $2029;
  19. type
  20. NSTextAlignment = NSUInteger;
  21. NSTextAlignmentPtr = ^NSTextAlignment;
  22. const
  23. NSLeftTextAlignment = 0;
  24. NSRightTextAlignment = 1;
  25. NSCenterTextAlignment = 2;
  26. NSJustifiedTextAlignment = 3;
  27. NSNaturalTextAlignment = 4;
  28. type
  29. NSWritingDirection = NSInteger;
  30. NSWritingDirectionPtr = ^NSWritingDirection;
  31. const
  32. NSWritingDirectionNatural = -1;
  33. NSWritingDirectionLeftToRight = 0;
  34. NSWritingDirectionRightToLeft = 1;
  35. const
  36. NSTextWritingDirectionEmbedding = 0 shl 1;
  37. NSTextWritingDirectionOverride = 1 shl 1;
  38. const
  39. NSIllegalTextMovement = 0;
  40. NSReturnTextMovement = $10;
  41. NSTabTextMovement = $11;
  42. NSBacktabTextMovement = $12;
  43. NSLeftTextMovement = $13;
  44. NSRightTextMovement = $14;
  45. NSUpTextMovement = $15;
  46. NSDownTextMovement = $16;
  47. NSCancelTextMovement = $17;
  48. NSOtherTextMovement = 0;
  49. {$endif}
  50. {$ifdef CLASSES}
  51. type
  52. NSText = objcclass external (NSView, NSChangeSpellingProtocol, NSIgnoreMisspelledWordsProtocol)
  53. private
  54. _ivars: id;
  55. public
  56. function initWithFrame (frameRect: NSRect): instancetype; message 'initWithFrame:'; { NS_DESIGNATED_INITIALIZER }
  57. function initWithCoder (coder: NSCoder): instancetype; message 'initWithCoder:'; { NS_DESIGNATED_INITIALIZER }
  58. procedure setString(newValue: NSString); message 'setString:';
  59. function string_: NSString; message 'string';
  60. procedure replaceCharactersInRange_withString (range: NSRange; aString: NSString); message 'replaceCharactersInRange:withString:';
  61. procedure replaceCharactersInRange_withRTF (range: NSRange; rtfData: NSData); message 'replaceCharactersInRange:withRTF:';
  62. procedure replaceCharactersInRange_withRTFD (range: NSRange; rtfdData: NSData); message 'replaceCharactersInRange:withRTFD:';
  63. function RTFFromRange (range: NSRange): NSData; message 'RTFFromRange:';
  64. function RTFDFromRange (range: NSRange): NSData; message 'RTFDFromRange:';
  65. function writeRTFDToFile_atomically (path: NSString; flag: ObjCBOOL): ObjCBOOL; message 'writeRTFDToFile:atomically:';
  66. function readRTFDFromFile (path: NSString): ObjCBOOL; message 'readRTFDFromFile:';
  67. procedure setDelegate(newValue: NSTextDelegateProtocol); message 'setDelegate:';
  68. function delegate: NSTextDelegateProtocol; message 'delegate';
  69. procedure setEditable(newValue: ObjCBOOL); message 'setEditable:';
  70. function isEditable: ObjCBOOL; message 'isEditable';
  71. procedure setSelectable(newValue: ObjCBOOL); message 'setSelectable:';
  72. function isSelectable: ObjCBOOL; message 'isSelectable';
  73. procedure setRichText(newValue: ObjCBOOL); message 'setRichText:';
  74. function isRichText: ObjCBOOL; message 'isRichText';
  75. procedure setImportsGraphics(newValue: ObjCBOOL); message 'setImportsGraphics:';
  76. function importsGraphics: ObjCBOOL; message 'importsGraphics';
  77. procedure setFieldEditor(newValue: ObjCBOOL); message 'setFieldEditor:';
  78. function isFieldEditor: ObjCBOOL; message 'isFieldEditor';
  79. procedure setUsesFontPanel(newValue: ObjCBOOL); message 'setUsesFontPanel:';
  80. function usesFontPanel: ObjCBOOL; message 'usesFontPanel';
  81. procedure setDrawsBackground(newValue: ObjCBOOL); message 'setDrawsBackground:';
  82. function drawsBackground: ObjCBOOL; message 'drawsBackground';
  83. procedure setBackgroundColor(newValue: NSColor); message 'setBackgroundColor:';
  84. function backgroundColor: NSColor; message 'backgroundColor';
  85. function isRulerVisible: ObjCBOOL; message 'isRulerVisible';
  86. procedure setSelectedRange(newValue: NSRange); message 'setSelectedRange:';
  87. function selectedRange: NSRange; message 'selectedRange';
  88. procedure scrollRangeToVisible (range: NSRange); message 'scrollRangeToVisible:';
  89. procedure setFont(newValue: NSFont); message 'setFont:';
  90. function font: NSFont; message 'font';
  91. procedure setTextColor(newValue: NSColor); message 'setTextColor:';
  92. function textColor: NSColor; message 'textColor';
  93. procedure setAlignment(newValue: NSTextAlignment); message 'setAlignment:';
  94. function alignment: NSTextAlignment; message 'alignment';
  95. procedure setBaseWritingDirection(newValue: NSWritingDirection); message 'setBaseWritingDirection:';
  96. function baseWritingDirection: NSWritingDirection; message 'baseWritingDirection';
  97. procedure setTextColor_range (color: NSColor; range: NSRange); message 'setTextColor:range:';
  98. procedure setFont_range (font_: NSFont; range: NSRange); message 'setFont:range:';
  99. procedure setMaxSize(newValue: NSSize); message 'setMaxSize:';
  100. function maxSize: NSSize; message 'maxSize';
  101. procedure setMinSize(newValue: NSSize); message 'setMinSize:';
  102. function minSize: NSSize; message 'minSize';
  103. procedure setHorizontallyResizable(newValue: ObjCBOOL); message 'setHorizontallyResizable:';
  104. function isHorizontallyResizable: ObjCBOOL; message 'isHorizontallyResizable';
  105. procedure setVerticallyResizable(newValue: ObjCBOOL); message 'setVerticallyResizable:';
  106. function isVerticallyResizable: ObjCBOOL; message 'isVerticallyResizable';
  107. procedure sizeToFit; message 'sizeToFit';
  108. procedure copy_ (sender: id); message 'copy:';
  109. procedure copyFont (sender: id); message 'copyFont:';
  110. procedure copyRuler (sender: id); message 'copyRuler:';
  111. procedure cut (sender: id); message 'cut:';
  112. procedure delete (sender: id); message 'delete:';
  113. procedure paste (sender: id); message 'paste:';
  114. procedure pasteFont (sender: id); message 'pasteFont:';
  115. procedure pasteRuler (sender: id); message 'pasteRuler:';
  116. procedure selectAll (sender: id); message 'selectAll:';
  117. procedure changeFont (sender: id); message 'changeFont:';
  118. procedure alignLeft (sender: id); message 'alignLeft:';
  119. procedure alignRight (sender: id); message 'alignRight:';
  120. procedure alignCenter (sender: id); message 'alignCenter:';
  121. procedure subscript (sender: id); message 'subscript:';
  122. procedure superscript (sender: id); message 'superscript:';
  123. procedure underline (sender: id); message 'underline:';
  124. procedure unscript (sender: id); message 'unscript:';
  125. procedure showGuessPanel (sender: id); message 'showGuessPanel:';
  126. procedure checkSpelling (sender: id); message 'checkSpelling:';
  127. procedure toggleRuler (sender: id); message 'toggleRuler:';
  128. { Adopted protocols }
  129. procedure changeSpelling (sender: id); message 'changeSpelling:';
  130. procedure ignoreSpelling (sender: id); message 'ignoreSpelling:';
  131. end;
  132. {$endif}
  133. {$ifdef PROTOCOLS}
  134. type
  135. NSTextDelegateProtocol = objcprotocol external name 'NSTextDelegate' (NSObjectProtocol)
  136. optional
  137. function textShouldBeginEditing (textObject: NSText): ObjCBOOL; message 'textShouldBeginEditing:';
  138. function textShouldEndEditing (textObject: NSText): ObjCBOOL; message 'textShouldEndEditing:';
  139. procedure textDidBeginEditing (notification: NSNotification); message 'textDidBeginEditing:';
  140. procedure textDidEndEditing (notification: NSNotification); message 'textDidEndEditing:';
  141. procedure textDidChange (notification: NSNotification); message 'textDidChange:';
  142. end;
  143. {$endif}
  144. {$ifdef EXTERNAL_SYMBOLS}
  145. var
  146. NSTextDidBeginEditingNotification: NSString; cvar; external;
  147. NSTextDidEndEditingNotification: NSString; cvar; external;
  148. NSTextDidChangeNotification: NSString; cvar; external;
  149. {$endif}