view dwt/internal/cocoa/NSTextView.d @ 1:8b48be5454ce

The internal cocoa classes compile now
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Tue, 19 Aug 2008 17:35:17 +0200
parents 380af2bdd8e5
children f565d3a95c0a
line wrap: on
line source

/*******************************************************************************
 * Copyright (c) 2007 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     
 * Port to the D Programming language:
 *     Jacob Carlborg <jacob.carlborg@gmail.com>
 *******************************************************************************/
module dwt.internal.cocoa.NSTextView;

import dwt.internal.cocoa.CGFloat;
import dwt.internal.cocoa.id;
import dwt.internal.cocoa.NSArray;
import dwt.internal.cocoa.NSColor;
import dwt.internal.cocoa.NSDictionary;
import dwt.internal.cocoa.NSDragOperation;
import dwt.internal.cocoa.NSEvent;
import dwt.internal.cocoa.NSImage;
import dwt.internal.cocoa.NSInteger;
import dwt.internal.cocoa.NSLayoutManager;
import dwt.internal.cocoa.NSParagraphStyle;
import dwt.internal.cocoa.NSPasteboard;
import dwt.internal.cocoa.NSPoint;
import dwt.internal.cocoa.NSRange;
import dwt.internal.cocoa.NSRect;
import dwt.internal.cocoa.NSRulerMarker;
import dwt.internal.cocoa.NSRulerView;
import dwt.internal.cocoa.NSSize;
import dwt.internal.cocoa.NSString;
import dwt.internal.cocoa.NSText;
import dwt.internal.cocoa.NSTextContainer;
import dwt.internal.cocoa.NSTextStorage;
import dwt.internal.cocoa.OS;
import objc = dwt.internal.objc.runtime;

enum NSSelectionAffinity
{
    NSSelectionAffinityUpstream = 0,
    NSSelectionAffinityDownstream = 1
}

alias NSSelectionAffinity.NSSelectionAffinityUpstream NSSelectionAffinityUpstream;
alias NSSelectionAffinity.NSSelectionAffinityDownstream NSSelectionAffinityDownstream;

enum NSSelectionGranularity
{
    NSSelectByCharacter = 0,
    NSSelectByWord = 1,
    NSSelectByParagraph = 2
}

alias NSSelectionGranularity.NSSelectByCharacter NSSelectByCharacter;
alias NSSelectionGranularity.NSSelectByWord NSSelectByWord;
alias NSSelectionGranularity.NSSelectByParagraph NSSelectByParagraph;

public class NSTextView : NSText
{

    public this ()
    {
        super();
    }

    public this (objc.id id)
    {
        super(id);
    }

