1{%mainunit appkit.pas}
2(*
3        NSTextView.h
4        Application Kit
5        Copyright (c) 1994-2005, Apple Computer, Inc.
6        All rights reserved.
7*)
8
9{$ifdef HEADER}
10{$ifndef NSTEXTVIEW_PAS_H}
11{$define NSTEXTVIEW_PAS_H}
12
13
14//#import <AppKit/NSText.h>
15//#import <AppKit/NSInputManager.h>
16//#import <AppKit/NSTextAttachment.h>
17//#import <AppKit/AppKitDefines.h>
18//#import <AppKit/NSDragging.h>
19//#import <AppKit/NSUserInterfaceValidation.h>
20type
21  NSSelectionGranularity = (
22    NSSelectByCharacter = 0,
23    NSSelectByWord = 1,
24    NSSelectByParagraph = 2
25  );
26
27
28type
29  NSSelectionAffinity = (
30    NSSelectionAffinityUpstream = 0,
31    NSSelectionAffinityDownstream = 1
32  );
33
34
35type
36  NSFindPanelAction = (
37    NSFindPanelActionShowFindPanel = 1,
38    NSFindPanelActionNext = 2,
39    NSFindPanelActionPrevious = 3,
40    NSFindPanelActionReplaceAll = 4,
41    NSFindPanelActionReplace = 5,
42    NSFindPanelActionReplaceAndFind = 6,
43    NSFindPanelActionSetFindString = 7,
44    NSFindPanelActionReplaceAllInSelection = 8,
45    NSFindPanelActionSelectAll = 9,
46    NSFindPanelActionSelectAllInSelection = 10
47  );
48
49
50//APPKIT_EXTERN NSString *NSTextViewWillChangeNotifyingTextViewNotification;
51//APPKIT_EXTERN NSString *NSTextViewDidChangeSelectionNotification;
52//APPKIT_EXTERN NSString *NSTextViewDidChangeTypingAttributesNotification	AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
53{$endif}
54{$endif}
55
56{$ifdef FORWARD}
57  NSTextView = class;
58
59{$endif}
60
61{$ifdef CLASSES}
62{$ifndef NSTEXTVIEW_PAS_C}
63{$define NSTEXTVIEW_PAS_C}
64
65
66  { NSTextView }
67
68  NSTextView = class(NSText)
69  public
70    class function getClass: lobjc.id; override;
71    // *************************** Initializing ***************************
72    constructor initWithFrame_textContainer(_frameRect: NSRect; _container: lobjc.id {NSTextContainer});
73    //  Designated Initializer. container may be nil.
74    constructor initWithFrame(_frameRect: NSRect);
75    //  This variant will create the text network (textStorage, layoutManager, and a container).
76    // **************** Get/Set the container and other stuff ****************
77    function textContainer: lobjc.id;{NSTextContainer}
78    procedure setTextContainer(_container: lobjc.id {NSTextContainer});
79    //  The set method should not be called directly, but you might want to override it.
80    //  Gets or sets the text container for this view.  Setting the text container marks
81    // the view as needing display.  The text container calls the set method from its setTextView:
82    // method.
83    procedure replaceTextContainer(_newContainer: lobjc.id {NSTextContainer});
84    //  This method should be used instead of the primitive -setTextContainer: if you need
85    // to replace a view's text container with a new one leaving the rest of the web intact.
86    //  This method deals with all the work of making sure the view doesn't get deallocated
87    // and removing the old container from the layoutManager and replacing it with the new
88    // one.
89    procedure setTextContainerInset(_inset: NSSize);
90    function textContainerInset: NSSize;
91    //  The textContainerInset determines the padding that the view provides around the
92    // container.  The container's origin will be inset by this amount from the bounds point
93    // {0,0} and padding will be left to the right and below the container of the same amount.
94    //  This inset affects the view sizing in response to new layout and is used by the
95    // rectangular text containers when they track the view's frame dimensions.
96    function textContainerOrigin: NSPoint;
97    procedure invalidateTextContainerOrigin;
98    //  The container's origin in the view is determined from the current usage of the container,
99    // the container inset, and the view size.  textContainerOrigin returns this point.
100    //  invalidateTextContainerOrigin is sent automatically whenever something changes that
101    // causes the origin to possibly move.  You usually do not need to call invalidate yourself.
102    function layoutManager: lobjc.id;{NSLayoutManager}
103    function textStorage: lobjc.id;{NSTextStorage}
104    //  Convenience methods
105    // ************************ Key binding entry-point ************************
106    procedure insertText(_insertString: lobjc.id);
107    //  This method is the funnel point for text insertion after keys pass through the key
108    // binder.
109    // ************************** Sizing methods **************************
110    procedure setConstrainedFrameSize(_desiredSize: NSSize);
111    //  Sets the frame size of the view to desiredSize constrained within min and max size.
112    // **************** New miscellaneous API above and beyond NSText ****************
113    procedure setAlignment_range(_alignment: NSTextAlignment; _range: NSRange);
114    procedure setBaseWritingDirection_range(_writingDirection: NSWritingDirection; _range: NSRange);
115    procedure turnOffKerning(_sender: lobjc.id);
116    procedure tightenKerning(_sender: lobjc.id);
117    procedure loosenKerning(_sender: lobjc.id);
118    procedure useStandardKerning(_sender: lobjc.id);
119    procedure turnOffLigatures(_sender: lobjc.id);
120    procedure useStandardLigatures(_sender: lobjc.id);
121    procedure useAllLigatures(_sender: lobjc.id);
122    procedure raiseBaseline(_sender: lobjc.id);
123    procedure lowerBaseline(_sender: lobjc.id);
124    procedure toggleTraditionalCharacterShape(_sender: lobjc.id);
125    procedure outline(_sender: lobjc.id);
126    {.$ifdef  MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3}
127    procedure performFindPanelAction(_sender: lobjc.id);
128    procedure alignJustified(_sender: lobjc.id);
129    procedure changeColor(_sender: lobjc.id);
130    procedure changeAttributes(_sender: lobjc.id);
131    procedure changeDocumentBackgroundColor(_sender: lobjc.id);
132    procedure toggleBaseWritingDirection(_sender: lobjc.id);
133    {.$ifdef  MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4}
134    procedure orderFrontSpacingPanel(_sender: lobjc.id);
135    procedure orderFrontLinkPanel(_sender: lobjc.id);
136    procedure orderFrontListPanel(_sender: lobjc.id);
137    procedure orderFrontTablePanel(_sender: lobjc.id);
138    procedure rulerView_didMoveMarker(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker});
139    procedure rulerView_didRemoveMarker(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker});
140    procedure rulerView_didAddMarker(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker});
141    function rulerView_shouldMoveMarker(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}): LongBool;
142    function rulerView_shouldAddMarker(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}): LongBool;
143    function rulerView_willMoveMarker_toLocation(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}; _location: Single): Single;
144    function rulerView_shouldRemoveMarker(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}): LongBool;
145    function rulerView_willAddMarker_atLocation(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}; _location: Single): Single;
146    procedure rulerView_handleMouseDown(_ruler: lobjc.id {NSRulerView}; _event: lobjc.id {NSEvent});
147    // ************************** Fine display control **************************
148    procedure setNeedsDisplayInRect_avoidAdditionalLayout(_rect: NSRect; _flag: LongBool);
149    function shouldDrawInsertionPoint: LongBool;
150    procedure drawInsertionPointInRect_color_turnedOn(_rect: NSRect; _color: lobjc.id {NSColor}; _flag: LongBool);
151    procedure drawViewBackgroundInRect(_rect: NSRect);
152    procedure updateRuler;
153    procedure updateFontPanel;
154    procedure updateDragTypeRegistration;
155    function selectionRangeForProposedRange_granularity(_proposedCharRange: NSRange; _granularity: NSSelectionGranularity): NSRange;
156    // ************************** Especially for subclassers **************************
157    procedure clickedOnLink_atIndex(_link: lobjc.id; _charIndex: LongWord);
158    //  Cause the text view to act as if someone clicked on a piece of text with link as
159    // the value of NSLinkAttributeName.  If, for instance, you have a special attachment
160    // cell that can end up following links, you can use this method to ask the text view
161    // to follow a link once you decide it should.  This method is invoked by the text view
162    // during mouse tracking if the user is clicking a link as well.  This sends the textView:clickedOnLink:
163    // delegation if the delegate responds.
164    // ************************ Speech support ************************
165    procedure startSpeaking(_sender: lobjc.id);
166    procedure stopSpeaking(_sender: lobjc.id);
167    // ************************ Completion support ********************
168    procedure complete(_sender: lobjc.id);
169    //  Responder method for invoking completion.  May be invoked programmatically if autocompletion
170    // is desired.
171    function rangeForUserCompletion: NSRange;
172    //  Usually returns the partial range from the most recent beginning of a word up to
173    // the insertion point.  May be overridden by subclassers to alter the range to be completed.
174    //  Returning (NSNotFound, 0) suppresses completion.
175    function completionsForPartialWordRange_indexOfSelectedItem(_charRange: NSRange; __index: Integer): CFArrayRef;
176    //  Returns an array of potential completions, in the order to be presented, representing
177    // complete words that the user might be trying to type when starting by typing the
178    // partial word at the given range.  May be overridden by subclassers to modify or override
179    // this list.  Returning nil or a zero-length array suppresses completion.   The selected
180    // item index may optionally be set to indicate which completion should be initially
181    // selected; default is 0, and -1 indicates no selection.  This method should call the
182    // delegate method textView:completions:forPartialWordRange:indexOfSelectedItem: if
183    // implemented.
184    procedure insertCompletion_forPartialWordRange_movement_isFinal(_word: CFStringRef; _charRange: NSRange; _movement: Integer; _flag: LongBool);
185    //  Called with final == NO as the user moves through the potential completions, then
186    // with final == YES when a completion is definitively selected (or completion is cancelled
187    // and the original value is reinserted).  The default implementation inserts the completion
188    // into the text at the appropriate location.  The movement argument takes its values
189    // from the movement codes defined in NSText.h, and allows subclassers to distinguish
190    // between cancelling completion and selection by arrow keys, by return, by tab, or
191    // by other means such as clicking.
192    // ****************** Pasteboard support (mainly for subclassers) ******************
193    //  To implement support for writing a new type, override -writeSelectionToPasteboard:type:
194    // to support your new type (and call super if you're not going to handle it.)  Then
195    // you can override -writablePasteboardTypes and optionally the +registerForServices
196    // methods to enable the new type.
197    //  To implement support for reading a new type, override -readSelectionFromPasteboard:type:
198    // to support your new type (and call super if you're not going to handle it.)  Then
199    // you can override -readablePasteboardTypes and optionally the +registerForServices
200    // and acceptableDragTypes methods to enable the new type.  Advanced drag acceptance
201    // behavior can be implemented with dragOperationForDraggingInfo:type: and cleanUpAfterDragOperation.
202    //  To implement new mechanisms that cause data to be written to the pasteboard you
203    // can call writablePasteboardTypes and writeSelectionToPasteboard:types:.
204    //  To implement new mechanisms that cause data to be read from the pasteboard you can
205    // call preferredPasteboardTypeFromArray:restrictedToTypesFromArray: and readSelectionFromPasteboard:type:.
206    function writablePasteboardTypes: CFArrayRef;
207    //  Returns an array of pasteboard types that can be provided from the current selection.
208    //  Overriders should copy the result from super and add their own new types.
209    function writeSelectionToPasteboard_type(_pboard: lobjc.id {NSPasteboard}; __type: CFStringRef): LongBool;
210    //  Invoked automatically to write a single type to the pasteboard.  The type will already
211    // have been declared to the pasteboard so this should merely write the data using the
212    // appropriate set method on the pasteboard.
213    function writeSelectionToPasteboard_types(_pboard: lobjc.id {NSPasteboard}; _types: CFArrayRef): LongBool;
214    //  Delclares all the types to the pasteboard then calls writeSelectionToPasteboard:type:
215    // for each type in the array.
216    function readablePasteboardTypes: CFArrayRef;
217    //  Returns an array of types that could be read currently in order of preference.
218    // Subclassers should take care to consider the "preferred" part of the semantics of
219    // this method.  Figure out where your new type should fit into the preferred order.
220    //  The preferred order should usually be from the richest types down to the less rich.
221    //  The default array will start with RTFD, RTF, strings, files, images, colors and
222    // so on.  The ordering list really starts to lose significance after the first few
223    // elements.  If the new format you are supporting is richer than RTFD, put it at the
224    // head of the list, otherwise try to find the right place for it, but don't count on
225    // the actual contents of the list you get from super either.
226    function preferredPasteboardTypeFromArray_restrictedToTypesFromArray(_availableTypes: CFArrayRef; _allowedTypes: CFArrayRef): CFStringRef;
227    //  Returns the most preferred type from the available types array that it is currently
228    // possible to read.  If allowedTypes is provided then only those types will be considered
229    // regardless of whether others could currently be read.  You should not have to override
230    // this to support new types.
231    function readSelectionFromPasteboard_type(_pboard: lobjc.id {NSPasteboard}; __type: CFStringRef): LongBool;
232    //  Invoked automatically to read a specific type from the pasteboard.  The type will
233    // already have been by the preferredPasteboardTypeFromArray:restrictedToTypesFromArray:
234    // method so this should merely read the data using the appropriate accessor method
235    // on the pasteboard.
236    function readSelectionFromPasteboard(_pboard: lobjc.id {NSPasteboard}): LongBool;
237    //  Part of the services mechanism.  This is implemented such that you should not need
238    // to override it to support new types.  It should not be necessary to call this.
239    class procedure registerForServices;
240    //  Automatically invoked when the first instance of NSTextView is created.  Subclassing
241    // this is necessary to add support for new service types (in addition to actually supporting
242    // writing or reading the types, of course).  Override it to call super and then register
243    // your own new types.  You should probably never need to call this except to message
244    // super in an override.
245    function validRequestorForSendType_returnType(_sendType: CFStringRef; _returnType: CFStringRef): lobjc.id;
246    //  This method is part of the services protocol and is implemented in such a way that
247    // if you extend the type support correctly you should not need to override it.  You
248    // should never need to call it either.
249    procedure pasteAsPlainText(_sender: lobjc.id);
250    procedure pasteAsRichText(_sender: lobjc.id);
251    //  These methods are like paste: (from NSResponder) but they restrict the acceptable
252    // type of the pasted data.  They are suitable as menu actions for appropriate "Paste
253    // As" submenu commands.
254    function dragSelectionWithEvent_offset_slideBack(_event: lobjc.id {NSEvent}; _mouseOffset: NSSize; _slideBack: LongBool): LongBool;
255    //  Causes textview to begin dragging current selected range, returning YES if it succeeds
256    // in initiating the drag.  Primarily for subclassers, who can override it to intervene
257    // at beginning of a drag.
258    function dragImageForSelectionWithEvent_origin(_event: lobjc.id {NSEvent}; _origin: NSPointPointer): lobjc.id;{NSImage}
259    //  Used by dragSelectionWithEvent:offset:slideBack: to get an appropriate image.  Returns
260    // the lower-left point of the image in view coordinates as origin.  Can be called by
261    // others who need such an image, or can be overridden by subclassers to return a different
262    // image (if it returns nil, a default icon will be used).
263    function acceptableDragTypes: CFArrayRef;
264    //  Must be overridden to support new drag types in addition to adding support for reading
265    // and writing the type.  Override it to call super, then make a copy of the result
266    // and add your own new types before returning the copy.  You should probably never
267    // need to call this except to message super in an override.
268    function dragOperationForDraggingInfo_type(_dragInfo: lobjc.id; __type: CFStringRef): LongWord;
269    //  This is called by draggingEntered:... and draggingUpdated:...  It should return
270    // the drag operation constant appropriate to the current situation or NSDragOperationNone.
271    //  It can also do any other auxilliary stuff like drawing a ghost to indicate where
272    // the dragged thing will go when it is dropped.  Be aware that this is called over
273    // and over so if you're going to draw a ghost or something avoid doing it over and
274    // over unless you need to.  Any state you set up in this method that needs to be cleared
275    // can be cleared by overriding the next method.  You should probably never need to
276    // call this except to message super in an override.
277    procedure cleanUpAfterDragOperation;
278    function acceptsGlyphInfo: LongBool;
279    procedure setAcceptsGlyphInfo(_flag: LongBool);
280    function selectedRanges: CFArrayRef;
281    procedure setSelectedRanges_affinity_stillSelecting(_ranges: CFArrayRef; _affinity: NSSelectionAffinity; _stillSelectingFlag: LongBool);
282    procedure setSelectedRanges(_ranges: CFArrayRef);
283    procedure setSelectedRange_affinity_stillSelecting(_charRange: NSRange; _affinity: NSSelectionAffinity; _stillSelectingFlag: LongBool);
284    function selectionAffinity: NSSelectionAffinity;
285    function selectionGranularity: NSSelectionGranularity;
286    procedure setSelectionGranularity(_granularity: NSSelectionGranularity);
287    procedure setSelectedTextAttributes(_attributeDictionary: CFDictionaryRef);
288    function selectedTextAttributes: CFDictionaryRef;
289    procedure setInsertionPointColor(_color: lobjc.id {NSColor});
290    function insertionPointColor: lobjc.id;{NSColor}
291    procedure updateInsertionPointStateAndRestartTimer(_restartFlag: LongBool);
292    procedure setMarkedTextAttributes(_attributeDictionary: CFDictionaryRef);
293    function markedTextAttributes: CFDictionaryRef;
294    procedure setLinkTextAttributes(_attributeDictionary: CFDictionaryRef);
295    function linkTextAttributes: CFDictionaryRef;
296    procedure setRulerVisible(_flag: LongBool);
297    function usesRuler: LongBool;
298    procedure setUsesRuler(_flag: LongBool);
299    procedure setContinuousSpellCheckingEnabled(_flag: LongBool);
300    function isContinuousSpellCheckingEnabled: LongBool;
301    procedure toggleContinuousSpellChecking(_sender: lobjc.id);
302    function spellCheckerDocumentTag: Integer;
303    function typingAttributes: CFDictionaryRef;
304    procedure setTypingAttributes(_attrs: CFDictionaryRef);
305    function shouldChangeTextInRanges_replacementStrings(_affectedRanges: CFArrayRef; _replacementStrings: CFArrayRef): LongBool;
306    function rangesForUserTextChange: CFArrayRef;
307    function rangesForUserCharacterAttributeChange: CFArrayRef;
308    function rangesForUserParagraphAttributeChange: CFArrayRef;
309    function shouldChangeTextInRange_replacementString(_affectedCharRange: NSRange; _replacementString: CFStringRef): LongBool;
310    procedure didChangeText;
311    function rangeForUserTextChange: NSRange;
312    function rangeForUserCharacterAttributeChange: NSRange;
313    function rangeForUserParagraphAttributeChange: NSRange;
314    procedure setUsesFindPanel(_flag: LongBool);
315    function usesFindPanel: LongBool;
316    procedure setAllowsDocumentBackgroundColorChange(_flag: LongBool);
317    function allowsDocumentBackgroundColorChange: LongBool;
318    procedure setDefaultParagraphStyle(_paragraphStyle: lobjc.id {NSParagraphStyle});
319    function defaultParagraphStyle: lobjc.id;{NSParagraphStyle}
320    {.$ifdef  MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4}
321    procedure breakUndoCoalescing;
322    function isSelectable: LongBool;
323    procedure setSelectable(_flag: LongBool);
324    function isEditable: LongBool;
325    procedure setEditable(_flag: LongBool);
326    function isRichText: LongBool;
327    procedure setRichText(_flag: LongBool);
328    function importsGraphics: LongBool;
329    procedure setImportsGraphics(_flag: LongBool);
330    function delegate: lobjc.id;
331    procedure setDelegate(_anObject: lobjc.id);
332    function isFieldEditor: LongBool;
333    procedure setFieldEditor(_flag: LongBool);
334    function usesFontPanel: LongBool;
335    procedure setUsesFontPanel(_flag: LongBool);
336    function isRulerVisible: LongBool;
337    procedure setBackgroundColor(_color: lobjc.id {NSColor});
338    function backgroundColor: lobjc.id;{NSColor}
339    procedure setDrawsBackground(_flag: LongBool);
340    function drawsBackground: LongBool;
341    procedure setSelectedRange(_charRange: NSRange);
342    function allowsUndo: LongBool;
343    procedure setAllowsUndo(_flag: LongBool);
344    // ************************** NSResponder methods **************************
345    function resignFirstResponder: LongBool;
346    function becomeFirstResponder: LongBool;
347    // ************************** Smart copy/paste/delete support **************************
348    function smartInsertDeleteEnabled: LongBool;
349    procedure setSmartInsertDeleteEnabled(_flag: LongBool);
350    function smartDeleteRangeForProposedRange(_proposedCharRange: NSRange): NSRange;
351    procedure smartInsertForString_replacingRange_beforeString_afterString(_pasteString: CFStringRef; _charRangeToReplace: NSRange; _beforeString: CFStringRef; _afterString: CFStringRef);
352    function smartInsertBeforeStringForString_replacingRange(_pasteString: CFStringRef; _charRangeToReplace: NSRange): CFStringRef;
353    function smartInsertAfterStringForString_replacingRange(_pasteString: CFStringRef; _charRangeToReplace: NSRange): CFStringRef;
354  end;
355
356{$endif}
357{$endif}
358
359{$ifdef IMPLEMENTATION}
360const
361  StrNSTextView_NSTextView = 'NSTextView';
362  StrNSTextView_initWithFrame_textContainer = 'initWithFrame:textContainer:';
363  StrNSTextView_initWithFrame = 'initWithFrame:';
364  StrNSTextView_textContainer = 'textContainer';
365  StrNSTextView_setTextContainer = 'setTextContainer:';
366  StrNSTextView_replaceTextContainer = 'replaceTextContainer:';
367  StrNSTextView_setTextContainerInset = 'setTextContainerInset:';
368  StrNSTextView_textContainerInset = 'textContainerInset';
369  StrNSTextView_textContainerOrigin = 'textContainerOrigin';
370  StrNSTextView_invalidateTextContainerOrigin = 'invalidateTextContainerOrigin';
371  StrNSTextView_layoutManager = 'layoutManager';
372  StrNSTextView_textStorage = 'textStorage';
373  StrNSTextView_insertText = 'insertText:';
374  StrNSTextView_setConstrainedFrameSize = 'setConstrainedFrameSize:';
375  StrNSTextView_setAlignment_range = 'setAlignment:range:';
376  StrNSTextView_setBaseWritingDirection_range = 'setBaseWritingDirection:range:';
377  StrNSTextView_turnOffKerning = 'turnOffKerning:';
378  StrNSTextView_tightenKerning = 'tightenKerning:';
379  StrNSTextView_loosenKerning = 'loosenKerning:';
380  StrNSTextView_useStandardKerning = 'useStandardKerning:';
381  StrNSTextView_turnOffLigatures = 'turnOffLigatures:';
382  StrNSTextView_useStandardLigatures = 'useStandardLigatures:';
383  StrNSTextView_useAllLigatures = 'useAllLigatures:';
384  StrNSTextView_raiseBaseline = 'raiseBaseline:';
385  StrNSTextView_lowerBaseline = 'lowerBaseline:';
386  StrNSTextView_toggleTraditionalCharacterShape = 'toggleTraditionalCharacterShape:';
387  StrNSTextView_outline = 'outline:';
388  StrNSTextView_performFindPanelAction = 'performFindPanelAction:';
389  StrNSTextView_alignJustified = 'alignJustified:';
390  StrNSTextView_changeColor = 'changeColor:';
391  StrNSTextView_changeAttributes = 'changeAttributes:';
392  StrNSTextView_changeDocumentBackgroundColor = 'changeDocumentBackgroundColor:';
393  StrNSTextView_toggleBaseWritingDirection = 'toggleBaseWritingDirection:';
394  StrNSTextView_orderFrontSpacingPanel = 'orderFrontSpacingPanel:';
395  StrNSTextView_orderFrontLinkPanel = 'orderFrontLinkPanel:';
396  StrNSTextView_orderFrontListPanel = 'orderFrontListPanel:';
397  StrNSTextView_orderFrontTablePanel = 'orderFrontTablePanel:';
398  StrNSTextView_rulerView_didMoveMarker = 'rulerView:didMoveMarker:';
399  StrNSTextView_rulerView_didRemoveMarker = 'rulerView:didRemoveMarker:';
400  StrNSTextView_rulerView_didAddMarker = 'rulerView:didAddMarker:';
401  StrNSTextView_rulerView_shouldMoveMarker = 'rulerView:shouldMoveMarker:';
402  StrNSTextView_rulerView_shouldAddMarker = 'rulerView:shouldAddMarker:';
403  StrNSTextView_rulerView_willMoveMarker_toLocation = 'rulerView:willMoveMarker:toLocation:';
404  StrNSTextView_rulerView_shouldRemoveMarker = 'rulerView:shouldRemoveMarker:';
405  StrNSTextView_rulerView_willAddMarker_atLocation = 'rulerView:willAddMarker:atLocation:';
406  StrNSTextView_rulerView_handleMouseDown = 'rulerView:handleMouseDown:';
407  StrNSTextView_setNeedsDisplayInRect_avoidAdditionalLayout = 'setNeedsDisplayInRect:avoidAdditionalLayout:';
408  StrNSTextView_shouldDrawInsertionPoint = 'shouldDrawInsertionPoint';
409  StrNSTextView_drawInsertionPointInRect_color_turnedOn = 'drawInsertionPointInRect:color:turnedOn:';
410  StrNSTextView_drawViewBackgroundInRect = 'drawViewBackgroundInRect:';
411  StrNSTextView_updateRuler = 'updateRuler';
412  StrNSTextView_updateFontPanel = 'updateFontPanel';
413  StrNSTextView_updateDragTypeRegistration = 'updateDragTypeRegistration';
414  StrNSTextView_selectionRangeForProposedRange_granularity = 'selectionRangeForProposedRange:granularity:';
415  StrNSTextView_clickedOnLink_atIndex = 'clickedOnLink:atIndex:';
416  StrNSTextView_startSpeaking = 'startSpeaking:';
417  StrNSTextView_stopSpeaking = 'stopSpeaking:';
418
419  StrNSTextView_complete = 'complete:';
420  StrNSTextView_rangeForUserCompletion = 'rangeForUserCompletion';
421  StrNSTextView_completionsForPartialWordRange_indexOfSelectedItem = 'completionsForPartialWordRange:indexOfSelectedItem:';
422  StrNSTextView_insertCompletion_forPartialWordRange_movement_isFinal = 'insertCompletion:forPartialWordRange:movement:isFinal:';
423
424  StrNSTextView_writablePasteboardTypes = 'writablePasteboardTypes';
425  StrNSTextView_writeSelectionToPasteboard_type = 'writeSelectionToPasteboard:type:';
426  StrNSTextView_writeSelectionToPasteboard_types = 'writeSelectionToPasteboard:types:';
427  StrNSTextView_readablePasteboardTypes = 'readablePasteboardTypes';
428  StrNSTextView_preferredPasteboardTypeFromArray_restrictedToTypesFromArray = 'preferredPasteboardTypeFromArray:restrictedToTypesFromArray:';
429  StrNSTextView_readSelectionFromPasteboard_type = 'readSelectionFromPasteboard:type:';
430  StrNSTextView_readSelectionFromPasteboard = 'readSelectionFromPasteboard:';
431  StrNSTextView_registerForServices = 'registerForServices';
432  StrNSTextView_validRequestorForSendType_returnType = 'validRequestorForSendType:returnType:';
433  StrNSTextView_pasteAsPlainText = 'pasteAsPlainText:';
434  StrNSTextView_pasteAsRichText = 'pasteAsRichText:';
435
436  StrNSTextView_dragSelectionWithEvent_offset_slideBack = 'dragSelectionWithEvent:offset:slideBack:';
437  StrNSTextView_dragImageForSelectionWithEvent_origin = 'dragImageForSelectionWithEvent:origin:';
438  StrNSTextView_acceptableDragTypes = 'acceptableDragTypes';
439  StrNSTextView_dragOperationForDraggingInfo_type = 'dragOperationForDraggingInfo:type:';
440  StrNSTextView_cleanUpAfterDragOperation = 'cleanUpAfterDragOperation';
441  StrNSTextView_acceptsGlyphInfo = 'acceptsGlyphInfo';
442  StrNSTextView_setAcceptsGlyphInfo = 'setAcceptsGlyphInfo:';
443
444  StrNSTextView_selectedRanges = 'selectedRanges';
445  StrNSTextView_setSelectedRanges_affinity_stillSelecting = 'setSelectedRanges:affinity:stillSelecting:';
446  StrNSTextView_setSelectedRanges = 'setSelectedRanges:';
447  StrNSTextView_setSelectedRange_affinity_stillSelecting = 'setSelectedRange:affinity:stillSelecting:';
448  StrNSTextView_selectionAffinity = 'selectionAffinity';
449  StrNSTextView_selectionGranularity = 'selectionGranularity';
450  StrNSTextView_setSelectionGranularity = 'setSelectionGranularity:';
451  StrNSTextView_setSelectedTextAttributes = 'setSelectedTextAttributes:';
452  StrNSTextView_selectedTextAttributes = 'selectedTextAttributes';
453  StrNSTextView_setInsertionPointColor = 'setInsertionPointColor:';
454  StrNSTextView_insertionPointColor = 'insertionPointColor';
455  StrNSTextView_updateInsertionPointStateAndRestartTimer = 'updateInsertionPointStateAndRestartTimer:';
456  StrNSTextView_setMarkedTextAttributes = 'setMarkedTextAttributes:';
457  StrNSTextView_markedTextAttributes = 'markedTextAttributes';
458  StrNSTextView_setLinkTextAttributes = 'setLinkTextAttributes:';
459  StrNSTextView_linkTextAttributes = 'linkTextAttributes';
460  StrNSTextView_setRulerVisible = 'setRulerVisible:';
461  StrNSTextView_usesRuler = 'usesRuler';
462  StrNSTextView_setUsesRuler = 'setUsesRuler:';
463  StrNSTextView_setContinuousSpellCheckingEnabled = 'setContinuousSpellCheckingEnabled:';
464  StrNSTextView_isContinuousSpellCheckingEnabled = 'isContinuousSpellCheckingEnabled';
465  StrNSTextView_toggleContinuousSpellChecking = 'toggleContinuousSpellChecking:';
466  StrNSTextView_spellCheckerDocumentTag = 'spellCheckerDocumentTag';
467  StrNSTextView_typingAttributes = 'typingAttributes';
468  StrNSTextView_setTypingAttributes = 'setTypingAttributes:';
469  StrNSTextView_shouldChangeTextInRanges_replacementStrings = 'shouldChangeTextInRanges:replacementStrings:';
470  StrNSTextView_rangesForUserTextChange = 'rangesForUserTextChange';
471  StrNSTextView_rangesForUserCharacterAttributeChange = 'rangesForUserCharacterAttributeChange';
472  StrNSTextView_rangesForUserParagraphAttributeChange = 'rangesForUserParagraphAttributeChange';
473  StrNSTextView_shouldChangeTextInRange_replacementString = 'shouldChangeTextInRange:replacementString:';
474  StrNSTextView_didChangeText = 'didChangeText';
475  StrNSTextView_rangeForUserTextChange = 'rangeForUserTextChange';
476  StrNSTextView_rangeForUserCharacterAttributeChange = 'rangeForUserCharacterAttributeChange';
477  StrNSTextView_rangeForUserParagraphAttributeChange = 'rangeForUserParagraphAttributeChange';
478  StrNSTextView_setUsesFindPanel = 'setUsesFindPanel:';
479  StrNSTextView_usesFindPanel = 'usesFindPanel';
480  StrNSTextView_setAllowsDocumentBackgroundColorChange = 'setAllowsDocumentBackgroundColorChange:';
481  StrNSTextView_allowsDocumentBackgroundColorChange = 'allowsDocumentBackgroundColorChange';
482  StrNSTextView_setDefaultParagraphStyle = 'setDefaultParagraphStyle:';
483  StrNSTextView_defaultParagraphStyle = 'defaultParagraphStyle';
484  StrNSTextView_breakUndoCoalescing = 'breakUndoCoalescing';
485  StrNSTextView_isSelectable = 'isSelectable';
486  StrNSTextView_setSelectable = 'setSelectable:';
487  StrNSTextView_isEditable = 'isEditable';
488  StrNSTextView_setEditable = 'setEditable:';
489  StrNSTextView_isRichText = 'isRichText';
490  StrNSTextView_setRichText = 'setRichText:';
491  StrNSTextView_importsGraphics = 'importsGraphics';
492  StrNSTextView_setImportsGraphics = 'setImportsGraphics:';
493  StrNSTextView_delegate = 'delegate';
494  StrNSTextView_setDelegate = 'setDelegate:';
495  StrNSTextView_isFieldEditor = 'isFieldEditor';
496  StrNSTextView_setFieldEditor = 'setFieldEditor:';
497  StrNSTextView_usesFontPanel = 'usesFontPanel';
498  StrNSTextView_setUsesFontPanel = 'setUsesFontPanel:';
499  StrNSTextView_isRulerVisible = 'isRulerVisible';
500  StrNSTextView_setBackgroundColor = 'setBackgroundColor:';
501  StrNSTextView_backgroundColor = 'backgroundColor';
502  StrNSTextView_setDrawsBackground = 'setDrawsBackground:';
503  StrNSTextView_drawsBackground = 'drawsBackground';
504  StrNSTextView_setSelectedRange = 'setSelectedRange:';
505  StrNSTextView_allowsUndo = 'allowsUndo';
506  StrNSTextView_setAllowsUndo = 'setAllowsUndo:';
507  StrNSTextView_resignFirstResponder = 'resignFirstResponder';
508  StrNSTextView_becomeFirstResponder = 'becomeFirstResponder';
509  StrNSTextView_smartInsertDeleteEnabled = 'smartInsertDeleteEnabled';
510  StrNSTextView_setSmartInsertDeleteEnabled = 'setSmartInsertDeleteEnabled:';
511  StrNSTextView_smartDeleteRangeForProposedRange = 'smartDeleteRangeForProposedRange:';
512  StrNSTextView_smartInsertForString_replacingRange_beforeString_afterString = 'smartInsertForString:replacingRange:beforeString:afterString:';
513  StrNSTextView_smartInsertBeforeStringForString_replacingRange = 'smartInsertBeforeStringForString:replacingRange:';
514  StrNSTextView_smartInsertAfterStringForString_replacingRange = 'smartInsertAfterStringForString:replacingRange:';
515
516{ NSTextView }
517
518class function NSTextView.getClass: lobjc.id;
519begin
520  Result := objc_getClass(StrNSTextView_NSTextView);
521end;
522
523constructor NSTextView.initWithFrame_textContainer(_frameRect: NSRect; _container: lobjc.id {NSTextContainer});
524type
525  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_frameRect: NSRect; _container: lobjc.id {NSTextContainer}): lobjc.id; cdecl;
526var
527  vmethod: TmsgSendWrapper;
528begin
529  ClassID := getClass();
530  allocbuf := objc_msgSend(ClassID, sel_registerName(PChar(Str_alloc)), []);
531  vmethod := TmsgSendWrapper(@objc_msgSend);
532  Handle := vmethod(allocbuf, sel_registerName(PChar(StrNSTextView_initWithFrame_textContainer)), _frameRect, _container);
533end;
534
535constructor NSTextView.initWithFrame(_frameRect: NSRect);
536type
537  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_frameRect: NSRect): lobjc.id; cdecl;
538var
539  vmethod: TmsgSendWrapper;
540begin
541  ClassID := getClass();
542  allocbuf := objc_msgSend(ClassID, sel_registerName(PChar(Str_alloc)), []);
543  vmethod := TmsgSendWrapper(@objc_msgSend);
544  Handle := vmethod(allocbuf, sel_registerName(PChar(StrNSTextView_initWithFrame)), _frameRect);
545end;
546
547function NSTextView.textContainer: lobjc.id;
548begin
549  Result := lobjc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_textContainer)), []));
550end;
551
552procedure NSTextView.setTextContainer(_container: lobjc.id {NSTextContainer});
553type
554  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_container: lobjc.id {NSTextContainer}); cdecl;
555var
556  vmethod: TmsgSendWrapper;
557begin
558  vmethod := TmsgSendWrapper(@objc_msgSend);
559  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setTextContainer)), _container);
560end;
561
562procedure NSTextView.replaceTextContainer(_newContainer: lobjc.id {NSTextContainer});
563type
564  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_newContainer: lobjc.id {NSTextContainer}); cdecl;
565var
566  vmethod: TmsgSendWrapper;
567begin
568  vmethod := TmsgSendWrapper(@objc_msgSend);
569  vmethod(Handle, sel_registerName(PChar(StrNSTextView_replaceTextContainer)), _newContainer);
570end;
571
572procedure NSTextView.setTextContainerInset(_inset: NSSize);
573type
574  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_inset: NSSize); cdecl;
575var
576  vmethod: TmsgSendWrapper;
577begin
578  vmethod := TmsgSendWrapper(@objc_msgSend);
579  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setTextContainerInset)), _inset);
580end;
581
582function NSTextView.textContainerInset: NSSize;
583begin
584  objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSTextView_textContainerInset)), []);
585end;
586
587function NSTextView.textContainerOrigin: NSPoint;
588begin
589  objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSTextView_textContainerOrigin)), []);
590end;
591
592procedure NSTextView.invalidateTextContainerOrigin;
593begin
594  objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_invalidateTextContainerOrigin)), []);
595end;
596
597function NSTextView.layoutManager: lobjc.id;
598begin
599  Result := lobjc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_layoutManager)), []));
600end;
601
602function NSTextView.textStorage: lobjc.id;
603begin
604  Result := lobjc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_textStorage)), []));
605end;
606
607procedure NSTextView.insertText(_insertString: lobjc.id);
608type
609  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_insertString: lobjc.id); cdecl;
610var
611  vmethod: TmsgSendWrapper;
612begin
613  vmethod := TmsgSendWrapper(@objc_msgSend);
614  vmethod(Handle, sel_registerName(PChar(StrNSTextView_insertText)), _insertString);
615end;
616
617procedure NSTextView.setConstrainedFrameSize(_desiredSize: NSSize);
618type
619  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_desiredSize: NSSize); cdecl;
620var
621  vmethod: TmsgSendWrapper;
622begin
623  vmethod := TmsgSendWrapper(@objc_msgSend);
624  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setConstrainedFrameSize)), _desiredSize);
625end;
626
627procedure NSTextView.setAlignment_range(_alignment: NSTextAlignment; _range: NSRange);
628type
629  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_alignment: NSTextAlignment; _range: NSRange); cdecl;
630var
631  vmethod: TmsgSendWrapper;
632begin
633  vmethod := TmsgSendWrapper(@objc_msgSend);
634  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setAlignment_range)), _alignment, _range);
635end;
636
637procedure NSTextView.setBaseWritingDirection_range(_writingDirection: NSWritingDirection; _range: NSRange);
638type
639  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_writingDirection: NSWritingDirection; _range: NSRange); cdecl;
640var
641  vmethod: TmsgSendWrapper;
642begin
643  vmethod := TmsgSendWrapper(@objc_msgSend);
644  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setBaseWritingDirection_range)), _writingDirection, _range);
645end;
646
647procedure NSTextView.turnOffKerning(_sender: lobjc.id);
648type
649  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
650var
651  vmethod: TmsgSendWrapper;
652begin
653  vmethod := TmsgSendWrapper(@objc_msgSend);
654  vmethod(Handle, sel_registerName(PChar(StrNSTextView_turnOffKerning)), _sender);
655end;
656
657procedure NSTextView.tightenKerning(_sender: lobjc.id);
658type
659  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
660var
661  vmethod: TmsgSendWrapper;
662begin
663  vmethod := TmsgSendWrapper(@objc_msgSend);
664  vmethod(Handle, sel_registerName(PChar(StrNSTextView_tightenKerning)), _sender);
665end;
666
667procedure NSTextView.loosenKerning(_sender: lobjc.id);
668type
669  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
670var
671  vmethod: TmsgSendWrapper;
672begin
673  vmethod := TmsgSendWrapper(@objc_msgSend);
674  vmethod(Handle, sel_registerName(PChar(StrNSTextView_loosenKerning)), _sender);
675end;
676
677procedure NSTextView.useStandardKerning(_sender: lobjc.id);
678type
679  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
680var
681  vmethod: TmsgSendWrapper;
682begin
683  vmethod := TmsgSendWrapper(@objc_msgSend);
684  vmethod(Handle, sel_registerName(PChar(StrNSTextView_useStandardKerning)), _sender);
685end;
686
687procedure NSTextView.turnOffLigatures(_sender: lobjc.id);
688type
689  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
690var
691  vmethod: TmsgSendWrapper;
692begin
693  vmethod := TmsgSendWrapper(@objc_msgSend);
694  vmethod(Handle, sel_registerName(PChar(StrNSTextView_turnOffLigatures)), _sender);
695end;
696
697procedure NSTextView.useStandardLigatures(_sender: lobjc.id);
698type
699  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
700var
701  vmethod: TmsgSendWrapper;
702begin
703  vmethod := TmsgSendWrapper(@objc_msgSend);
704  vmethod(Handle, sel_registerName(PChar(StrNSTextView_useStandardLigatures)), _sender);
705end;
706
707procedure NSTextView.useAllLigatures(_sender: lobjc.id);
708type
709  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
710var
711  vmethod: TmsgSendWrapper;
712begin
713  vmethod := TmsgSendWrapper(@objc_msgSend);
714  vmethod(Handle, sel_registerName(PChar(StrNSTextView_useAllLigatures)), _sender);
715end;
716
717procedure NSTextView.raiseBaseline(_sender: lobjc.id);
718type
719  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
720var
721  vmethod: TmsgSendWrapper;
722begin
723  vmethod := TmsgSendWrapper(@objc_msgSend);
724  vmethod(Handle, sel_registerName(PChar(StrNSTextView_raiseBaseline)), _sender);
725end;
726
727procedure NSTextView.lowerBaseline(_sender: lobjc.id);
728type
729  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
730var
731  vmethod: TmsgSendWrapper;
732begin
733  vmethod := TmsgSendWrapper(@objc_msgSend);
734  vmethod(Handle, sel_registerName(PChar(StrNSTextView_lowerBaseline)), _sender);
735end;
736
737procedure NSTextView.toggleTraditionalCharacterShape(_sender: lobjc.id);
738type
739  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
740var
741  vmethod: TmsgSendWrapper;
742begin
743  vmethod := TmsgSendWrapper(@objc_msgSend);
744  vmethod(Handle, sel_registerName(PChar(StrNSTextView_toggleTraditionalCharacterShape)), _sender);
745end;
746
747procedure NSTextView.outline(_sender: lobjc.id);
748type
749  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
750var
751  vmethod: TmsgSendWrapper;
752begin
753  vmethod := TmsgSendWrapper(@objc_msgSend);
754  vmethod(Handle, sel_registerName(PChar(StrNSTextView_outline)), _sender);
755end;
756
757{.$ifdef  MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3}
758procedure NSTextView.performFindPanelAction(_sender: lobjc.id);
759type
760  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
761var
762  vmethod: TmsgSendWrapper;
763begin
764  vmethod := TmsgSendWrapper(@objc_msgSend);
765  vmethod(Handle, sel_registerName(PChar(StrNSTextView_performFindPanelAction)), _sender);
766end;
767
768procedure NSTextView.alignJustified(_sender: lobjc.id);
769type
770  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
771var
772  vmethod: TmsgSendWrapper;
773begin
774  vmethod := TmsgSendWrapper(@objc_msgSend);
775  vmethod(Handle, sel_registerName(PChar(StrNSTextView_alignJustified)), _sender);
776end;
777
778procedure NSTextView.changeColor(_sender: lobjc.id);
779type
780  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
781var
782  vmethod: TmsgSendWrapper;
783begin
784  vmethod := TmsgSendWrapper(@objc_msgSend);
785  vmethod(Handle, sel_registerName(PChar(StrNSTextView_changeColor)), _sender);
786end;
787
788procedure NSTextView.changeAttributes(_sender: lobjc.id);
789type
790  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
791var
792  vmethod: TmsgSendWrapper;
793begin
794  vmethod := TmsgSendWrapper(@objc_msgSend);
795  vmethod(Handle, sel_registerName(PChar(StrNSTextView_changeAttributes)), _sender);
796end;
797
798procedure NSTextView.changeDocumentBackgroundColor(_sender: lobjc.id);
799type
800  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
801var
802  vmethod: TmsgSendWrapper;
803begin
804  vmethod := TmsgSendWrapper(@objc_msgSend);
805  vmethod(Handle, sel_registerName(PChar(StrNSTextView_changeDocumentBackgroundColor)), _sender);
806end;
807
808procedure NSTextView.toggleBaseWritingDirection(_sender: lobjc.id);
809type
810  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
811var
812  vmethod: TmsgSendWrapper;
813begin
814  vmethod := TmsgSendWrapper(@objc_msgSend);
815  vmethod(Handle, sel_registerName(PChar(StrNSTextView_toggleBaseWritingDirection)), _sender);
816end;
817
818{.$ifdef  MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4}
819procedure NSTextView.orderFrontSpacingPanel(_sender: lobjc.id);
820type
821  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
822var
823  vmethod: TmsgSendWrapper;
824begin
825  vmethod := TmsgSendWrapper(@objc_msgSend);
826  vmethod(Handle, sel_registerName(PChar(StrNSTextView_orderFrontSpacingPanel)), _sender);
827end;
828
829procedure NSTextView.orderFrontLinkPanel(_sender: lobjc.id);
830type
831  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
832var
833  vmethod: TmsgSendWrapper;
834begin
835  vmethod := TmsgSendWrapper(@objc_msgSend);
836  vmethod(Handle, sel_registerName(PChar(StrNSTextView_orderFrontLinkPanel)), _sender);
837end;
838
839procedure NSTextView.orderFrontListPanel(_sender: lobjc.id);
840type
841  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
842var
843  vmethod: TmsgSendWrapper;
844begin
845  vmethod := TmsgSendWrapper(@objc_msgSend);
846  vmethod(Handle, sel_registerName(PChar(StrNSTextView_orderFrontListPanel)), _sender);
847end;
848
849procedure NSTextView.orderFrontTablePanel(_sender: lobjc.id);
850type
851  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
852var
853  vmethod: TmsgSendWrapper;
854begin
855  vmethod := TmsgSendWrapper(@objc_msgSend);
856  vmethod(Handle, sel_registerName(PChar(StrNSTextView_orderFrontTablePanel)), _sender);
857end;
858
859procedure NSTextView.rulerView_didMoveMarker(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker});
860type
861  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}); cdecl;
862var
863  vmethod: TmsgSendWrapper;
864begin
865  vmethod := TmsgSendWrapper(@objc_msgSend);
866  vmethod(Handle, sel_registerName(PChar(StrNSTextView_rulerView_didMoveMarker)), _ruler, _marker);
867end;
868
869procedure NSTextView.rulerView_didRemoveMarker(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker});
870type
871  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}); cdecl;
872var
873  vmethod: TmsgSendWrapper;
874begin
875  vmethod := TmsgSendWrapper(@objc_msgSend);
876  vmethod(Handle, sel_registerName(PChar(StrNSTextView_rulerView_didRemoveMarker)), _ruler, _marker);
877end;
878
879procedure NSTextView.rulerView_didAddMarker(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker});
880type
881  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}); cdecl;
882var
883  vmethod: TmsgSendWrapper;
884begin
885  vmethod := TmsgSendWrapper(@objc_msgSend);
886  vmethod(Handle, sel_registerName(PChar(StrNSTextView_rulerView_didAddMarker)), _ruler, _marker);
887end;
888
889function NSTextView.rulerView_shouldMoveMarker(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}): LongBool;
890type
891  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}): LongBool; cdecl;
892var
893  vmethod: TmsgSendWrapper;
894begin
895  vmethod := TmsgSendWrapper(@objc_msgSend);
896  Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSTextView_rulerView_shouldMoveMarker)), _ruler, _marker));
897end;
898
899function NSTextView.rulerView_shouldAddMarker(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}): LongBool;
900type
901  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}): LongBool; cdecl;
902var
903  vmethod: TmsgSendWrapper;
904begin
905  vmethod := TmsgSendWrapper(@objc_msgSend);
906  Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSTextView_rulerView_shouldAddMarker)), _ruler, _marker));
907end;
908
909function NSTextView.rulerView_willMoveMarker_toLocation(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}; _location: Single): Single;
910type
911  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}; _location: Single): Single; cdecl;
912var
913  vmethod: TmsgSendWrapper;
914begin
915  vmethod := TmsgSendWrapper(@objc_msgSend);
916  Result := Single(vmethod(Handle, sel_registerName(PChar(StrNSTextView_rulerView_willMoveMarker_toLocation)), _ruler, _marker, _location));
917end;
918
919function NSTextView.rulerView_shouldRemoveMarker(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}): LongBool;
920type
921  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}): LongBool; cdecl;
922var
923  vmethod: TmsgSendWrapper;
924begin
925  vmethod := TmsgSendWrapper(@objc_msgSend);
926  Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSTextView_rulerView_shouldRemoveMarker)), _ruler, _marker));
927end;
928
929function NSTextView.rulerView_willAddMarker_atLocation(_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}; _location: Single): Single;
930type
931  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_ruler: lobjc.id {NSRulerView}; _marker: lobjc.id {NSRulerMarker}; _location: Single): Single; cdecl;
932var
933  vmethod: TmsgSendWrapper;
934begin
935  vmethod := TmsgSendWrapper(@objc_msgSend);
936  Result := Single(vmethod(Handle, sel_registerName(PChar(StrNSTextView_rulerView_willAddMarker_atLocation)), _ruler, _marker, _location));
937end;
938
939procedure NSTextView.rulerView_handleMouseDown(_ruler: lobjc.id {NSRulerView}; _event: lobjc.id {NSEvent});
940type
941  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_ruler: lobjc.id {NSRulerView}; _event: lobjc.id {NSEvent}); cdecl;
942var
943  vmethod: TmsgSendWrapper;
944begin
945  vmethod := TmsgSendWrapper(@objc_msgSend);
946  vmethod(Handle, sel_registerName(PChar(StrNSTextView_rulerView_handleMouseDown)), _ruler, _event);
947end;
948
949procedure NSTextView.setNeedsDisplayInRect_avoidAdditionalLayout(_rect: NSRect; _flag: LongBool);
950type
951  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_rect: NSRect; _flag: LongBool); cdecl;
952var
953  vmethod: TmsgSendWrapper;
954begin
955  vmethod := TmsgSendWrapper(@objc_msgSend);
956  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setNeedsDisplayInRect_avoidAdditionalLayout)), _rect, _flag);
957end;
958
959function NSTextView.shouldDrawInsertionPoint: LongBool;
960begin
961  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_shouldDrawInsertionPoint)), []));
962end;
963
964procedure NSTextView.drawInsertionPointInRect_color_turnedOn(_rect: NSRect; _color: lobjc.id {NSColor}; _flag: LongBool);
965type
966  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_rect: NSRect; _color: lobjc.id {NSColor}; _flag: LongBool); cdecl;
967var
968  vmethod: TmsgSendWrapper;
969begin
970  vmethod := TmsgSendWrapper(@objc_msgSend);
971  vmethod(Handle, sel_registerName(PChar(StrNSTextView_drawInsertionPointInRect_color_turnedOn)), _rect, _color, _flag);
972end;
973
974procedure NSTextView.drawViewBackgroundInRect(_rect: NSRect);
975type
976  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_rect: NSRect); cdecl;
977var
978  vmethod: TmsgSendWrapper;
979begin
980  vmethod := TmsgSendWrapper(@objc_msgSend);
981  vmethod(Handle, sel_registerName(PChar(StrNSTextView_drawViewBackgroundInRect)), _rect);
982end;
983
984procedure NSTextView.updateRuler;
985begin
986  objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_updateRuler)), []);
987end;
988
989procedure NSTextView.updateFontPanel;
990begin
991  objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_updateFontPanel)), []);
992end;
993
994procedure NSTextView.updateDragTypeRegistration;
995begin
996  objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_updateDragTypeRegistration)), []);
997end;
998
999function NSTextView.selectionRangeForProposedRange_granularity(_proposedCharRange: NSRange; _granularity: NSSelectionGranularity): NSRange;
1000type
1001  TmsgSendWrapper = procedure (result_param: Pointer; param1: lobjc.id; param2: SEL;_proposedCharRange: NSRange; _granularity: NSSelectionGranularity); cdecl;
1002var
1003  vmethod: TmsgSendWrapper;
1004begin
1005  vmethod := TmsgSendWrapper(@objc_msgSend_fpret);
1006  vmethod(@Result, Handle, sel_registerName(PChar(StrNSTextView_selectionRangeForProposedRange_granularity)), _proposedCharRange, _granularity);
1007end;
1008
1009procedure NSTextView.clickedOnLink_atIndex(_link: lobjc.id; _charIndex: LongWord);
1010type
1011  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_link: lobjc.id; _charIndex: LongWord); cdecl;
1012var
1013  vmethod: TmsgSendWrapper;
1014begin
1015  vmethod := TmsgSendWrapper(@objc_msgSend);
1016  vmethod(Handle, sel_registerName(PChar(StrNSTextView_clickedOnLink_atIndex)), _link, _charIndex);
1017end;
1018
1019procedure NSTextView.startSpeaking(_sender: lobjc.id);
1020type
1021  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
1022var
1023  vmethod: TmsgSendWrapper;
1024begin
1025  vmethod := TmsgSendWrapper(@objc_msgSend);
1026  vmethod(Handle, sel_registerName(PChar(StrNSTextView_startSpeaking)), _sender);
1027end;
1028
1029procedure NSTextView.stopSpeaking(_sender: lobjc.id);
1030type
1031  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
1032var
1033  vmethod: TmsgSendWrapper;
1034begin
1035  vmethod := TmsgSendWrapper(@objc_msgSend);
1036  vmethod(Handle, sel_registerName(PChar(StrNSTextView_stopSpeaking)), _sender);
1037end;
1038
1039procedure NSTextView.complete(_sender: lobjc.id);
1040type
1041  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
1042var
1043  vmethod: TmsgSendWrapper;
1044begin
1045  vmethod := TmsgSendWrapper(@objc_msgSend);
1046  vmethod(Handle, sel_registerName(PChar(StrNSTextView_complete)), _sender);
1047end;
1048
1049function NSTextView.rangeForUserCompletion: NSRange;
1050begin
1051  objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSTextView_rangeForUserCompletion)), []);
1052end;
1053
1054function NSTextView.completionsForPartialWordRange_indexOfSelectedItem(_charRange: NSRange; __index: Integer): CFArrayRef;
1055type
1056  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_charRange: NSRange; __index: Integer): CFArrayRef; cdecl;
1057var
1058  vmethod: TmsgSendWrapper;
1059begin
1060  vmethod := TmsgSendWrapper(@objc_msgSend);
1061  Result := CFArrayRef(vmethod(Handle, sel_registerName(PChar(StrNSTextView_completionsForPartialWordRange_indexOfSelectedItem)), _charRange, __index));
1062end;
1063
1064procedure NSTextView.insertCompletion_forPartialWordRange_movement_isFinal(_word: CFStringRef; _charRange: NSRange; _movement: Integer; _flag: LongBool);
1065type
1066  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_word: CFStringRef; _charRange: NSRange; _movement: Integer; _flag: LongBool); cdecl;
1067var
1068  vmethod: TmsgSendWrapper;
1069begin
1070  vmethod := TmsgSendWrapper(@objc_msgSend);
1071  vmethod(Handle, sel_registerName(PChar(StrNSTextView_insertCompletion_forPartialWordRange_movement_isFinal)), _word, _charRange, _movement, _flag);
1072end;
1073
1074function NSTextView.writablePasteboardTypes: CFArrayRef;
1075begin
1076  Result := CFArrayRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_writablePasteboardTypes)), []));
1077end;
1078
1079function NSTextView.writeSelectionToPasteboard_type(_pboard: lobjc.id {NSPasteboard}; __type: CFStringRef): LongBool;
1080type
1081  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_pboard: lobjc.id {NSPasteboard}; __type: CFStringRef): LongBool; cdecl;
1082var
1083  vmethod: TmsgSendWrapper;
1084begin
1085  vmethod := TmsgSendWrapper(@objc_msgSend);
1086  Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSTextView_writeSelectionToPasteboard_type)), _pboard, __type));
1087end;
1088
1089function NSTextView.writeSelectionToPasteboard_types(_pboard: lobjc.id {NSPasteboard}; _types: CFArrayRef): LongBool;
1090type
1091  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_pboard: lobjc.id {NSPasteboard}; _types: CFArrayRef): LongBool; cdecl;
1092var
1093  vmethod: TmsgSendWrapper;
1094begin
1095  vmethod := TmsgSendWrapper(@objc_msgSend);
1096  Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSTextView_writeSelectionToPasteboard_types)), _pboard, _types));
1097end;
1098
1099function NSTextView.readablePasteboardTypes: CFArrayRef;
1100begin
1101  Result := CFArrayRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_readablePasteboardTypes)), []));
1102end;
1103
1104function NSTextView.preferredPasteboardTypeFromArray_restrictedToTypesFromArray(_availableTypes: CFArrayRef; _allowedTypes: CFArrayRef): CFStringRef;
1105type
1106  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_availableTypes: CFArrayRef; _allowedTypes: CFArrayRef): CFStringRef; cdecl;
1107var
1108  vmethod: TmsgSendWrapper;
1109begin
1110  vmethod := TmsgSendWrapper(@objc_msgSend);
1111  Result := CFStringRef(vmethod(Handle, sel_registerName(PChar(StrNSTextView_preferredPasteboardTypeFromArray_restrictedToTypesFromArray)), _availableTypes, _allowedTypes));
1112end;
1113
1114function NSTextView.readSelectionFromPasteboard_type(_pboard: lobjc.id {NSPasteboard}; __type: CFStringRef): LongBool;
1115type
1116  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_pboard: lobjc.id {NSPasteboard}; __type: CFStringRef): LongBool; cdecl;
1117var
1118  vmethod: TmsgSendWrapper;
1119begin
1120  vmethod := TmsgSendWrapper(@objc_msgSend);
1121  Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSTextView_readSelectionFromPasteboard_type)), _pboard, __type));
1122end;
1123
1124function NSTextView.readSelectionFromPasteboard(_pboard: lobjc.id {NSPasteboard}): LongBool;
1125type
1126  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_pboard: lobjc.id {NSPasteboard}): LongBool; cdecl;
1127var
1128  vmethod: TmsgSendWrapper;
1129begin
1130  vmethod := TmsgSendWrapper(@objc_msgSend);
1131  Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSTextView_readSelectionFromPasteboard)), _pboard));
1132end;
1133
1134class procedure NSTextView.registerForServices;
1135begin
1136  objc_msgSend(getClass, sel_registerName(PChar(StrNSTextView_registerForServices)), []);
1137end;
1138
1139function NSTextView.validRequestorForSendType_returnType(_sendType: CFStringRef; _returnType: CFStringRef): lobjc.id;
1140type
1141  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_sendType: CFStringRef; _returnType: CFStringRef): lobjc.id; cdecl;
1142var
1143  vmethod: TmsgSendWrapper;
1144begin
1145  vmethod := TmsgSendWrapper(@objc_msgSend);
1146  Result := lobjc.id(vmethod(Handle, sel_registerName(PChar(StrNSTextView_validRequestorForSendType_returnType)), _sendType, _returnType));
1147end;
1148
1149procedure NSTextView.pasteAsPlainText(_sender: lobjc.id);
1150type
1151  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
1152var
1153  vmethod: TmsgSendWrapper;
1154begin
1155  vmethod := TmsgSendWrapper(@objc_msgSend);
1156  vmethod(Handle, sel_registerName(PChar(StrNSTextView_pasteAsPlainText)), _sender);
1157end;
1158
1159procedure NSTextView.pasteAsRichText(_sender: lobjc.id);
1160type
1161  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
1162var
1163  vmethod: TmsgSendWrapper;
1164begin
1165  vmethod := TmsgSendWrapper(@objc_msgSend);
1166  vmethod(Handle, sel_registerName(PChar(StrNSTextView_pasteAsRichText)), _sender);
1167end;
1168
1169function NSTextView.dragSelectionWithEvent_offset_slideBack(_event: lobjc.id {NSEvent}; _mouseOffset: NSSize; _slideBack: LongBool): LongBool;
1170type
1171  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_event: lobjc.id {NSEvent}; _mouseOffset: NSSize; _slideBack: LongBool): LongBool; cdecl;
1172var
1173  vmethod: TmsgSendWrapper;
1174begin
1175  vmethod := TmsgSendWrapper(@objc_msgSend);
1176  Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSTextView_dragSelectionWithEvent_offset_slideBack)), _event, _mouseOffset, _slideBack));
1177end;
1178
1179function NSTextView.dragImageForSelectionWithEvent_origin(_event: lobjc.id {NSEvent}; _origin: NSPointPointer): lobjc.id;
1180type
1181  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_event: lobjc.id {NSEvent}; _origin: NSPointPointer): lobjc.id; cdecl;
1182var
1183  vmethod: TmsgSendWrapper;
1184begin
1185  vmethod := TmsgSendWrapper(@objc_msgSend);
1186  Result := lobjc.id(vmethod(Handle, sel_registerName(PChar(StrNSTextView_dragImageForSelectionWithEvent_origin)), _event, _origin));
1187end;
1188
1189function NSTextView.acceptableDragTypes: CFArrayRef;
1190begin
1191  Result := CFArrayRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_acceptableDragTypes)), []));
1192end;
1193
1194function NSTextView.dragOperationForDraggingInfo_type(_dragInfo: lobjc.id; __type: CFStringRef): LongWord;
1195type
1196  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_dragInfo: lobjc.id; __type: CFStringRef): LongWord; cdecl;
1197var
1198  vmethod: TmsgSendWrapper;
1199begin
1200  vmethod := TmsgSendWrapper(@objc_msgSend);
1201  Result := LongWord(vmethod(Handle, sel_registerName(PChar(StrNSTextView_dragOperationForDraggingInfo_type)), _dragInfo, __type));
1202end;
1203
1204procedure NSTextView.cleanUpAfterDragOperation;
1205begin
1206  objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_cleanUpAfterDragOperation)), []);
1207end;
1208
1209function NSTextView.acceptsGlyphInfo: LongBool;
1210begin
1211  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_acceptsGlyphInfo)), []));
1212end;
1213
1214procedure NSTextView.setAcceptsGlyphInfo(_flag: LongBool);
1215type
1216  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1217var
1218  vmethod: TmsgSendWrapper;
1219begin
1220  vmethod := TmsgSendWrapper(@objc_msgSend);
1221  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setAcceptsGlyphInfo)), _flag);
1222end;
1223
1224function NSTextView.selectedRanges: CFArrayRef;
1225begin
1226  Result := CFArrayRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_selectedRanges)), []));
1227end;
1228
1229procedure NSTextView.setSelectedRanges_affinity_stillSelecting(_ranges: CFArrayRef; _affinity: NSSelectionAffinity; _stillSelectingFlag: LongBool);
1230type
1231  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_ranges: CFArrayRef; _affinity: NSSelectionAffinity; _stillSelectingFlag: LongBool); cdecl;
1232var
1233  vmethod: TmsgSendWrapper;
1234begin
1235  vmethod := TmsgSendWrapper(@objc_msgSend);
1236  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setSelectedRanges_affinity_stillSelecting)), _ranges, _affinity, _stillSelectingFlag);
1237end;
1238
1239procedure NSTextView.setSelectedRanges(_ranges: CFArrayRef);
1240type
1241  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_ranges: CFArrayRef); cdecl;
1242var
1243  vmethod: TmsgSendWrapper;
1244begin
1245  vmethod := TmsgSendWrapper(@objc_msgSend);
1246  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setSelectedRanges)), _ranges);
1247end;
1248
1249procedure NSTextView.setSelectedRange_affinity_stillSelecting(_charRange: NSRange; _affinity: NSSelectionAffinity; _stillSelectingFlag: LongBool);
1250type
1251  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_charRange: NSRange; _affinity: NSSelectionAffinity; _stillSelectingFlag: LongBool); cdecl;
1252var
1253  vmethod: TmsgSendWrapper;
1254begin
1255  vmethod := TmsgSendWrapper(@objc_msgSend);
1256  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setSelectedRange_affinity_stillSelecting)), _charRange, _affinity, _stillSelectingFlag);
1257end;
1258
1259function NSTextView.selectionAffinity: NSSelectionAffinity;
1260begin
1261  Result := NSSelectionAffinity(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_selectionAffinity)), []));
1262end;
1263
1264function NSTextView.selectionGranularity: NSSelectionGranularity;
1265begin
1266  Result := NSSelectionGranularity(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_selectionGranularity)), []));
1267end;
1268
1269procedure NSTextView.setSelectionGranularity(_granularity: NSSelectionGranularity);
1270type
1271  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_granularity: NSSelectionGranularity); cdecl;
1272var
1273  vmethod: TmsgSendWrapper;
1274begin
1275  vmethod := TmsgSendWrapper(@objc_msgSend);
1276  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setSelectionGranularity)), _granularity);
1277end;
1278
1279procedure NSTextView.setSelectedTextAttributes(_attributeDictionary: CFDictionaryRef);
1280type
1281  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_attributeDictionary: CFDictionaryRef); cdecl;
1282var
1283  vmethod: TmsgSendWrapper;
1284begin
1285  vmethod := TmsgSendWrapper(@objc_msgSend);
1286  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setSelectedTextAttributes)), _attributeDictionary);
1287end;
1288
1289function NSTextView.selectedTextAttributes: CFDictionaryRef;
1290begin
1291  Result := CFDictionaryRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_selectedTextAttributes)), []));
1292end;
1293
1294procedure NSTextView.setInsertionPointColor(_color: lobjc.id {NSColor});
1295type
1296  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_color: lobjc.id {NSColor}); cdecl;
1297var
1298  vmethod: TmsgSendWrapper;
1299begin
1300  vmethod := TmsgSendWrapper(@objc_msgSend);
1301  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setInsertionPointColor)), _color);
1302end;
1303
1304function NSTextView.insertionPointColor: lobjc.id;
1305begin
1306  Result := lobjc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_insertionPointColor)), []));
1307end;
1308
1309procedure NSTextView.updateInsertionPointStateAndRestartTimer(_restartFlag: LongBool);
1310type
1311  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_restartFlag: LongBool); cdecl;
1312var
1313  vmethod: TmsgSendWrapper;
1314begin
1315  vmethod := TmsgSendWrapper(@objc_msgSend);
1316  vmethod(Handle, sel_registerName(PChar(StrNSTextView_updateInsertionPointStateAndRestartTimer)), _restartFlag);
1317end;
1318
1319procedure NSTextView.setMarkedTextAttributes(_attributeDictionary: CFDictionaryRef);
1320type
1321  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_attributeDictionary: CFDictionaryRef); cdecl;
1322var
1323  vmethod: TmsgSendWrapper;
1324begin
1325  vmethod := TmsgSendWrapper(@objc_msgSend);
1326  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setMarkedTextAttributes)), _attributeDictionary);
1327end;
1328
1329function NSTextView.markedTextAttributes: CFDictionaryRef;
1330begin
1331  Result := CFDictionaryRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_markedTextAttributes)), []));
1332end;
1333
1334procedure NSTextView.setLinkTextAttributes(_attributeDictionary: CFDictionaryRef);
1335type
1336  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_attributeDictionary: CFDictionaryRef); cdecl;
1337var
1338  vmethod: TmsgSendWrapper;
1339begin
1340  vmethod := TmsgSendWrapper(@objc_msgSend);
1341  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setLinkTextAttributes)), _attributeDictionary);
1342end;
1343
1344function NSTextView.linkTextAttributes: CFDictionaryRef;
1345begin
1346  Result := CFDictionaryRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_linkTextAttributes)), []));
1347end;
1348
1349procedure NSTextView.setRulerVisible(_flag: LongBool);
1350type
1351  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1352var
1353  vmethod: TmsgSendWrapper;
1354begin
1355  vmethod := TmsgSendWrapper(@objc_msgSend);
1356  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setRulerVisible)), _flag);
1357end;
1358
1359function NSTextView.usesRuler: LongBool;
1360begin
1361  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_usesRuler)), []));
1362end;
1363
1364procedure NSTextView.setUsesRuler(_flag: LongBool);
1365type
1366  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1367var
1368  vmethod: TmsgSendWrapper;
1369begin
1370  vmethod := TmsgSendWrapper(@objc_msgSend);
1371  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setUsesRuler)), _flag);
1372end;
1373
1374procedure NSTextView.setContinuousSpellCheckingEnabled(_flag: LongBool);
1375type
1376  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1377var
1378  vmethod: TmsgSendWrapper;
1379begin
1380  vmethod := TmsgSendWrapper(@objc_msgSend);
1381  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setContinuousSpellCheckingEnabled)), _flag);
1382end;
1383
1384function NSTextView.isContinuousSpellCheckingEnabled: LongBool;
1385begin
1386  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_isContinuousSpellCheckingEnabled)), []));
1387end;
1388
1389procedure NSTextView.toggleContinuousSpellChecking(_sender: lobjc.id);
1390type
1391  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_sender: lobjc.id); cdecl;
1392var
1393  vmethod: TmsgSendWrapper;
1394begin
1395  vmethod := TmsgSendWrapper(@objc_msgSend);
1396  vmethod(Handle, sel_registerName(PChar(StrNSTextView_toggleContinuousSpellChecking)), _sender);
1397end;
1398
1399function NSTextView.spellCheckerDocumentTag: Integer;
1400begin
1401  Result := {%H-}Integer(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_spellCheckerDocumentTag)), []));
1402end;
1403
1404function NSTextView.typingAttributes: CFDictionaryRef;
1405begin
1406  Result := CFDictionaryRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_typingAttributes)), []));
1407end;
1408
1409procedure NSTextView.setTypingAttributes(_attrs: CFDictionaryRef);
1410type
1411  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_attrs: CFDictionaryRef); cdecl;
1412var
1413  vmethod: TmsgSendWrapper;
1414begin
1415  vmethod := TmsgSendWrapper(@objc_msgSend);
1416  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setTypingAttributes)), _attrs);
1417end;
1418
1419function NSTextView.shouldChangeTextInRanges_replacementStrings(_affectedRanges: CFArrayRef; _replacementStrings: CFArrayRef): LongBool;
1420type
1421  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_affectedRanges: CFArrayRef; _replacementStrings: CFArrayRef): LongBool; cdecl;
1422var
1423  vmethod: TmsgSendWrapper;
1424begin
1425  vmethod := TmsgSendWrapper(@objc_msgSend);
1426  Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSTextView_shouldChangeTextInRanges_replacementStrings)), _affectedRanges, _replacementStrings));
1427end;
1428
1429function NSTextView.rangesForUserTextChange: CFArrayRef;
1430begin
1431  Result := CFArrayRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_rangesForUserTextChange)), []));
1432end;
1433
1434function NSTextView.rangesForUserCharacterAttributeChange: CFArrayRef;
1435begin
1436  Result := CFArrayRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_rangesForUserCharacterAttributeChange)), []));
1437end;
1438
1439function NSTextView.rangesForUserParagraphAttributeChange: CFArrayRef;
1440begin
1441  Result := CFArrayRef(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_rangesForUserParagraphAttributeChange)), []));
1442end;
1443
1444function NSTextView.shouldChangeTextInRange_replacementString(_affectedCharRange: NSRange; _replacementString: CFStringRef): LongBool;
1445type
1446  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_affectedCharRange: NSRange; _replacementString: CFStringRef): LongBool; cdecl;
1447var
1448  vmethod: TmsgSendWrapper;
1449begin
1450  vmethod := TmsgSendWrapper(@objc_msgSend);
1451  Result := LongBool(vmethod(Handle, sel_registerName(PChar(StrNSTextView_shouldChangeTextInRange_replacementString)), _affectedCharRange, _replacementString));
1452end;
1453
1454procedure NSTextView.didChangeText;
1455begin
1456  objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_didChangeText)), []);
1457end;
1458
1459function NSTextView.rangeForUserTextChange: NSRange;
1460begin
1461  objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSTextView_rangeForUserTextChange)), []);
1462end;
1463
1464function NSTextView.rangeForUserCharacterAttributeChange: NSRange;
1465begin
1466  objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSTextView_rangeForUserCharacterAttributeChange)), []);
1467end;
1468
1469function NSTextView.rangeForUserParagraphAttributeChange: NSRange;
1470begin
1471  objc_msgSend_stret(@Result, Handle, sel_registerName(PChar(StrNSTextView_rangeForUserParagraphAttributeChange)), []);
1472end;
1473
1474procedure NSTextView.setUsesFindPanel(_flag: LongBool);
1475type
1476  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1477var
1478  vmethod: TmsgSendWrapper;
1479begin
1480  vmethod := TmsgSendWrapper(@objc_msgSend);
1481  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setUsesFindPanel)), _flag);
1482end;
1483
1484function NSTextView.usesFindPanel: LongBool;
1485begin
1486  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_usesFindPanel)), []));
1487end;
1488
1489procedure NSTextView.setAllowsDocumentBackgroundColorChange(_flag: LongBool);
1490type
1491  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1492var
1493  vmethod: TmsgSendWrapper;
1494begin
1495  vmethod := TmsgSendWrapper(@objc_msgSend);
1496  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setAllowsDocumentBackgroundColorChange)), _flag);
1497end;
1498
1499function NSTextView.allowsDocumentBackgroundColorChange: LongBool;
1500begin
1501  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_allowsDocumentBackgroundColorChange)), []));
1502end;
1503
1504procedure NSTextView.setDefaultParagraphStyle(_paragraphStyle: lobjc.id {NSParagraphStyle});
1505type
1506  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_paragraphStyle: lobjc.id {NSParagraphStyle}); cdecl;
1507var
1508  vmethod: TmsgSendWrapper;
1509begin
1510  vmethod := TmsgSendWrapper(@objc_msgSend);
1511  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setDefaultParagraphStyle)), _paragraphStyle);
1512end;
1513
1514function NSTextView.defaultParagraphStyle: lobjc.id;
1515begin
1516  Result := lobjc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_defaultParagraphStyle)), []));
1517end;
1518
1519{.$ifdef  MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4}
1520procedure NSTextView.breakUndoCoalescing;
1521begin
1522  objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_breakUndoCoalescing)), []);
1523end;
1524
1525function NSTextView.isSelectable: LongBool;
1526begin
1527  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_isSelectable)), []));
1528end;
1529
1530procedure NSTextView.setSelectable(_flag: LongBool);
1531type
1532  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1533var
1534  vmethod: TmsgSendWrapper;
1535begin
1536  vmethod := TmsgSendWrapper(@objc_msgSend);
1537  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setSelectable)), _flag);
1538end;
1539
1540function NSTextView.isEditable: LongBool;
1541begin
1542  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_isEditable)), []));
1543end;
1544
1545procedure NSTextView.setEditable(_flag: LongBool);
1546type
1547  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1548var
1549  vmethod: TmsgSendWrapper;
1550begin
1551  vmethod := TmsgSendWrapper(@objc_msgSend);
1552  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setEditable)), _flag);
1553end;
1554
1555function NSTextView.isRichText: LongBool;
1556begin
1557  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_isRichText)), []));
1558end;
1559
1560procedure NSTextView.setRichText(_flag: LongBool);
1561type
1562  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1563var
1564  vmethod: TmsgSendWrapper;
1565begin
1566  vmethod := TmsgSendWrapper(@objc_msgSend);
1567  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setRichText)), _flag);
1568end;
1569
1570function NSTextView.importsGraphics: LongBool;
1571begin
1572  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_importsGraphics)), []));
1573end;
1574
1575procedure NSTextView.setImportsGraphics(_flag: LongBool);
1576type
1577  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1578var
1579  vmethod: TmsgSendWrapper;
1580begin
1581  vmethod := TmsgSendWrapper(@objc_msgSend);
1582  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setImportsGraphics)), _flag);
1583end;
1584
1585function NSTextView.delegate: lobjc.id;
1586begin
1587  Result := lobjc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_delegate)), []));
1588end;
1589
1590procedure NSTextView.setDelegate(_anObject: lobjc.id);
1591type
1592  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_anObject: lobjc.id); cdecl;
1593var
1594  vmethod: TmsgSendWrapper;
1595begin
1596  vmethod := TmsgSendWrapper(@objc_msgSend);
1597  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setDelegate)), _anObject);
1598end;
1599
1600function NSTextView.isFieldEditor: LongBool;
1601begin
1602  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_isFieldEditor)), []));
1603end;
1604
1605procedure NSTextView.setFieldEditor(_flag: LongBool);
1606type
1607  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1608var
1609  vmethod: TmsgSendWrapper;
1610begin
1611  vmethod := TmsgSendWrapper(@objc_msgSend);
1612  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setFieldEditor)), _flag);
1613end;
1614
1615function NSTextView.usesFontPanel: LongBool;
1616begin
1617  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_usesFontPanel)), []));
1618end;
1619
1620procedure NSTextView.setUsesFontPanel(_flag: LongBool);
1621type
1622  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1623var
1624  vmethod: TmsgSendWrapper;
1625begin
1626  vmethod := TmsgSendWrapper(@objc_msgSend);
1627  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setUsesFontPanel)), _flag);
1628end;
1629
1630function NSTextView.isRulerVisible: LongBool;
1631begin
1632  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_isRulerVisible)), []));
1633end;
1634
1635procedure NSTextView.setBackgroundColor(_color: lobjc.id {NSColor});
1636type
1637  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_color: lobjc.id {NSColor}); cdecl;
1638var
1639  vmethod: TmsgSendWrapper;
1640begin
1641  vmethod := TmsgSendWrapper(@objc_msgSend);
1642  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setBackgroundColor)), _color);
1643end;
1644
1645function NSTextView.backgroundColor: lobjc.id;
1646begin
1647  Result := lobjc.id(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_backgroundColor)), []));
1648end;
1649
1650procedure NSTextView.setDrawsBackground(_flag: LongBool);
1651type
1652  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1653var
1654  vmethod: TmsgSendWrapper;
1655begin
1656  vmethod := TmsgSendWrapper(@objc_msgSend);
1657  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setDrawsBackground)), _flag);
1658end;
1659
1660function NSTextView.drawsBackground: LongBool;
1661begin
1662  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_drawsBackground)), []));
1663end;
1664
1665procedure NSTextView.setSelectedRange(_charRange: NSRange);
1666type
1667  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_charRange: NSRange); cdecl;
1668var
1669  vmethod: TmsgSendWrapper;
1670begin
1671  vmethod := TmsgSendWrapper(@objc_msgSend);
1672  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setSelectedRange)), _charRange);
1673end;
1674
1675function NSTextView.allowsUndo: LongBool;
1676begin
1677  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_allowsUndo)), []));
1678end;
1679
1680procedure NSTextView.setAllowsUndo(_flag: LongBool);
1681type
1682  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1683var
1684  vmethod: TmsgSendWrapper;
1685begin
1686  vmethod := TmsgSendWrapper(@objc_msgSend);
1687  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setAllowsUndo)), _flag);
1688end;
1689
1690function NSTextView.resignFirstResponder: LongBool;
1691begin
1692  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_resignFirstResponder)), []));
1693end;
1694
1695function NSTextView.becomeFirstResponder: LongBool;
1696begin
1697  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_becomeFirstResponder)), []));
1698end;
1699
1700function NSTextView.smartInsertDeleteEnabled: LongBool;
1701begin
1702  Result := {%H-}LongBool(objc_msgSend(Handle, sel_registerName(PChar(StrNSTextView_smartInsertDeleteEnabled)), []));
1703end;
1704
1705procedure NSTextView.setSmartInsertDeleteEnabled(_flag: LongBool);
1706type
1707  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_flag: LongBool); cdecl;
1708var
1709  vmethod: TmsgSendWrapper;
1710begin
1711  vmethod := TmsgSendWrapper(@objc_msgSend);
1712  vmethod(Handle, sel_registerName(PChar(StrNSTextView_setSmartInsertDeleteEnabled)), _flag);
1713end;
1714
1715function NSTextView.smartDeleteRangeForProposedRange(_proposedCharRange: NSRange): NSRange;
1716type
1717  TmsgSendWrapper = procedure (result_param: Pointer; param1: lobjc.id; param2: SEL;_proposedCharRange: NSRange); cdecl;
1718var
1719  vmethod: TmsgSendWrapper;
1720begin
1721  vmethod := TmsgSendWrapper(@objc_msgSend_fpret);
1722  vmethod(@Result, Handle, sel_registerName(PChar(StrNSTextView_smartDeleteRangeForProposedRange)), _proposedCharRange);
1723end;
1724
1725procedure NSTextView.smartInsertForString_replacingRange_beforeString_afterString(_pasteString: CFStringRef; _charRangeToReplace: NSRange; _beforeString: CFStringRef; _afterString: CFStringRef);
1726type
1727  TmsgSendWrapper = procedure (param1: lobjc.id; param2: SEL;_pasteString: CFStringRef; _charRangeToReplace: NSRange; _beforeString: CFStringRef; _afterString: CFStringRef); cdecl;
1728var
1729  vmethod: TmsgSendWrapper;
1730begin
1731  vmethod := TmsgSendWrapper(@objc_msgSend);
1732  vmethod(Handle, sel_registerName(PChar(StrNSTextView_smartInsertForString_replacingRange_beforeString_afterString)), _pasteString, _charRangeToReplace, _beforeString, _afterString);
1733end;
1734
1735function NSTextView.smartInsertBeforeStringForString_replacingRange(_pasteString: CFStringRef; _charRangeToReplace: NSRange): CFStringRef;
1736type
1737  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_pasteString: CFStringRef; _charRangeToReplace: NSRange): CFStringRef; cdecl;
1738var
1739  vmethod: TmsgSendWrapper;
1740begin
1741  vmethod := TmsgSendWrapper(@objc_msgSend);
1742  Result := CFStringRef(vmethod(Handle, sel_registerName(PChar(StrNSTextView_smartInsertBeforeStringForString_replacingRange)), _pasteString, _charRangeToReplace));
1743end;
1744
1745function NSTextView.smartInsertAfterStringForString_replacingRange(_pasteString: CFStringRef; _charRangeToReplace: NSRange): CFStringRef;
1746type
1747  TmsgSendWrapper = function (param1: lobjc.id; param2: SEL;_pasteString: CFStringRef; _charRangeToReplace: NSRange): CFStringRef; cdecl;
1748var
1749  vmethod: TmsgSendWrapper;
1750begin
1751  vmethod := TmsgSendWrapper(@objc_msgSend);
1752  Result := CFStringRef(vmethod(Handle, sel_registerName(PChar(StrNSTextView_smartInsertAfterStringForString_replacingRange)), _pasteString, _charRangeToReplace));
1753end;
1754
1755{$endif}
1756