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