    public NSArray acceptableDragTypes ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_acceptableDragTypes);
        return result !is null ? new NSArray(result) : null;
    }

    public bool acceptsGlyphInfo ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_acceptsGlyphInfo) !is null;
    }

    public void alignJustified (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_alignJustified_1, sender !is null ? sender.id_ : null);
    }

    public NSArray allowedInputSourceLocales ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_allowedInputSourceLocales);
        return result !is null ? new NSArray(result) : null;
    }

    public bool allowsDocumentBackgroundColorChange ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_allowsDocumentBackgroundColorChange) !is null;
    }

    public bool allowsImageEditing ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_allowsImageEditing) !is null;
    }

    public bool allowsUndo ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_allowsUndo) !is null;
    }

    public NSColor backgroundColor ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_backgroundColor);
        return result !is null ? new NSColor(result) : null;
    }

    public void breakUndoCoalescing ()
    {
        OS.objc_msgSend(this.id_, OS.sel_breakUndoCoalescing);
    }

    public void changeAttributes (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_changeAttributes_1, sender !is null ? sender.id_ : null);
    }

    public void changeColor (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_changeColor_1, sender !is null ? sender.id_ : null);
    }

    public void changeDocumentBackgroundColor (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_changeDocumentBackgroundColor_1, sender !is null ? sender.id_ : null);
    }

    public NSUInteger characterIndexForInsertionAtPoint (NSPoint point)
    {
        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_characterIndexForInsertionAtPoint_1, point);
    }

    public void cleanUpAfterDragOperation ()
    {
        OS.objc_msgSend(this.id_, OS.sel_cleanUpAfterDragOperation);
    }

    public void clickedOnLink (id link, NSUInteger charIndex)
    {
        OS.objc_msgSend(this.id_, OS.sel_clickedOnLink_1atIndex_1, link !is null ? link.id_ : null, charIndex);
    }

    public void complete (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_complete_1, sender !is null ? sender.id_ : null);
    }

    public NSArray completionsForPartialWordRange (NSRange charRange, NSInteger* index)
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_completionsForPartialWordRange_1indexOfSelectedItem_1, charRange, index);
        return result !is null ? new NSArray(result) : null;
    }

    public NSParagraphStyle defaultParagraphStyle ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_defaultParagraphStyle);
        return result !is null ? new NSParagraphStyle(result) : null;
    }

    public id delegatee ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_delegate);
        return result !is null ? new id(result) : null;
    }

    public void didChangeText ()
    {
        OS.objc_msgSend(this.id_, OS.sel_didChangeText);
    }

    public bool displaysLinkToolTips ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_displaysLinkToolTips) !is null;
    }

    public NSImage dragImageForSelectionWithEvent (NSEvent event, NSPointPointer origin)
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_dragImageForSelectionWithEvent_1origin_1, event !is null ? event.id_ : null, origin);
        return result !is null ? new NSImage(result) : null;
    }

    public NSDragOperation dragOperationForDraggingInfo (id dragInfo, NSString type)
    {
        return cast(NSDragOperation) OS.objc_msgSend(this.id_, OS.sel_dragOperationForDraggingInfo_1type_1, dragInfo !is null ? dragInfo.id_ : null,
                type !is null ? type.id_ : null);
    }

    public bool dragSelectionWithEvent (NSEvent event, NSSize mouseOffset, bool slideBack)
    {
        return OS.objc_msgSend(this.id_, OS.sel_dragSelectionWithEvent_1offset_1slideBack_1, event !is null ? event.id_ : null, mouseOffset, slideBack) !is null;
    }

    public void drawInsertionPointInRect (NSRect rect, NSColor color, bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_drawInsertionPointInRect_1color_1turnedOn_1, rect, color !is null ? color.id_ : null, flag);
    }

    public void drawViewBackgroundInRect (NSRect rect)
    {
        OS.objc_msgSend(this.id_, OS.sel_drawViewBackgroundInRect_1, rect);
    }

    public bool drawsBackground ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_drawsBackground) !is null;
    }

    public NSRect firstRectForCharacterRange (NSRange range)
    {
        NSRect result;
        OS.objc_msgSend_stret(&result, id_, OS.sel_firstRectForCharacterRange_1, range);
        return result;
    }

    public bool importsGraphics ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_importsGraphics) !is null;
    }

    public id initWithFrame_ (NSRect frameRect)
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithFrame_1, frameRect);
        return result !is null ? new id(result) : null;
    }

    public id initWithFrame_textContainer_ (NSRect frameRect, NSTextContainer container)
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_initWithFrame_1textContainer_1, frameRect, container !is null ? container.id_ : null);
        return result !is null ? new id(result) : null;
    }

    public void insertCompletion (NSString word, NSRange charRange, NSInteger movement, bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_insertCompletion_1forPartialWordRange_1movement_1isFinal_1, word !is null ? word.id_ : null, charRange,
                movement, flag);
    }

    public void insertText (id insertString)
    {
        OS.objc_msgSend(this.id_, OS.sel_insertText_1, insertString !is null ? insertString.id_ : null);
    }

    public NSColor insertionPointColor ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_insertionPointColor);
        return result !is null ? new NSColor(result) : null;
    }

    public void invalidateTextContainerOrigin ()
    {
        OS.objc_msgSend(this.id_, OS.sel_invalidateTextContainerOrigin);
    }

    public bool isAutomaticLinkDetectionEnabled ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_isAutomaticLinkDetectionEnabled) !is null;
    }

    public bool isAutomaticQuoteSubstitutionEnabled ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_isAutomaticQuoteSubstitutionEnabled) !is null;
    }

    public bool isContinuousSpellCheckingEnabled ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_isContinuousSpellCheckingEnabled) !is null;
    }

    public bool isEditable ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_isEditable) !is null;
    }

    public bool isFieldEditor ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_isFieldEditor) !is null;
    }

    public bool isGrammarCheckingEnabled ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_isGrammarCheckingEnabled) !is null;
    }

    public bool isRichText ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_isRichText) !is null;
    }

    public bool isRulerVisible ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_isRulerVisible) !is null;
    }

    public bool isSelectable ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_isSelectable) !is null;
    }

    public NSLayoutManager layoutManager ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_layoutManager);
        return result !is null ? new NSLayoutManager(result) : null;
    }

    public NSDictionary linkTextAttributes ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_linkTextAttributes);
        return result !is null ? new NSDictionary(result) : null;
    }

    public void loosenKerning (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_loosenKerning_1, sender !is null ? sender.id_ : null);
    }

    public void lowerBaseline (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_lowerBaseline_1, sender !is null ? sender.id_ : null);
    }

    public NSDictionary markedTextAttributes ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_markedTextAttributes);
        return result !is null ? new NSDictionary(result) : null;
    }

    public void orderFrontLinkPanel (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_orderFrontLinkPanel_1, sender !is null ? sender.id_ : null);
    }

    public void orderFrontListPanel (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_orderFrontListPanel_1, sender !is null ? sender.id_ : null);
    }

    public void orderFrontSpacingPanel (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_orderFrontSpacingPanel_1, sender !is null ? sender.id_ : null);
    }

    public void orderFrontTablePanel (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_orderFrontTablePanel_1, sender !is null ? sender.id_ : null);
    }

    public void outline (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_outline_1, sender !is null ? sender.id_ : null);
    }

    public void pasteAsPlainText (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_pasteAsPlainText_1, sender !is null ? sender.id_ : null);
    }

    public void pasteAsRichText (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_pasteAsRichText_1, sender !is null ? sender.id_ : null);
    }

    public void performFindPanelAction (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_performFindPanelAction_1, sender !is null ? sender.id_ : null);
    }

    public NSString preferredPasteboardTypeFromArray (NSArray availableTypes, NSArray allowedTypes)
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_preferredPasteboardTypeFromArray_1restrictedToTypesFromArray_1,
                availableTypes !is null ? availableTypes.id_ : null, allowedTypes !is null ? allowedTypes.id_ : null);
        return result !is null ? new NSString(result) : null;
    }

    public void raiseBaseline (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_raiseBaseline_1, sender !is null ? sender.id_ : null);
    }

    public NSRange rangeForUserCharacterAttributeChange ()
    {
        NSRange result;
        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeForUserCharacterAttributeChange);
        return result;
    }

    public NSRange rangeForUserCompletion ()
    {
        NSRange result;
        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeForUserCompletion);
        return result;
    }

    public NSRange rangeForUserParagraphAttributeChange ()
    {
        NSRange result;
        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeForUserParagraphAttributeChange);
        return result;
    }

    public NSRange rangeForUserTextChange ()
    {
        NSRange result;
        OS.objc_msgSend_stret(&result, this.id_, OS.sel_rangeForUserTextChange);
        return result;
    }

    public NSArray rangesForUserCharacterAttributeChange ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_rangesForUserCharacterAttributeChange);
        return result !is null ? new NSArray(result) : null;
    }

    public NSArray rangesForUserParagraphAttributeChange ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_rangesForUserParagraphAttributeChange);
        return result !is null ? new NSArray(result) : null;
    }

    public NSArray rangesForUserTextChange ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_rangesForUserTextChange);
        return result !is null ? new NSArray(result) : null;
    }

    public bool readSelectionFromPasteboard_ (NSPasteboard pboard)
    {
        return OS.objc_msgSend(this.id_, OS.sel_readSelectionFromPasteboard_1, pboard !is null ? pboard.id_ : null) !is null;
    }

    public bool readSelectionFromPasteboard_type_ (NSPasteboard pboard, NSString type)
    {
        return OS.objc_msgSend(this.id_, OS.sel_readSelectionFromPasteboard_1type_1, pboard !is null ? pboard.id_ : null,
                type !is null ? type.id_ : null) !is null;
    }

    public NSArray readablePasteboardTypes ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_readablePasteboardTypes);
        return result !is null ? new NSArray(result) : null;
    }

    public static void registerForServices ()
    {
        OS.objc_msgSend(OS.class_NSTextView, OS.sel_registerForServices);
    }

    public void replaceTextContainer (NSTextContainer newContainer)
    {
        OS.objc_msgSend(this.id_, OS.sel_replaceTextContainer_1, newContainer !is null ? newContainer.id_ : null);
    }

    public void rulerView_didAddMarker_ (NSRulerView ruler, NSRulerMarker marker)
    {
        OS.objc_msgSend(this.id_, OS.sel_rulerView_1didAddMarker_1, ruler !is null ? ruler.id_ : null, marker !is null ? marker.id_ : null);
    }

    public void rulerView_didMoveMarker_ (NSRulerView ruler, NSRulerMarker marker)
    {
        OS.objc_msgSend(this.id_, OS.sel_rulerView_1didMoveMarker_1, ruler !is null ? ruler.id_ : null, marker !is null ? marker.id_ : null);
    }

    public void rulerView_didRemoveMarker_ (NSRulerView ruler, NSRulerMarker marker)
    {
        OS.objc_msgSend(this.id_, OS.sel_rulerView_1didRemoveMarker_1, ruler !is null ? ruler.id_ : null, marker !is null ? marker.id_ : null);
    }

    public void rulerView_handleMouseDown_ (NSRulerView ruler, NSEvent event)
    {
        OS.objc_msgSend(this.id_, OS.sel_rulerView_1handleMouseDown_1, ruler !is null ? ruler.id_ : null, event !is null ? event.id_ : null);
    }

    public bool rulerView_shouldAddMarker_ (NSRulerView ruler, NSRulerMarker marker)
    {
        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;
    }

    public bool rulerView_shouldMoveMarker_ (NSRulerView ruler, NSRulerMarker marker)
    {
        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;
    }

    public bool rulerView_shouldRemoveMarker_ (NSRulerView ruler, NSRulerMarker marker)
    {
        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;
    }

    public CGFloat rulerView_willAddMarker_atLocation_ (NSRulerView ruler, NSRulerMarker marker, CGFloat location)
    {
        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_rulerView_1willAddMarker_1atLocation_1, ruler !is null ? ruler.id_ : null,
                marker !is null ? marker.id_ : null, location);
    }

    public CGFloat rulerView_willMoveMarker_toLocation_ (NSRulerView ruler, NSRulerMarker marker, CGFloat location)
    {
        return cast(CGFloat) OS.objc_msgSend_fpret(this.id_, OS.sel_rulerView_1willMoveMarker_1toLocation_1, ruler !is null ? ruler.id_ : null,
                marker !is null ? marker.id_ : null, location);
    }

    public NSArray selectedRanges ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedRanges);
        return result !is null ? new NSArray(result) : null;
    }

    public NSDictionary selectedTextAttributes ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_selectedTextAttributes);
        return result !is null ? new NSDictionary(result) : null;
    }

    public NSSelectionAffinity selectionAffinity ()
    {
        return cast(NSSelectionAffinity) OS.objc_msgSend(this.id_, OS.sel_selectionAffinity);
    }

    public NSSelectionGranularity selectionGranularity ()
    {
        return cast(NSSelectionGranularity) OS.objc_msgSend(this.id_, OS.sel_selectionGranularity);
    }

    public NSRange selectionRangeForProposedRange (NSRange proposedCharRange, NSSelectionGranularity granularity)
    {
        NSRange result;
        OS.objc_msgSend_stret(&result, this.id_, OS.sel_selectionRangeForProposedRange_1granularity_1, proposedCharRange, granularity);
        return result;
    }

    public void setAcceptsGlyphInfo (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAcceptsGlyphInfo_1, flag);
    }

    public void setAlignment (NSTextAlignment alignment, NSRange range)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAlignment_1range_1, alignment, range);
    }

    public void setAllowedInputSourceLocales (NSArray localeIdentifiers)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAllowedInputSourceLocales_1, localeIdentifiers !is null ? localeIdentifiers.id_ : null);
    }

    public void setAllowsDocumentBackgroundColorChange (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAllowsDocumentBackgroundColorChange_1, flag);
    }

    public void setAllowsImageEditing (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAllowsImageEditing_1, flag);
    }

    public void setAllowsUndo (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAllowsUndo_1, flag);
    }

    public void setAutomaticLinkDetectionEnabled (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAutomaticLinkDetectionEnabled_1, flag);
    }

    public void setAutomaticQuoteSubstitutionEnabled (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAutomaticQuoteSubstitutionEnabled_1, flag);
    }

    public void setBackgroundColor (NSColor color)
    {
        OS.objc_msgSend(this.id_, OS.sel_setBackgroundColor_1, color !is null ? color.id_ : null);
    }

    public void setBaseWritingDirection (NSWritingDirection writingDirection, NSRange range)
    {
        OS.objc_msgSend(this.id_, OS.sel_setBaseWritingDirection_1range_1, writingDirection, range);
    }

    public void setConstrainedFrameSize (NSSize desiredSize)
    {
        OS.objc_msgSend(this.id_, OS.sel_setConstrainedFrameSize_1, desiredSize);
    }

    public void setContinuousSpellCheckingEnabled (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setContinuousSpellCheckingEnabled_1, flag);
    }

    public void setDefaultParagraphStyle (NSParagraphStyle paragraphStyle)
    {
        OS.objc_msgSend(this.id_, OS.sel_setDefaultParagraphStyle_1, paragraphStyle !is null ? paragraphStyle.id_ : null);
    }

    public void setDelegate (id anObject)
    {
        OS.objc_msgSend(this.id_, OS.sel_setDelegate_1, anObject !is null ? anObject.id_ : null);
    }

    public void setDisplaysLinkToolTips (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setDisplaysLinkToolTips_1, flag);
    }

    public void setDrawsBackground (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setDrawsBackground_1, flag);
    }

    public void setEditable (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setEditable_1, flag);
    }

    public void setFieldEditor (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setFieldEditor_1, flag);
    }

    public void setGrammarCheckingEnabled (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setGrammarCheckingEnabled_1, flag);
    }

    public void setImportsGraphics (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setImportsGraphics_1, flag);
    }

    public void setInsertionPointColor (NSColor color)
    {
        OS.objc_msgSend(this.id_, OS.sel_setInsertionPointColor_1, color !is null ? color.id_ : null);
    }

    public void setLinkTextAttributes (NSDictionary attributeDictionary)
    {
        OS.objc_msgSend(this.id_, OS.sel_setLinkTextAttributes_1, attributeDictionary !is null ? attributeDictionary.id_ : null);
    }

    public void setMarkedTextAttributes (NSDictionary attributeDictionary)
    {
        OS.objc_msgSend(this.id_, OS.sel_setMarkedTextAttributes_1, attributeDictionary !is null ? attributeDictionary.id_ : null);
    }

    public void setNeedsDisplayInRect (NSRect rect, bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setNeedsDisplayInRect_1avoidAdditionalLayout_1, rect, flag);
    }

    public void setRichText (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setRichText_1, flag);
    }

    public void setRulerVisible (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setRulerVisible_1, flag);
    }

    public void setSelectable (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setSelectable_1, flag);
    }

    public void setSelectedRange_ (NSRange charRange)
    {
        OS.objc_msgSend(this.id_, OS.sel_setSelectedRange_1, charRange);
    }

    public void setSelectedRange_affinity_stillSelecting_ (NSRange charRange, NSSelectionAffinity affinity, bool stillSelectingFlag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setSelectedRange_1affinity_1stillSelecting_1, charRange, affinity, stillSelectingFlag);
    }

    public void setSelectedRanges_ (NSArray ranges)
    {
        OS.objc_msgSend(this.id_, OS.sel_setSelectedRanges_1, ranges !is null ? ranges.id_ : null);
    }

    public void setSelectedRanges_affinity_stillSelecting_ (NSArray ranges, NSSelectionAffinity affinity, bool stillSelectingFlag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setSelectedRanges_1affinity_1stillSelecting_1, ranges !is null ? ranges.id_ : null, affinity,
                stillSelectingFlag);
    }

    public void setSelectedTextAttributes (NSDictionary attributeDictionary)
    {
        OS.objc_msgSend(this.id_, OS.sel_setSelectedTextAttributes_1, attributeDictionary !is null ? attributeDictionary.id_ : null);
    }

    public void setSelectionGranularity (NSSelectionGranularity granularity)
    {
        OS.objc_msgSend(this.id_, OS.sel_setSelectionGranularity_1, granularity);
    }

    public void setSmartInsertDeleteEnabled (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setSmartInsertDeleteEnabled_1, flag);
    }

    public void setSpellingState (NSInteger value, NSRange charRange)
    {
        OS.objc_msgSend(this.id_, OS.sel_setSpellingState_1range_1, value, charRange);
    }

    public void setTextContainer (NSTextContainer container)
    {
        OS.objc_msgSend(this.id_, OS.sel_setTextContainer_1, container !is null ? container.id_ : null);
    }

    public void setTextContainerInset (NSSize inset)
    {
        OS.objc_msgSend(this.id_, OS.sel_setTextContainerInset_1, inset);
    }

    public void setTypingAttributes (NSDictionary attrs)
    {
        OS.objc_msgSend(this.id_, OS.sel_setTypingAttributes_1, attrs !is null ? attrs.id_ : null);
    }

    public void setUsesFindPanel (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setUsesFindPanel_1, flag);
    }

    public void setUsesFontPanel (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setUsesFontPanel_1, flag);
    }

    public void setUsesRuler (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setUsesRuler_1, flag);
    }

    public bool shouldChangeTextInRange (NSRange affectedCharRange, NSString replacementString)
    {
        return OS.objc_msgSend(this.id_, OS.sel_shouldChangeTextInRange_1replacementString_1, affectedCharRange,
                replacementString !is null ? replacementString.id_ : null) !is null;
    }

    public bool shouldChangeTextInRanges (NSArray affectedRanges, NSArray replacementStrings)
    {
        return OS.objc_msgSend(this.id_, OS.sel_shouldChangeTextInRanges_1replacementStrings_1, affectedRanges !is null ? affectedRanges.id_ : null,
                replacementStrings !is null ? replacementStrings.id_ : null) !is null;
    }

    public bool shouldDrawInsertionPoint ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_shouldDrawInsertionPoint) !is null;
    }

    public void showFindIndicatorForRange (NSRange charRange)
    {
        OS.objc_msgSend(this.id_, OS.sel_showFindIndicatorForRange_1, charRange);
    }

    public NSRange smartDeleteRangeForProposedRange (NSRange proposedCharRange)
    {
        NSRange result;
        OS.objc_msgSend_stret(&result, this.id_, OS.sel_smartDeleteRangeForProposedRange_1, proposedCharRange);
        return result;
    }

    public NSString smartInsertAfterStringForString (NSString pasteString, NSRange charRangeToReplace)
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_smartInsertAfterStringForString_1replacingRange_1,
                pasteString !is null ? pasteString.id_ : null, charRangeToReplace);
        return result !is null ? new NSString(result) : null;
    }

    public NSString smartInsertBeforeStringForString (NSString pasteString, NSRange charRangeToReplace)
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_smartInsertBeforeStringForString_1replacingRange_1,
                pasteString !is null ? pasteString.id_ : null, charRangeToReplace);
        return result !is null ? new NSString(result) : null;
    }

    public bool smartInsertDeleteEnabled ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_smartInsertDeleteEnabled) !is null;
    }

    public void smartInsertForString (NSString pasteString, NSRange charRangeToReplace, /*NSString** */objc.id** beforeString, /*NSString** */objc.id* afterString)
    {
        OS.objc_msgSend(this.id_, OS.sel_smartInsertForString_1replacingRange_1beforeString_1afterString_1,
                pasteString !is null ? pasteString.id_ : null, charRangeToReplace, beforeString, afterString);
    }

    public NSInteger spellCheckerDocumentTag ()
    {
        return cast(NSInteger) OS.objc_msgSend(this.id_, OS.sel_spellCheckerDocumentTag);
    }

    public void startSpeaking (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_startSpeaking_1, sender !is null ? sender.id_ : null);
    }

    public void stopSpeaking (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_stopSpeaking_1, sender !is null ? sender.id_ : null);
    }

    public NSTextContainer textContainer ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_textContainer);
        return result !is null ? new NSTextContainer(result) : null;
    }

    public NSSize textContainerInset ()
    {
        NSSize result;
        OS.objc_msgSend_stret(&result, this.id_, OS.sel_textContainerInset);
        return result;
    }

    public NSPoint textContainerOrigin ()
    {
        NSPoint result;
        OS.objc_msgSend_stret(&result, this.id_, OS.sel_textContainerOrigin);
        return result;
    }

    public NSTextStorage textStorage ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_textStorage);
        return result !is null ? new NSTextStorage(result) : null;
    }

    public void tightenKerning (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_tightenKerning_1, sender !is null ? sender.id_ : null);
    }

    public void toggleAutomaticLinkDetection (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_toggleAutomaticLinkDetection_1, sender !is null ? sender.id_ : null);
    }

    public void toggleAutomaticQuoteSubstitution (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_toggleAutomaticQuoteSubstitution_1, sender !is null ? sender.id_ : null);
    }

    public void toggleBaseWritingDirection (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_toggleBaseWritingDirection_1, sender !is null ? sender.id_ : null);
    }

    public void toggleContinuousSpellChecking (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_toggleContinuousSpellChecking_1, sender !is null ? sender.id_ : null);
    }

    public void toggleGrammarChecking (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_toggleGrammarChecking_1, sender !is null ? sender.id_ : null);
    }

    public void toggleSmartInsertDelete (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_toggleSmartInsertDelete_1, sender !is null ? sender.id_ : null);
    }

    public void toggleTraditionalCharacterShape (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_toggleTraditionalCharacterShape_1, sender !is null ? sender.id_ : null);
    }

    public void turnOffKerning (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_turnOffKerning_1, sender !is null ? sender.id_ : null);
    }

    public void turnOffLigatures (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_turnOffLigatures_1, sender !is null ? sender.id_ : null);
    }

    public NSDictionary typingAttributes ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_typingAttributes);
        return result !is null ? new NSDictionary(result) : null;
    }

    public void updateDragTypeRegistration ()
    {
        OS.objc_msgSend(this.id_, OS.sel_updateDragTypeRegistration);
    }

    public void updateFontPanel ()
    {
        OS.objc_msgSend(this.id_, OS.sel_updateFontPanel);
    }

    public void updateInsertionPointStateAndRestartTimer (bool restartFlag)
    {
        OS.objc_msgSend(this.id_, OS.sel_updateInsertionPointStateAndRestartTimer_1, restartFlag);
    }

    public void updateRuler ()
    {
        OS.objc_msgSend(this.id_, OS.sel_updateRuler);
    }

    public void useAllLigatures (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_useAllLigatures_1, sender !is null ? sender.id_ : null);
    }

    public void useStandardKerning (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_useStandardKerning_1, sender !is null ? sender.id_ : null);
    }

    public void useStandardLigatures (id sender)
    {
        OS.objc_msgSend(this.id_, OS.sel_useStandardLigatures_1, sender !is null ? sender.id_ : null);
    }

    public bool usesFindPanel ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_usesFindPanel) !is null;
    }

    public bool usesFontPanel ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_usesFontPanel) !is null;
    }

    public bool usesRuler ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_usesRuler) !is null;
    }

    public id validRequestorForSendType (NSString sendType, NSString returnType)
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_validRequestorForSendType_1returnType_1, sendType !is null ? sendType.id_ : null,
                returnType !is null ? returnType.id_ : null);
        return result !is null ? new id(result) : null;
    }

    public NSArray writablePasteboardTypes ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_writablePasteboardTypes);
        return result !is null ? new NSArray(result) : null;
    }

    public bool writeSelectionToPasteboard_type_ (NSPasteboard pboard, NSString type)
    {
        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;
    }

    public bool writeSelectionToPasteboard_types_ (NSPasteboard pboard, NSArray types)
    {
        return OS.objc_msgSend(this.id_, OS.sel_writeSelectionToPasteboard_1types_1, pboard !is null ? pboard.id_ : null,
                types !is null ? types.id_ : null) !is null;
    }

}