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