Package apple.uikit

Class NSTextLayoutManager

    • Constructor Detail

      • NSTextLayoutManager

        protected NSTextLayoutManager​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • addRenderingAttributeValueForTextRange

        public void addRenderingAttributeValueForTextRange​(@NotNull
                                                           @NotNull java.lang.String renderingAttribute,
                                                           @Nullable
                                                           @Nullable java.lang.Object value,
                                                           @NotNull
                                                           @NotNull NSTextRange textRange)
        Sets the rendering attribute. Passing nil value indicates overriding the specified attribute by removing from the final attributes passed to the layout and rendering engine. This is a convenience over -setRenderingAttributes:forTextRange:.
      • allocWithZone

        public static NSTextLayoutManager allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • baseWritingDirectionAtLocation

        public long baseWritingDirectionAtLocation​(@NotNull
                                                   @NotNull NSTextLocation location)
        Description copied from interface: NSTextSelectionDataSource
        Returns the base writing direction at location. It is recommended to return the resolved base direction either NSTextSelectionNavigationWritingDirectionLeftToRight or NSTextSelectionNavigationWritingDirectionRightToLeft.
        Specified by:
        baseWritingDirectionAtLocation in interface NSTextSelectionDataSource
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • ensureLayoutForBounds

        public void ensureLayoutForBounds​(CGRect bounds)
        Performs the layout for filling bounds inside the last text container.
      • ensureLayoutForRange

        public void ensureLayoutForRange​(@NotNull
                                         @NotNull NSTextRange range)
        Performs the layout for textRange.
      • enumerateTextLayoutFragmentsFromLocationOptionsUsingBlock

        @Nullable
        public @Nullable NSTextLocation enumerateTextLayoutFragmentsFromLocationOptionsUsingBlock​(@Nullable
                                                                                                  @Nullable NSTextLocation location,
                                                                                                  long options,
                                                                                                  @NotNull
                                                                                                  @NotNull NSTextLayoutManager.Block_enumerateTextLayoutFragmentsFromLocationOptionsUsingBlock block)
        Enumerates the text layout fragments starting at textLocation. If textLocation=nil, it assumes self.textContentManager.documentRange.location; uses self.documentRange.endLocation for reverse enumeration. When enumerating backward, it starts with the fragment preceding the one containing textLocation. If enumerated at least one fragment, it returns the edge of the enumerated range. Note that the enumerated range might not match the range of the last element returned. It enumerates the elements in the sequence, but it can skip a range (it can limit the maximum number of text elements enumerated for a single invocation or hide some elements from the layout). Returning NO from block breaks out of the enumeration.
      • enumerateTextSegmentsInRangeTypeOptionsUsingBlock

        public void enumerateTextSegmentsInRangeTypeOptionsUsingBlock​(@NotNull
                                                                      @NotNull NSTextRange textRange,
                                                                      long type,
                                                                      long options,
                                                                      @NotNull
                                                                      @NotNull NSTextLayoutManager.Block_enumerateTextSegmentsInRangeTypeOptionsUsingBlock block)
        Enumerates text segments of type in textRange. A text segment is both logically and visually contiguous portion of the text content inside a line fragment. It can be defined with a single text range. The segments are enumerated visually from left to right. Returning NO from block breaks out of the enumeration.
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • invalidateLayoutForRange

        public void invalidateLayoutForRange​(@NotNull
                                             @NotNull NSTextRange range)
        Invalidates layout information for textRange
      • invalidateRenderingAttributesForTextRange

        public void invalidateRenderingAttributesForTextRange​(@NotNull
                                                              @NotNull NSTextRange textRange)
        Invalidates the rendering attributes in textRange. Enumerating rendering attributes will skip the invalidated range.
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • layoutQueue

        @Nullable
        public @Nullable NSOperationQueue layoutQueue()
        If non-nil, it performs layout in the specified queue until estimatedUsageBounds=NO.
      • limitsLayoutForSuspiciousContents

        public boolean limitsLayoutForSuspiciousContents()
        When YES, enables internal security analysis for malicious inputs and activates defensive behaviors. By enabling this functionality, it's possible certain text such as a very long paragraph might result in unexpected layout. NO by default.
      • linkRenderingAttributes

        @NotNull
        public static @NotNull NSDictionary<java.lang.String,​?> linkRenderingAttributes()
        The default set of attributes for rendering NSLinkAttributeName. The base NSTextLayoutManager class returns with NSUnderlineStyleSingle for NSUnderlineStyleAttributeName and the platform link color for NSForegroundColorAttributeName. The platform color for macOS is +linkColor. Other platforms uses +blueColor.
      • locationFromLocationWithOffset

        @Nullable
        public @Nullable NSTextLocation locationFromLocationWithOffset​(@NotNull
                                                                       @NotNull NSTextLocation location,
                                                                       long offset)
        Description copied from interface: NSTextSelectionDataSource
        Returns a new location from location with offset. The offset value could be positive or negative indicating the logical direction. Could return nil when the inputs don't produce any legal location (i.e. out of bounds index).
        Specified by:
        locationFromLocationWithOffset in interface NSTextSelectionDataSource
      • removeRenderingAttributeForTextRange

        public void removeRenderingAttributeForTextRange​(@NotNull
                                                         @NotNull java.lang.String renderingAttribute,
                                                         @NotNull
                                                         @NotNull NSTextRange textRange)
        Removes attribute from textRange. This is a convenience over -setRenderingAttributes:forTextRange:.
      • renderingAttributesForLinkAtLocation

        @NotNull
        public @NotNull NSDictionary<java.lang.String,​?> renderingAttributesForLinkAtLocation​(@NotNull
                                                                                                    @NotNull java.lang.Object link,
                                                                                                    @NotNull
                                                                                                    @NotNull NSTextLocation location)
        Returns a dictionary of rendering attributes for rendering NSLinkAttributeName. Just as other rendering attributes, specifying NSNull removes the attribute from the final attributes used for rendering. It has priority over the general rendering attributes.
      • renderingAttributesValidator

        @Nullable
        public @Nullable NSTextLayoutManager.Block_renderingAttributesValidator_ret renderingAttributesValidator()
        A callback block invoked whenever NSTextLayoutManager needs to validate the rendering attributes for the range. The validator should use -setRenderingAttributes:forTextRange: to fill the rendering attributes appropriate for the range inside textLayoutFragment.
      • replaceContentsInRangeWithAttributedString

        public void replaceContentsInRangeWithAttributedString​(@NotNull
                                                               @NotNull NSTextRange range,
                                                               @NotNull
                                                               @NotNull NSAttributedString attributedString)
      • replaceContentsInRangeWithTextElements

        public void replaceContentsInRangeWithTextElements​(@NotNull
                                                           @NotNull NSTextRange range,
                                                           @NotNull
                                                           @NotNull NSArray<? extends NSTextElement> textElements)
      • replaceTextContentManager

        public void replaceTextContentManager​(@NotNull
                                              @NotNull NSTextContentManager textContentManager)
        This method should be used in order to replace an NSTextContentManager with a new one, leaving all related objects intact. This method makes sure the NSTextLayoutManager doesn't get deallocated while migrating to the new manager.
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setLayoutQueue

        public void setLayoutQueue​(@Nullable
                                   @Nullable NSOperationQueue value)
        If non-nil, it performs layout in the specified queue until estimatedUsageBounds=NO.
      • setLimitsLayoutForSuspiciousContents

        public void setLimitsLayoutForSuspiciousContents​(boolean value)
        When YES, enables internal security analysis for malicious inputs and activates defensive behaviors. By enabling this functionality, it's possible certain text such as a very long paragraph might result in unexpected layout. NO by default.
      • setRenderingAttributesForTextRange

        public void setRenderingAttributesForTextRange​(@NotNull
                                                       @NotNull NSDictionary<java.lang.String,​?> renderingAttributes,
                                                       @NotNull
                                                       @NotNull NSTextRange textRange)
        Sets the rendering attributes.
      • setRenderingAttributesValidator

        public void setRenderingAttributesValidator​(@Nullable
                                                    @Nullable NSTextLayoutManager.Block_setRenderingAttributesValidator value)
        A callback block invoked whenever NSTextLayoutManager needs to validate the rendering attributes for the range. The validator should use -setRenderingAttributes:forTextRange: to fill the rendering attributes appropriate for the range inside textLayoutFragment.
      • setTextContainer

        public void setTextContainer​(@Nullable
                                     @Nullable NSTextContainer value)
        The text container object providing geometric information for the layout destination. If isSimpleRectangularTextContainer=NO, NSTextLayoutManager always fill from the top instead of allowing non-contiguous layout support.
      • setTextSelectionNavigation

        public void setTextSelectionNavigation​(@NotNull
                                               @NotNull NSTextSelectionNavigation value)
        Returns an NSTextSelectionNavigation configured to have the text layout manager as NSTextSelectionDataSource
      • setTextSelections

        public void setTextSelections​(@NotNull
                                      @NotNull NSArray<? extends NSTextSelection> value)
        An array of NSTextSelections associated by the text layout manager. Each NSTextSelection represents an insertion point. The selection state is shared among all view ports connected to the text layout manager via text containers.
      • setUsesFontLeading

        public void setUsesFontLeading​(boolean value)
        If YES, uses the leading as specified by the font. However, this is not appropriate for most UI text. YES by default.
      • setUsesHyphenation

        public void setUsesHyphenation​(boolean value)
        When YES, NSTextLayoutManager will attempt to hyphenate when wrapping lines. May be overridden on a per-paragraph basis by the NSParagraphStyle's usesDefaultHyphenation. The receiver makes the best effort to decide the exact logic including the hyphenation factor based on the context. The default value is NO. Can be overridden by the preference key @"NSUsesDefaultHyphenation".
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • supportsSecureCoding

        public static boolean supportsSecureCoding()
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding
      • textContainer

        @Nullable
        public @Nullable NSTextContainer textContainer()
        The text container object providing geometric information for the layout destination. If isSimpleRectangularTextContainer=NO, NSTextLayoutManager always fill from the top instead of allowing non-contiguous layout support.
      • textContentManager

        @Nullable
        public @Nullable NSTextContentManager textContentManager()
        Pointing to the NSTextContentManager object strongly referencing the text layout manager.
      • textLayoutFragmentForLocation

        @Nullable
        public @Nullable NSTextLayoutFragment textLayoutFragmentForLocation​(@NotNull
                                                                            @NotNull NSTextLocation location)
        Returns the text layout fragment containing the document location, location.
      • textLayoutFragmentForPosition

        @Nullable
        public @Nullable NSTextLayoutFragment textLayoutFragmentForPosition​(CGPoint position)
        Returns the text layout fragment containing position inside the coordinate system for textContainer.
      • textSelectionNavigation

        @NotNull
        public @NotNull NSTextSelectionNavigation textSelectionNavigation()
        Returns an NSTextSelectionNavigation configured to have the text layout manager as NSTextSelectionDataSource
      • textSelections

        @NotNull
        public @NotNull NSArray<? extends NSTextSelection> textSelections()
        An array of NSTextSelections associated by the text layout manager. Each NSTextSelection represents an insertion point. The selection state is shared among all view ports connected to the text layout manager via text containers.
      • textViewportLayoutController

        @NotNull
        public @NotNull NSTextViewportLayoutController textViewportLayoutController()
        Returns NSTextViewportLayoutController associated with textContainer.
      • usageBoundsForTextContainer

        public CGRect usageBoundsForTextContainer()
        The usage bounds for textContainer. KVO-compliant. Views can observe this property in order to trigger a resize operation. For example, UIView/NSView should call setNeedsUpdateConstraints() when the usage bounds changes.
      • usesFontLeading

        public boolean usesFontLeading()
        If YES, uses the leading as specified by the font. However, this is not appropriate for most UI text. YES by default.
      • usesHyphenation

        public boolean usesHyphenation()
        When YES, NSTextLayoutManager will attempt to hyphenate when wrapping lines. May be overridden on a per-paragraph basis by the NSParagraphStyle's usesDefaultHyphenation. The receiver makes the best effort to decide the exact logic including the hyphenation factor based on the context. The default value is NO. Can be overridden by the preference key @"NSUsesDefaultHyphenation".
      • version_static

        public static long version_static()
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.