comparison dwt/internal/cocoa/NSTextView.d @ 45:d8635bb48c7c

Merge with SWT 3.5
author Jacob Carlborg <doob@me.com>
date Mon, 01 Dec 2008 17:07:00 +0100
parents f565d3a95c0a
children
comparison
equal deleted inserted replaced
44:ca5e494f2bbf 45:d8635bb48c7c
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2007 IBM Corporation and others. 2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * 10 *
11 * Port to the D programming language: 11 * Port to the D programming language:
12 * Jacob Carlborg <jacob.carlborg@gmail.com> 12 * Jacob Carlborg <doob@me.com>
13 *******************************************************************************/ 13 *******************************************************************************/
14 module dwt.internal.cocoa.NSTextView; 14 module dwt.internal.cocoa.NSTextView;
15 15
16 import dwt.internal.cocoa.CGFloat; 16 import dwt.dwthelper.utils;
17 import dwt.internal.cocoa.id; 17 import cocoa = dwt.internal.cocoa.id;
18 import dwt.internal.cocoa.NSArray;
19 import dwt.internal.cocoa.NSColor;
20 import dwt.internal.cocoa.NSDictionary; 18 import dwt.internal.cocoa.NSDictionary;
21 import dwt.internal.cocoa.NSDragOperation;
22 import dwt.internal.cocoa.NSEvent;
23 import dwt.internal.cocoa.NSImage;
24 import dwt.internal.cocoa.NSInteger;
25 import dwt.internal.cocoa.NSLayoutManager;
26 import dwt.internal.cocoa.NSParagraphStyle;
27 import dwt.internal.cocoa.NSPasteboard;
28 import dwt.internal.cocoa.NSPoint;
29 import dwt.internal.cocoa.NSRange;
30 import dwt.internal.cocoa.NSRect;
31 import dwt.internal.cocoa.NSRulerMarker;
32 import dwt.internal.cocoa.NSRulerView;
33 import dwt.internal.cocoa.NSSize;
34 import dwt.internal.cocoa.NSString;
35 import dwt.internal.cocoa.NSText; 19 import dwt.internal.cocoa.NSText;
36 import dwt.internal.cocoa.NSTextContainer; 20 import dwt.internal.cocoa.NSTextContainer;
37 import dwt.internal.cocoa.NSTextStorage; 21 import dwt.internal.cocoa.NSTextStorage;
38 import dwt.internal.cocoa.OS; 22 import dwt.internal.cocoa.OS;
39 import objc = dwt.internal.objc.runtime; 23 import objc = dwt.internal.objc.runtime;
40 24
41 enum NSSelectionAffinity 25 public class NSTextView : NSText {
42 { 26
43 NSSelectionAffinityUpstream = 0, 27 public this() {
44 NSSelectionAffinityDownstream = 1 28 super();
45 } 29 }
46 30
47 alias NSSelectionAffinity.NSSelectionAffinityUpstream NSSelectionAffinityUpstream; 31 public this(objc.id id) {
48 alias NSSelectionAffinity.NSSelectionAffinityDownstream NSSelectionAffinityDownstream; 32 super(id);
49
50 enum NSSelectionGranularity
51 {
52 NSSelectByCharacter = 0,
53 NSSelectByWord = 1,
54 NSSelectByParagraph = 2
55 } 33 }
56 34
57 alias NSSelectionGranularity.NSSelectByCharacter NSSelectByCharacter; 35 public this(cocoa.id id) {
58 alias NSSelectionGranularity.NSSelectByWord NSSelectByWord; 36 super(id);
59 alias NSSelectionGranularity.NSSelectByParagraph NSSelectByParagraph; 37 }
60 38
61 public class NSTextView : NSText 39 public NSDictionary markedTextAttributes() {
62 { 40 objc.id result = OS.objc_msgSend(this.id, OS.sel_markedTextAttributes);
41 return result !is null ? new NSDictionary(result) : null;
42 }
63 43
64 public this () 44 public void setRichText(bool flag) {
65 { 45 OS.objc_msgSend(this.id, OS.sel_setRichText_, flag);
66 super(); 46 }
67 }
68 47
69 public this (objc.id id) 48 public NSTextContainer textContainer() {
70 { 49 objc.id result = OS.objc_msgSend(this.id, OS.sel_textContainer);
71 super(id); 50 return result !is null ? new NSTextContainer(result) : null;
72 } 51 }
73 52
74 public NSArray acceptableDragTypes () 53 public NSTextStorage textStorage() {
75 { 54 objc.id result = OS.objc_msgSend(this.id, OS.sel_textStorage);
76 objc.id result = OS.objc_msgSend(this.id_, OS.sel_acceptableDragTypes); 55 return result !is null ? new NSTextStorage(result) : null;
77 return result !is null ? new NSArray(result) : null; 56 }
78 }
79
80 public bool acceptsGlyphInfo ()
81 {
82 return OS.objc_msgSend(this.id_, OS.sel_acceptsGlyphInfo) !is null;
83 }
84
85 public void alignJustified (id sender)
86 {
87 OS.objc_msgSend(this.id_, OS.sel_alignJustified_1, sender !is null ? sender.id_ : null);
88 }
89
90 public NSArray allowedInputSourceLocales ()
91 {
92 objc.id result = OS.objc_msgSend(this.id_, OS.sel_allowedInputSourceLocales);
93 return result !is null ? new NSArray(result) : null;
94 }
95
96 public bool allowsDocumentBackgroundColorChange ()
97 {
98 return OS.objc_msgSend(this.id_, OS.sel_allowsDocumentBackgroundColorChange) !is null;
99 }
100
101 public bool allowsImageEditing ()
102 {
103 return OS.objc_msgSend(this.id_, OS.sel_allowsImageEditing) !is null;
104 }
105
106 public bool allowsUndo ()
107 {
108 return OS.objc_msgSend(this.id_, OS.sel_allowsUndo) !is null;
109 }
110
111 public NSColor backgroundColor ()
112 {
113 objc.id result = OS.objc_msgSend(this.id_, OS.sel_backgroundColor);
114 return result !is null ? new NSColor(result) : null;
115 }
116
117 public void breakUndoCoalescing ()
118 {
119 OS.objc_msgSend(this.id_, OS.sel_breakUndoCoalescing);
120 }
121
122 public void changeAttributes (id sender)
123 {
124 OS.objc_msgSend(this.id_, OS.sel_changeAttributes_1, sender !is null ? sender.id_ : null);
125 }
126
127 public void changeColor (id sender)
128 {
129 OS.objc_msgSend(this.id_, OS.sel_changeColor_1, sender !is null ? sender.id_ : null);
130 }
131
132 public void changeDocumentBackgroundColor (id sender)
133 {
134 OS.objc_msgSend(this.id_, OS.sel_changeDocumentBackgroundColor_1, sender !is null ? sender.id_ : null);
135 }
136
137 public NSUInteger characterIndexForInsertionAtPoint (NSPoint point)
138 {
139 return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_characterIndexForInsertionAtPoint_1, point);
140 }
141
142 public void cleanUpAfterDragOperation ()
143 {
144 OS.objc_msgSend(this.id_, OS.sel_cleanUpAfterDragOperation);
145 }
146
147 public void clickedOnLink (id link, NSUInteger charIndex)
148 {
149 OS.objc_msgSend(this.id_, OS.sel_clickedOnLink_1atIndex_1, link !is null ? link.id_ : null, charIndex);
150 }
151
152 public void complete (id sender)
153 {
154 OS.objc_msgSend(this.id_, OS.sel_complete_1, sender !is null ? sender.id_ : null);
155 }
156
157 public NSArray completionsForPartialWordRange (NSRange charRange, NSInteger* index)
158 {
159 objc.id result = OS.objc_msgSend(this.id_, OS.sel_completionsForPartialWordRange_1indexOfSelectedItem_1, charRange, index);
160 return result !is null ? new NSArray(result) : null;
161 }
162
163 public NSParagraphStyle defaultParagraphStyle ()
164 {
165 objc.id result = OS.objc_msgSend(this.id_, OS.sel_defaultParagraphStyle);
166 return result !is null ? new NSParagraphStyle(result) : null;
167 }
168
169 public id delegatee ()
170 {
171 objc.id result = OS.objc_msgSend(this.id_, OS.sel_delegate);
172 return result !is null ? new id(result) : null;
173 }
174
175 public void didChangeText ()
176 {
177 OS.objc_msgSend(this.id_, OS.sel_didChangeText);
178 }
179
180 public bool displaysLinkToolTips ()
181 {
182 return OS.objc_msgSend(this.id_, OS.sel_displaysLinkToolTips) !is null;
183 }
184
185 public NSImage dragImageForSelectionWithEvent (NSEvent event, NSPointPointer origin)
186 {
187 objc.id result = OS.objc_msgSend(this.id_, OS.sel_dragImageForSelectionWithEvent_1origin_1, event !is null ? event.id_ : null, origin);
188 return result !is null ? new NSImage(result) : null;
189 }
190
191 public NSDragOperation dragOperationForDraggingInfo (id dragInfo, NSString type)
192 {
193 return cast(NSDragOperation) OS.objc_msgSend(this.id_, OS.sel_dragOperationForDraggingInfo_1type_1, dragInfo !is null ? dragInfo.id_ : null,
194 type !is null ? type.id_ : null);
195 }
196
197 public bool dragSelectionWithEvent (NSEvent event, NSSize mouseOffset, bool slideBack)
198 {
199 return OS.objc_msgSend(this.id_, OS.sel_dragSelectionWithEvent_1offset_1slideBack_1, event !is null ? event.id_ : null, mouseOffset, slideBack) !is null;
200 }
201
202 public void drawInsertionPointInRect (NSRect rect, NSColor color, bool flag)
203 {
204 OS.objc_msgSend(this.id_, OS.sel_drawInsertionPointInRect_1color_1turnedOn_1, rect, color !is null ? color.id_ : null, flag);
205 }
206
207 public void drawViewBackgroundInRect (NSRect rect)
208 {
209 OS.objc_msgSend(this.id_, OS.sel_drawViewBackgroundInRect_1, rect);
210 }
211
212 public bool drawsBackground ()
213 {
214 return OS.objc_msgSend(this.id_, OS.sel_drawsBackground) !is null;
215 }
216
217 public NSRect firstRectForCharacterRange (NSRange range)
218 {
219 NSRect result;
220 OS.objc_msgSend_stret(&result, id_, OS.sel_firstRectForCharacterRange_1, range);
221 return result;
222 }
223
224 public bool importsGraphics ()
225 {
226 return OS.objc_msgSend(this.id_, OS.sel_importsGraphics) !is null;
227 }
228
229 public id initWithFrame_ (NSRect frameRect)
230 {
231 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithFrame_1, frameRect);
232 return result !is null ? new id(result) : null;
233 }
234
235 public id initWithFrame_textContainer_ (NSRect frameRect, NSTextContainer container)
236 {
237 objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithFrame_1textContainer_1, frameRect, container !is null ? container.id_ : null);
238 return result !is null ? new id(result) : null;
239 }
240
241 public void insertCompletion (NSString word, NSRange charRange, NSInteger movement, bool flag)
242 {
243 OS.objc_msgSend(this.id_, OS.sel_insertCompletion_1forPartialWordRange_1movement_1isFinal_1, word !is null ? word.id_ : null, charRange,
244 movement, flag);
245 }
246
247 public void insertText (id insertString)
248 {
249 OS.objc_msgSend(this.id_, OS.sel_insertText_1, insertString !is null ? insertString.id_ : null);
250 }
251
252 public NSColor insertionPointColor ()
253 {
254 objc.id result = OS.objc_msgSend(this.id_, OS.sel_insertionPointColor);
255 return result !is null ? new NSColor(result) : null;
256 }
257
258 public void invalidateTextContainerOrigin ()
259 {
260 OS.objc_msgSend(this.id_, OS.sel_invalidateTextContainerOrigin);
261 }
262
263 public bool isAutomaticLinkDetectionEnabled ()
264 {
265 return OS.objc_msgSend(this.id_, OS.sel_isAutomaticLinkDetectionEnabled) !is null;
266 }
267
268 public bool isAutomaticQuoteSubstitutionEnabled ()
269 {
270 return OS.objc_msgSend(this.id_, OS.sel_isAutomaticQuoteSubstitutionEnabled) !is null;
271 }
272
273 public bool isContinuousSpellCheckingEnabled ()
274 {
275 return OS.objc_msgSend(this.id_, OS.sel_isContinuousSpellCheckingEnabled) !is null;
276 }
277
278 public bool isEditable ()
279 {
280 return OS.objc_msgSend(this.id_, OS.sel_isEditable) !is null;
281 }
282
283 public bool isFieldEditor ()
284 {
285 return OS.objc_msgSend(this.id_, OS.sel_isFieldEditor) !is null;
286 }
287
288 public bool isGrammarCheckingEnabled ()
289 {
290 return OS.objc_msgSend(this.id_, OS.sel_isGrammarCheckingEnabled) !is null;
291 }
292
293 public bool isRichText ()
294 {
295 return OS.objc_msgSend(this.id_, OS.sel_isRichText) !is null;
296 }
297
298 public bool isRulerVisible ()
299 {
300 return OS.objc_msgSend(this.id_, OS.sel_isRulerVisible) !is null;
301 }
302
303 public bool isSelectable ()
304 {
305 return OS.objc_msgSend(this.id_, OS.sel_isSelectable) !is null;
306 }
307
308 public NSLayoutManager layoutManager ()
309 {
310 objc.id result = OS.objc_msgSend(this.id_, OS.sel_layoutManager);
311 return result !is null ? new NSLayoutManager(result) : null;
312 }
313
314 public NSDictionary linkTextAttributes ()
315 {
316 objc.id result = OS.objc_msgSend(this.id_, OS.sel_linkTextAttributes);
317 return result !is null ? new NSDictionary(result) : null;
318 }
319
320 public void loosenKerning (id sender)
321 {
322 OS.objc_msgSend(this.id_, OS.sel_loosenKerning_1, sender !is null ? sender.id_ : null);
323 }
324
325 public void lowerBaseline (id sender)
326 {
327 OS.objc_msgSend(this.id_, OS.sel_lowerBaseline_1, sender !is null ? sender.id_ : null);
328 }
329
330 public NSDictionary markedTextAttributes ()
331 {
332 objc.id result = OS.objc_msgSend(this.id_, OS.sel_markedTextAttributes);
333 return result !is null ? new NSDictionary(result) : null;
334 }
335
336 public void orderFrontLinkPanel (id sender)
337 {
338 OS.objc_msgSend(this.id_, OS.sel_orderFrontLinkPanel_1, sender !is null ? sender.id_ : null);
339 }
340
341 public void orderFrontListPanel (id sender)
342 {
343 OS.objc_msgSend(this.id_, OS.sel_orderFrontListPanel_1, sender !is null ? sender.id_ : null);
344 }
345
346 public void orderFrontSpacingPanel (id sender)
347 {
348 OS.objc_msgSend(this.id_, OS.sel_orderFrontSpacingPanel_1, sender !is null ? sender.id_ : null);
349 }
350
351 public void orderFrontTablePanel (id sender)
352 {
353 OS.objc_msgSend(this.id_, OS.sel_orderFrontTablePanel_1, sender !is null ? sender.id_ : null);
354 }
355
356 public void outline (id sender)
357 {
358 OS.objc_msgSend(this.id_, OS.sel_outline_1, sender !is null ? sender.id_ : null);
359 }
360
361 public void pasteAsPlainText (id sender)
362 {
363 OS.objc_msgSend(this.id_, OS.sel_pasteAsPlainText_1, sender !is null ? sender.id_ : null);
364 }
365
366 public void pasteAsRichText (id sender)
367 {
368 OS.objc_msgSend(this.id_, OS.sel_pasteAsRichText_1, sender !is null ? sender.id_ : null);
369 }
370
371 public void performFindPanelAction (id sender)
372 {
373 OS.objc_msgSend(this.id_, OS.sel_performFindPanelAction_1, sender !is null ? sender.id_ : null);
374 }
375
376 public NSString preferredPasteboardTypeFromArray (NSArray availableTypes, NSArray allowedTypes)
377 {
378 objc.id result = OS.objc_msgSend(this.id_, OS.sel_preferredPasteboardTypeFromArray_1restrictedToTypesFromArray_1,
379 availableTypes !is null ? availableTypes.id_ : null, allowedTypes !is null ? allowedTypes.id_ : null);
380 return result !is null ? new NSString(result) : null;
381 }
382
383 public void raiseBaseline (id sender)
384 {
385 OS.objc_msgSend(this.id_, OS.sel_raiseBaseline_1, sender !is null ? sender.id_ : null);
386 }
387
388 public NSRange rangeForUserCharacterAttributeChange ()
389 {
390 NSRange result;
391 OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeForUserCharacterAttributeChange);
392 return result;
393 }
394
395 public NSRange rangeForUserCompletion ()
396 {
397 NSRange result;
398 OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeForUserCompletion);
399 return result;
400 }
401
402 public NSRange rangeForUserParagraphAttributeChange ()
403 {
404 NSRange result;
405 OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeForUserParagraphAttributeChange);
406 return result;
407 }
408
409 public NSRange rangeForUserTextChange ()
410 {
411 NSRange result;
412 OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeForUserTextChange);
413 return result;
414 }
415
416 public NSArray rangesForUserCharacterAttributeChange ()
417 {
418 objc.id result = OS.objc_msgSend(this.id_, OS.sel_rangesForUserCharacterAttributeChange);
419 return result !is null ? new NSArray(result) : null;
420 }
421
422 public NSArray rangesForUserParagraphAttributeChange ()
423 {
424 objc.id result = OS.objc_msgSend(this.id_, OS.sel_rangesForUserParagraphAttributeChange);
425 return result !is null ? new NSArray(result) : null;
426 }
427
428 public NSArray rangesForUserTextChange ()
429 {
430 objc.id result = OS.objc_msgSend(this.id_, OS.sel_rangesForUserTextChange);
431 return result !is null ? new NSArray(result) : null;
432 }
433
434 public bool readSelectionFromPasteboard_ (NSPasteboard pboard)
435 {
436 return OS.objc_msgSend(this.id_, OS.sel_readSelectionFromPasteboard_1, pboard !is null ? pboard.id_ : null) !is null;
437 }
438
439 public bool readSelectionFromPasteboard_type_ (NSPasteboard pboard, NSString type)
440 {
441 return OS.objc_msgSend(this.id_, OS.sel_readSelectionFromPasteboard_1type_1, pboard !is null ? pboard.id_ : null,
442 type !is null ? type.id_ : null) !is null;
443 }
444
445 public NSArray readablePasteboardTypes ()
446 {
447 objc.id result = OS.objc_msgSend(this.id_, OS.sel_readablePasteboardTypes);
448 return result !is null ? new NSArray(result) : null;
449 }
450
451 public static void registerForServices ()
452 {
453 OS.objc_msgSend(OS.class_NSTextView, OS.sel_registerForServices);
454 }
455
456 public void replaceTextContainer (NSTextContainer newContainer)
457 {
458 OS.objc_msgSend(this.id_, OS.sel_replaceTextContainer_1, newContainer !is null ? newContainer.id_ : null);
459 }
460
461 public void rulerView_didAddMarker_ (NSRulerView ruler, NSRulerMarker marker)
462 {
463 OS.objc_msgSend(this.id_, OS.sel_rulerView_1didAddMarker_1, ruler !is null ? ruler.id_ : null, marker !is null ? marker.id_ : null);
464 }
465
466 public void rulerView_didMoveMarker_ (NSRulerView ruler, NSRulerMarker marker)
467 {
468 OS.objc_msgSend(this.id_, OS.sel_rulerView_1didMoveMarker_1, ruler !is null ? ruler.id_ : null, marker !is null ? marker.id_ : null);
469 }
470
471 public void rulerView_didRemoveMarker_ (NSRulerView ruler, NSRulerMarker marker)
472 {
473 OS.objc_msgSend(this.id_, OS.sel_rulerView_1didRemoveMarker_1, ruler !is null ? ruler.id_ : null, marker !is null ? marker.id_ : null);
474 }
475
476 public void rulerView_handleMouseDown_ (NSRulerView ruler, NSEvent event)
477 {
478 OS.objc_msgSend(this.id_, OS.sel_rulerView_1handleMouseDown_1, ruler !is null ? ruler.id_ : null, event !is null ? event.id_ : null);
479 }
480
481 public bool rulerView_shouldAddMarker_ (NSRulerView ruler, NSRulerMarker marker)
482 {
483 return OS.objc_msgSend(this.id_, OS.sel_rulerView_1shouldAddMarker_1, ruler !is null ? ruler.id_ : null, marker !is null ? marker.id_ : null) !is null;
484 }
485
486 public bool rulerView_shouldMoveMarker_ (NSRulerView ruler, NSRulerMarker marker)
487 {
488 return OS.objc_msgSend(this.id_, OS.sel_rulerView_1shouldMoveMarker_1, ruler !is null ? ruler.id_ : null, marker !is null ? marker.id_ : null) !is null;
489 }
490
491 public bool rulerView_shouldRemoveMarker_ (NSRulerView ruler, NSRulerMarker marker)
492 {
493 return OS.objc_msgSend(this.id_, OS.sel_rulerView_1shouldRemoveMarker_1, ruler !is null ? ruler.id_ : null, marker !is null ? marker.id_ : null) !is null;
494 }
495
496 public CGFloat rulerView_willAddMarker_atLocation_ (NSRulerView ruler, NSRulerMarker marker, CGFloat location)
497 {
498 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_rulerView_1willAddMarker_1atLocation_1, ruler !is null ? ruler.id_ : null,
499 marker !is null ? marker.id_ : null, location);
500 }
501
502 public CGFloat rulerView_willMoveMarker_toLocation_ (NSRulerView ruler, NSRulerMarker marker, CGFloat location)
503 {
504 return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_rulerView_1willMoveMarker_1toLocation_1, ruler !is null ? ruler.id_ : null,
505 marker !is null ? marker.id_ : null, location);
506 }
507
508 public NSArray selectedRanges ()
509 {
510 objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedRanges);
511 return result !is null ? new NSArray(result) : null;
512 }
513
514 public NSDictionary selectedTextAttributes ()
515 {
516 objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedTextAttributes);
517 return result !is null ? new NSDictionary(result) : null;
518 }
519
520 public NSSelectionAffinity selectionAffinity ()
521 {
522 return cast(NSSelectionAffinity) OS.objc_msgSend(this.id_, OS.sel_selectionAffinity);
523 }
524
525 public NSSelectionGranularity selectionGranularity ()
526 {
527 return cast(NSSelectionGranularity) OS.objc_msgSend(this.id_, OS.sel_selectionGranularity);
528 }
529
530 public NSRange selectionRangeForProposedRange (NSRange proposedCharRange, NSSelectionGranularity granularity)
531 {
532 NSRange result;
533 OS.objc_msgSend_stret(&result, this.id_, OS.sel_selectionRangeForProposedRange_1granularity_1, proposedCharRange, granularity);
534 return result;
535 }
536
537 public void setAcceptsGlyphInfo (bool flag)
538 {
539 OS.objc_msgSend(this.id_, OS.sel_setAcceptsGlyphInfo_1, flag);
540 }
541
542 public void setAlignment (NSTextAlignment alignment, NSRange range)
543 {
544 OS.objc_msgSend(this.id_, OS.sel_setAlignment_1range_1, alignment, range);
545 }
546
547 public void setAllowedInputSourceLocales (NSArray localeIdentifiers)
548 {
549 OS.objc_msgSend(this.id_, OS.sel_setAllowedInputSourceLocales_1, localeIdentifiers !is null ? localeIdentifiers.id_ : null);
550 }
551
552 public void setAllowsDocumentBackgroundColorChange (bool flag)
553 {
554 OS.objc_msgSend(this.id_, OS.sel_setAllowsDocumentBackgroundColorChange_1, flag);
555 }
556
557 public void setAllowsImageEditing (bool flag)
558 {
559 OS.objc_msgSend(this.id_, OS.sel_setAllowsImageEditing_1, flag);
560 }
561
562 public void setAllowsUndo (bool flag)
563 {
564 OS.objc_msgSend(this.id_, OS.sel_setAllowsUndo_1, flag);
565 }
566
567 public void setAutomaticLinkDetectionEnabled (bool flag)
568 {
569 OS.objc_msgSend(this.id_, OS.sel_setAutomaticLinkDetectionEnabled_1, flag);
570 }
571
572 public void setAutomaticQuoteSubstitutionEnabled (bool flag)
573 {
574 OS.objc_msgSend(this.id_, OS.sel_setAutomaticQuoteSubstitutionEnabled_1, flag);
575 }
576
577 public void setBackgroundColor (NSColor color)
578 {
579 OS.objc_msgSend(this.id_, OS.sel_setBackgroundColor_1, color !is null ? color.id_ : null);
580 }
581
582 public void setBaseWritingDirection (NSWritingDirection writingDirection, NSRange range)
583 {
584 OS.objc_msgSend(this.id_, OS.sel_setBaseWritingDirection_1range_1, writingDirection, range);
585 }
586
587 public void setConstrainedFrameSize (NSSize desiredSize)
588 {
589 OS.objc_msgSend(this.id_, OS.sel_setConstrainedFrameSize_1, desiredSize);
590 }
591
592 public void setContinuousSpellCheckingEnabled (bool flag)
593 {
594 OS.objc_msgSend(this.id_, OS.sel_setContinuousSpellCheckingEnabled_1, flag);
595 }
596
597 public void setDefaultParagraphStyle (NSParagraphStyle paragraphStyle)
598 {
599 OS.objc_msgSend(this.id_, OS.sel_setDefaultParagraphStyle_1, paragraphStyle !is null ? paragraphStyle.id_ : null);
600 }
601
602 public void setDelegate (id anObject)
603 {
604 OS.objc_msgSend(this.id_, OS.sel_setDelegate_1, anObject !is null ? anObject.id_ : null);
605 }
606
607 public void setDisplaysLinkToolTips (bool flag)
608 {
609 OS.objc_msgSend(this.id_, OS.sel_setDisplaysLinkToolTips_1, flag);
610 }
611
612 public void setDrawsBackground (bool flag)
613 {
614 OS.objc_msgSend(this.id_, OS.sel_setDrawsBackground_1, flag);
615 }
616
617 public void setEditable (bool flag)
618 {
619 OS.objc_msgSend(this.id_, OS.sel_setEditable_1, flag);
620 }
621
622 public void setFieldEditor (bool flag)
623 {
624 OS.objc_msgSend(this.id_, OS.sel_setFieldEditor_1, flag);
625 }
626
627 public void setGrammarCheckingEnabled (bool flag)
628 {
629 OS.objc_msgSend(this.id_, OS.sel_setGrammarCheckingEnabled_1, flag);
630 }
631
632 public void setImportsGraphics (bool flag)
633 {
634 OS.objc_msgSend(this.id_, OS.sel_setImportsGraphics_1, flag);
635 }
636
637 public void setInsertionPointColor (NSColor color)
638 {
639 OS.objc_msgSend(this.id_, OS.sel_setInsertionPointColor_1, color !is null ? color.id_ : null);
640 }
641
642 public void setLinkTextAttributes (NSDictionary attributeDictionary)
643 {
644 OS.objc_msgSend(this.id_, OS.sel_setLinkTextAttributes_1, attributeDictionary !is null ? attributeDictionary.id_ : null);
645 }
646
647 public void setMarkedTextAttributes (NSDictionary attributeDictionary)
648 {
649 OS.objc_msgSend(this.id_, OS.sel_setMarkedTextAttributes_1, attributeDictionary !is null ? attributeDictionary.id_ : null);
650 }
651
652 public void setNeedsDisplayInRect (NSRect rect, bool flag)
653 {
654 OS.objc_msgSend(this.id_, OS.sel_setNeedsDisplayInRect_1avoidAdditionalLayout_1, rect, flag);
655 }
656
657 public void setRichText (bool flag)
658 {
659 OS.objc_msgSend(this.id_, OS.sel_setRichText_1, flag);
660 }
661
662 public void setRulerVisible (bool flag)
663 {
664 OS.objc_msgSend(this.id_, OS.sel_setRulerVisible_1, flag);
665 }
666
667 public void setSelectable (bool flag)
668 {
669 OS.objc_msgSend(this.id_, OS.sel_setSelectable_1, flag);
670 }
671
672 public void setSelectedRange_ (NSRange charRange)
673 {
674 OS.objc_msgSend(this.id_, OS.sel_setSelectedRange_1, charRange);
675 }
676
677 public void setSelectedRange_affinity_stillSelecting_ (NSRange charRange, NSSelectionAffinity affinity, bool stillSelectingFlag)
678 {
679 OS.objc_msgSend(this.id_, OS.sel_setSelectedRange_1affinity_1stillSelecting_1, charRange, affinity, stillSelectingFlag);
680 }
681
682 public void setSelectedRanges_ (NSArray ranges)
683 {
684 OS.objc_msgSend(this.id_, OS.sel_setSelectedRanges_1, ranges !is null ? ranges.id_ : null);
685 }
686
687 public void setSelectedRanges_affinity_stillSelecting_ (NSArray ranges, NSSelectionAffinity affinity, bool stillSelectingFlag)
688 {
689 OS.objc_msgSend(this.id_, OS.sel_setSelectedRanges_1affinity_1stillSelecting_1, ranges !is null ? ranges.id_ : null, affinity,
690 stillSelectingFlag);
691 }
692
693 public void setSelectedTextAttributes (NSDictionary attributeDictionary)
694 {
695 OS.objc_msgSend(this.id_, OS.sel_setSelectedTextAttributes_1, attributeDictionary !is null ? attributeDictionary.id_ : null);
696 }
697
698 public void setSelectionGranularity (NSSelectionGranularity granularity)
699 {
700 OS.objc_msgSend(this.id_, OS.sel_setSelectionGranularity_1, granularity);
701 }
702
703 public void setSmartInsertDeleteEnabled (bool flag)
704 {
705 OS.objc_msgSend(this.id_, OS.sel_setSmartInsertDeleteEnabled_1, flag);
706 }
707
708 public void setSpellingState (NSInteger value, NSRange charRange)
709 {
710 OS.objc_msgSend(this.id_, OS.sel_setSpellingState_1range_1, value, charRange);
711 }
712
713 public void setTextContainer (NSTextContainer container)
714 {
715 OS.objc_msgSend(this.id_, OS.sel_setTextContainer_1, container !is null ? container.id_ : null);
716 }
717
718 public void setTextContainerInset (NSSize inset)
719 {
720 OS.objc_msgSend(this.id_, OS.sel_setTextContainerInset_1, inset);
721 }
722
723 public void setTypingAttributes (NSDictionary attrs)
724 {
725 OS.objc_msgSend(this.id_, OS.sel_setTypingAttributes_1, attrs !is null ? attrs.id_ : null);
726 }
727
728 public void setUsesFindPanel (bool flag)
729 {
730 OS.objc_msgSend(this.id_, OS.sel_setUsesFindPanel_1, flag);
731 }
732
733 public void setUsesFontPanel (bool flag)
734 {
735 OS.objc_msgSend(this.id_, OS.sel_setUsesFontPanel_1, flag);
736 }
737
738 public void setUsesRuler (bool flag)
739 {
740 OS.objc_msgSend(this.id_, OS.sel_setUsesRuler_1, flag);
741 }
742
743 public bool shouldChangeTextInRange (NSRange affectedCharRange, NSString replacementString)
744 {
745 return OS.objc_msgSend(this.id_, OS.sel_shouldChangeTextInRange_1replacementString_1, affectedCharRange,
746 replacementString !is null ? replacementString.id_ : null) !is null;
747 }
748
749 public bool shouldChangeTextInRanges (NSArray affectedRanges, NSArray replacementStrings)
750 {
751 return OS.objc_msgSend(this.id_, OS.sel_shouldChangeTextInRanges_1replacementStrings_1, affectedRanges !is null ? affectedRanges.id_ : null,
752 replacementStrings !is null ? replacementStrings.id_ : null) !is null;
753 }
754
755 public bool shouldDrawInsertionPoint ()
756 {
757 return OS.objc_msgSend(this.id_, OS.sel_shouldDrawInsertionPoint) !is null;
758 }
759
760 public void showFindIndicatorForRange (NSRange charRange)
761 {
762 OS.objc_msgSend(this.id_, OS.sel_showFindIndicatorForRange_1, charRange);
763 }
764
765 public NSRange smartDeleteRangeForProposedRange (NSRange proposedCharRange)
766 {
767 NSRange result;
768 OS.objc_msgSend_stret(&result, this.id_, OS.sel_smartDeleteRangeForProposedRange_1, proposedCharRange);
769 return result;
770 }
771
772 public NSString smartInsertAfterStringForString (NSString pasteString, NSRange charRangeToReplace)
773 {
774 objc.id result = OS.objc_msgSend(this.id_, OS.sel_smartInsertAfterStringForString_1replacingRange_1,
775 pasteString !is null ? pasteString.id_ : null, charRangeToReplace);
776 return result !is null ? new NSString(result) : null;
777 }
778
779 public NSString smartInsertBeforeStringForString (NSString pasteString, NSRange charRangeToReplace)
780 {
781 objc.id result = OS.objc_msgSend(this.id_, OS.sel_smartInsertBeforeStringForString_1replacingRange_1,
782 pasteString !is null ? pasteString.id_ : null, charRangeToReplace);
783 return result !is null ? new NSString(result) : null;
784 }
785
786 public bool smartInsertDeleteEnabled ()
787 {
788 return OS.objc_msgSend(this.id_, OS.sel_smartInsertDeleteEnabled) !is null;
789 }
790
791 public void smartInsertForString (NSString pasteString, NSRange charRangeToReplace, /*NSString** */objc.id** beforeString, /*NSString** */objc.id* afterString)
792 {
793 OS.objc_msgSend(this.id_, OS.sel_smartInsertForString_1replacingRange_1beforeString_1afterString_1,
794 pasteString !is null ? pasteString.id_ : null, charRangeToReplace, beforeString, afterString);
795 }
796
797 public NSInteger spellCheckerDocumentTag ()
798 {
799 return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_spellCheckerDocumentTag);
800 }
801
802 public void startSpeaking (id sender)
803 {
804 OS.objc_msgSend(this.id_, OS.sel_startSpeaking_1, sender !is null ? sender.id_ : null);
805 }
806
807 public void stopSpeaking (id sender)
808 {
809 OS.objc_msgSend(this.id_, OS.sel_stopSpeaking_1, sender !is null ? sender.id_ : null);
810 }
811
812 public NSTextContainer textContainer ()
813 {
814 objc.id result = OS.objc_msgSend(this.id_, OS.sel_textContainer);
815 return result !is null ? new NSTextContainer(result) : null;
816 }
817
818 public NSSize textContainerInset ()
819 {
820 NSSize result;
821 OS.objc_msgSend_stret(&result, this.id_, OS.sel_textContainerInset);
822 return result;
823 }
824
825 public NSPoint textContainerOrigin ()
826 {
827 NSPoint result;
828 OS.objc_msgSend_stret(&result, this.id_, OS.sel_textContainerOrigin);
829 return result;
830 }
831
832 public NSTextStorage textStorage ()
833 {
834 objc.id result = OS.objc_msgSend(this.id_, OS.sel_textStorage);
835 return result !is null ? new NSTextStorage(result) : null;
836 }
837
838 public void tightenKerning (id sender)
839 {
840 OS.objc_msgSend(this.id_, OS.sel_tightenKerning_1, sender !is null ? sender.id_ : null);
841 }
842
843 public void toggleAutomaticLinkDetection (id sender)
844 {
845 OS.objc_msgSend(this.id_, OS.sel_toggleAutomaticLinkDetection_1, sender !is null ? sender.id_ : null);
846 }
847
848 public void toggleAutomaticQuoteSubstitution (id sender)
849 {
850 OS.objc_msgSend(this.id_, OS.sel_toggleAutomaticQuoteSubstitution_1, sender !is null ? sender.id_ : null);
851 }
852
853 public void toggleBaseWritingDirection (id sender)
854 {
855 OS.objc_msgSend(this.id_, OS.sel_toggleBaseWritingDirection_1, sender !is null ? sender.id_ : null);
856 }
857
858 public void toggleContinuousSpellChecking (id sender)
859 {
860 OS.objc_msgSend(this.id_, OS.sel_toggleContinuousSpellChecking_1, sender !is null ? sender.id_ : null);
861 }
862
863 public void toggleGrammarChecking (id sender)
864 {
865 OS.objc_msgSend(this.id_, OS.sel_toggleGrammarChecking_1, sender !is null ? sender.id_ : null);
866 }
867
868 public void toggleSmartInsertDelete (id sender)
869 {
870 OS.objc_msgSend(this.id_, OS.sel_toggleSmartInsertDelete_1, sender !is null ? sender.id_ : null);
871 }
872
873 public void toggleTraditionalCharacterShape (id sender)
874 {
875 OS.objc_msgSend(this.id_, OS.sel_toggleTraditionalCharacterShape_1, sender !is null ? sender.id_ : null);
876 }
877
878 public void turnOffKerning (id sender)
879 {
880 OS.objc_msgSend(this.id_, OS.sel_turnOffKerning_1, sender !is null ? sender.id_ : null);
881 }
882
883 public void turnOffLigatures (id sender)
884 {
885 OS.objc_msgSend(this.id_, OS.sel_turnOffLigatures_1, sender !is null ? sender.id_ : null);
886 }
887
888 public NSDictionary typingAttributes ()
889 {
890 objc.id result = OS.objc_msgSend(this.id_, OS.sel_typingAttributes);
891 return result !is null ? new NSDictionary(result) : null;
892 }
893
894 public void updateDragTypeRegistration ()
895 {
896 OS.objc_msgSend(this.id_, OS.sel_updateDragTypeRegistration);
897 }
898
899 public void updateFontPanel ()
900 {
901 OS.objc_msgSend(this.id_, OS.sel_updateFontPanel);
902 }
903
904 public void updateInsertionPointStateAndRestartTimer (bool restartFlag)
905 {
906 OS.objc_msgSend(this.id_, OS.sel_updateInsertionPointStateAndRestartTimer_1, restartFlag);
907 }
908
909 public void updateRuler ()
910 {
911 OS.objc_msgSend(this.id_, OS.sel_updateRuler);
912 }
913
914 public void useAllLigatures (id sender)
915 {
916 OS.objc_msgSend(this.id_, OS.sel_useAllLigatures_1, sender !is null ? sender.id_ : null);
917 }
918
919 public void useStandardKerning (id sender)
920 {
921 OS.objc_msgSend(this.id_, OS.sel_useStandardKerning_1, sender !is null ? sender.id_ : null);
922 }
923
924 public void useStandardLigatures (id sender)
925 {
926 OS.objc_msgSend(this.id_, OS.sel_useStandardLigatures_1, sender !is null ? sender.id_ : null);
927 }
928
929 public bool usesFindPanel ()
930 {
931 return OS.objc_msgSend(this.id_, OS.sel_usesFindPanel) !is null;
932 }
933
934 public bool usesFontPanel ()
935 {
936 return OS.objc_msgSend(this.id_, OS.sel_usesFontPanel) !is null;
937 }
938
939 public bool usesRuler ()
940 {
941 return OS.objc_msgSend(this.id_, OS.sel_usesRuler) !is null;
942 }
943
944 public id validRequestorForSendType (NSString sendType, NSString returnType)
945 {
946 objc.id result = OS.objc_msgSend(this.id_, OS.sel_validRequestorForSendType_1returnType_1, sendType !is null ? sendType.id_ : null,
947 returnType !is null ? returnType.id_ : null);
948 return result !is null ? new id(result) : null;
949 }
950
951 public NSArray writablePasteboardTypes ()
952 {
953 objc.id result = OS.objc_msgSend(this.id_, OS.sel_writablePasteboardTypes);
954 return result !is null ? new NSArray(result) : null;
955 }
956
957 public bool writeSelectionToPasteboard_type_ (NSPasteboard pboard, NSString type)
958 {
959 return OS.objc_msgSend(this.id_, OS.sel_writeSelectionToPasteboard_1type_1, pboard !is null ? pboard.id_ : null, type !is null ? type.id_ : null) !is null;
960 }
961
962 public bool writeSelectionToPasteboard_types_ (NSPasteboard pboard, NSArray types)
963 {
964 return OS.objc_msgSend(this.id_, OS.sel_writeSelectionToPasteboard_1types_1, pboard !is null ? pboard.id_ : null,
965 types !is null ? types.id_ : null) !is null;
966 }
967 57
968 } 58 }