Package apple.uikit

Class NSLayoutManager

    • Constructor Detail

      • NSLayoutManager

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

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

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

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

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

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

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

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

        public static java.lang.String description_static()
      • 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)
      • isSubclassOfClass

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

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

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

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

        public static void setVersion_static​(long aVersion)
      • superclass_static

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

        public static long version_static()
      • CGGlyphAtIndex

        public char CGGlyphAtIndex​(long glyphIndex)
      • CGGlyphAtIndexIsValidIndex

        public char CGGlyphAtIndexIsValidIndex​(long glyphIndex,
                                               org.moe.natj.general.ptr.BoolPtr isValidIndex)
        If non-contiguous layout is not enabled, these will cause generation of all glyphs up to and including glyphIndex. The first CGGlyphAtIndex variant returns kCGFontIndexInvalid if the requested index is out of the range (0, numberOfGlyphs), and optionally returns a flag indicating whether the requested index is in range. The second CGGlyphAtIndex variant raises a NSRangeError if the requested index is out of range.
      • addTextContainer

        public void addTextContainer​(NSTextContainer container)
        Add a container to the end of the array. Must invalidate layout of all glyphs after the previous last container (i.e., glyphs that were not previously laid out because they would not fit anywhere).
      • allowsNonContiguousLayout

        public boolean allowsNonContiguousLayout()
        If YES, then the layout manager may perform glyph generation and layout for a given portion of the text, without having glyphs or layout for preceding portions. The default is NO. Turning this setting on will significantly alter which portions of the text will have glyph generation or layout performed when a given generation-causing method is invoked. It also gives significant performance benefits, especially for large documents.
      • attachmentSizeForGlyphAtIndex

        public CGSize attachmentSizeForGlyphAtIndex​(long glyphIndex)
        For a glyph corresponding to an attachment, this method returns the size the attachment cell will occupy. Returns {-1,-1} if no attachment size has been set for the specified glyph.
      • boundingRectForGlyphRangeInTextContainer

        public CGRect boundingRectForGlyphRangeInTextContainer​(NSRange glyphRange,
                                                               NSTextContainer container)
        Returns the smallest bounding rect which completely encloses the glyphs in the given glyphRange that are in the given container. The range is intersected with the container's range before computing the bounding rect. This method can be used to translate glyph ranges into display rectangles for invalidation. Bounding rects are always in container coordinates.
      • characterIndexForGlyphAtIndex

        public long characterIndexForGlyphAtIndex​(long glyphIndex)
        If non-contiguous layout is not enabled, this will cause generation of all glyphs up to and including glyphIndex. It will return the character index for the first character associated with the glyph at the specified index.
      • characterIndexForPointInTextContainerFractionOfDistanceBetweenInsertionPoints

        public long characterIndexForPointInTextContainerFractionOfDistanceBetweenInsertionPoints​(CGPoint point,
                                                                                                  NSTextContainer container,
                                                                                                  org.moe.natj.general.ptr.NFloatPtr partialFraction)
        Returns the index of the character falling under the given point, expressed in the given container's coordinate system. If no character is under the point, the nearest character is returned, where nearest is defined according to the requirements of selection by touch or mouse. This is not simply equivalent to taking the result of the corresponding glyph index method and converting it to a character index, because in some cases a single glyph represents more than one selectable character, for example an fi ligature glyph. In that case, there will be an insertion point within the glyph, and this method will return one character or the other, depending on whether the specified point lies to the left or the right of that insertion point. In general, this method will return only character indexes for which there is an insertion point (see next method). The partial fraction is a fraction of the distance from the insertion point logically before the given character to the next one, which may be either to the right or to the left depending on directionality.
      • characterRangeForGlyphRangeActualGlyphRange

        public NSRange characterRangeForGlyphRangeActualGlyphRange​(NSRange glyphRange,
                                                                   NSRange actualGlyphRange)
        Returns the range of characters that generated the glyphs in the given glyphRange. If actualGlyphRange is not NULL, it will return by reference the full range of glyphs generated by the character range returned. This range may be identical or slightly larger than the requested glyph range. For example, if the text storage contains the character (o-umlaut) and the glyph store contains the two atomic glyphs "o" and (umlaut), and if the glyph range given encloses only the first or second glyph, then actualGlyphRange will be set to enclose both glyphs. If the length of glyphRange is zero, the resulting character range will be a zero-length range just after the character(s) corresponding to the preceding glyph, and actualGlyphRange will also be zero-length. If non-contiguous layout is not enabled, this will force the generation of glyphs for all characters up to and including the end of the returned range.
      • drawBackgroundForGlyphRangeAtPoint

        public void drawBackgroundForGlyphRangeAtPoint​(NSRange glyphsToShow,
                                                       CGPoint origin)
        Drawing support *********************** These methods are primitives for drawing. You can override these to perform additional drawing, or to replace text drawing entirely, but not to change layout. You can call them if you want, but focus must already be locked on the destination view or image. -drawBackgroundForGlyphRange:atPoint: draws the background color and selection and marked range aspects of the text display, along with block decoration such as table backgrounds and borders. -drawGlyphsForGlyphRange:atPoint: draws the actual glyphs, including attachments, as well as any underlines or strikethroughs. In either case all of the specified glyphs must lie in a single container.
      • drawGlyphsForGlyphRangeAtPoint

        public void drawGlyphsForGlyphRangeAtPoint​(NSRange glyphsToShow,
                                                   CGPoint origin)
      • drawStrikethroughForGlyphRangeStrikethroughTypeBaselineOffsetLineFragmentRectLineFragmentGlyphRangeContainerOrigin

        public void drawStrikethroughForGlyphRangeStrikethroughTypeBaselineOffsetLineFragmentRectLineFragmentGlyphRangeContainerOrigin​(NSRange glyphRange,
                                                                                                                                       long strikethroughVal,
                                                                                                                                       double baselineOffset,
                                                                                                                                       CGRect lineRect,
                                                                                                                                       NSRange lineGlyphRange,
                                                                                                                                       CGPoint containerOrigin)
        These two methods parallel the two corresponding underline methods, but draw strikethroughs instead of underlines.
      • drawUnderlineForGlyphRangeUnderlineTypeBaselineOffsetLineFragmentRectLineFragmentGlyphRangeContainerOrigin

        public void drawUnderlineForGlyphRangeUnderlineTypeBaselineOffsetLineFragmentRectLineFragmentGlyphRangeContainerOrigin​(NSRange glyphRange,
                                                                                                                               long underlineVal,
                                                                                                                               double baselineOffset,
                                                                                                                               CGRect lineRect,
                                                                                                                               NSRange lineGlyphRange,
                                                                                                                               CGPoint containerOrigin)
        The first of these methods actually draws an appropriate underline for the glyph range given. The second method potentially breaks the range it is given up into subranges and calls drawUnderline... for ranges that should actually have the underline drawn. As examples of why there are two methods, consider two situations. First, in all cases you don't want to underline the leading and trailing whitespace on a line. The -underlineGlyphRange... method is passed glyph ranges that have underlining turned on, but it will then look for this leading and trailing white space and only pass the ranges that should actually be underlined to -drawUnderline... Second, if the underlineType: indicates that only words, (i.e., no whitespace), should be underlined, then -underlineGlyphRange... will carve the range it is passed up into words and only pass word ranges to -drawUnderline.
      • drawsOutsideLineFragmentForGlyphAtIndex

        public boolean drawsOutsideLineFragmentForGlyphAtIndex​(long glyphIndex)
        Returns whether the glyph will draw outside of its line fragment rect. This will cause glyph generation and layout for the line fragment containing the specified glyph, or if non-contiguous layout is not enabled, up to and including that line fragment.
      • ensureGlyphsForCharacterRange

        public void ensureGlyphsForCharacterRange​(NSRange charRange)
        These methods allow clients to specify exactly the portions of the document for which they wish to have glyphs or layout. This is particularly important if non-contiguous layout is enabled. The layout manager still reserves the right to perform glyph generation or layout for larger ranges. If non-contiguous layout is not enabled, then the range in question will always effectively be extended to start at the beginning of the text.
      • ensureGlyphsForGlyphRange

        public void ensureGlyphsForGlyphRange​(NSRange glyphRange)
      • ensureLayoutForBoundingRectInTextContainer

        public void ensureLayoutForBoundingRectInTextContainer​(CGRect bounds,
                                                               NSTextContainer container)
      • ensureLayoutForCharacterRange

        public void ensureLayoutForCharacterRange​(NSRange charRange)
      • ensureLayoutForGlyphRange

        public void ensureLayoutForGlyphRange​(NSRange glyphRange)
      • ensureLayoutForTextContainer

        public void ensureLayoutForTextContainer​(NSTextContainer container)
      • enumerateEnclosingRectsForGlyphRangeWithinSelectedGlyphRangeInTextContainerUsingBlock

        public void enumerateEnclosingRectsForGlyphRangeWithinSelectedGlyphRangeInTextContainerUsingBlock​(NSRange glyphRange,
                                                                                                          NSRange selectedRange,
                                                                                                          NSTextContainer textContainer,
                                                                                                          NSLayoutManager.Block_enumerateEnclosingRectsForGlyphRangeWithinSelectedGlyphRangeInTextContainerUsingBlock block)
        Enumerates enclosing rects for glyphRange in textContainer. If a selected range is given in the second argument, the rectangles returned will be correct for drawing the selection. Selection rectangles are generally more complicated than enclosing rectangles and supplying a selected range is the clue these methods use to determine whether to go to the trouble of doing this special work. If the caller is interested in this more from an enclosing point of view rather than a selection point of view, pass {NSNotFound, 0} as the selected range. This method will do the minimum amount of work required to answer the question.
      • extraLineFragmentRect

        public CGRect extraLineFragmentRect()
        Return info about the extra line fragment. The extra line fragment is used for displaying the line at the end of document when the last character in the document causes a line or paragraph break. Since the extra line is not associated with any glyph inside the layout manager, the information is handed separately from other line fragment rects. Typically the extra line fragment is placed in the last document content text container along with other normal line fragment rects. Line fragment rects and line fragment used rects are always in container coordinates.
      • extraLineFragmentTextContainer

        public NSTextContainer extraLineFragmentTextContainer()
      • extraLineFragmentUsedRect

        public CGRect extraLineFragmentUsedRect()
      • fillBackgroundRectArrayCountForCharacterRangeColor

        public void fillBackgroundRectArrayCountForCharacterRangeColor​(org.moe.natj.general.ptr.ConstPtr<CGRect> rectArray,
                                                                       long rectCount,
                                                                       NSRange charRange,
                                                                       UIColor color)
        This is the primitive used by -drawBackgroundForGlyphRange:atPoint: for actually filling rects with a particular background color, whether due to a background color attribute, a selected or marked range highlight, a block decoration, or any other rect fill needed by that method. As with -showCGGlyphs:..., the character range and color are merely for informational purposes; the color will already be set in the graphics state. If for any reason you modify it, you must restore it before returning from this method. You should never call this method, but you might override it. The default implementation will simply fill the specified rect array.
      • firstUnlaidCharacterIndex

        public long firstUnlaidCharacterIndex()
      • firstUnlaidGlyphIndex

        public long firstUnlaidGlyphIndex()
      • fractionOfDistanceThroughGlyphForPointInTextContainer

        public double fractionOfDistanceThroughGlyphForPointInTextContainer​(CGPoint point,
                                                                            NSTextContainer container)
      • getFirstUnlaidCharacterIndexGlyphIndex

        public void getFirstUnlaidCharacterIndexGlyphIndex​(org.moe.natj.general.ptr.NUIntPtr charIndex,
                                                           org.moe.natj.general.ptr.NUIntPtr glyphIndex)
        Returns (by reference for the "get" method) the character index or glyph index or both of the first unlaid character/glyph in the layout manager at this time.
      • getGlyphsInRangeGlyphsPropertiesCharacterIndexesBidiLevels

        public long getGlyphsInRangeGlyphsPropertiesCharacterIndexesBidiLevels​(NSRange glyphRange,
                                                                               org.moe.natj.general.ptr.CharPtr glyphBuffer,
                                                                               org.moe.natj.general.ptr.NIntPtr props,
                                                                               org.moe.natj.general.ptr.NUIntPtr charIndexBuffer,
                                                                               org.moe.natj.general.ptr.BytePtr bidiLevelBuffer)
        Fills a passed-in buffer with a sequence of CGGlyphs. They will also optionally fill other passed-in buffers with the glyph properties, character indexes, and bidi levels corresponding to these glyphs. Each pointer passed in should either be NULL, or else point to sufficient memory to hold glyphRange.length elements. These methods return the number of glyphs filled in.
      • getLineFragmentInsertionPointsForCharacterAtIndexAlternatePositionsInDisplayOrderPositionsCharacterIndexes

        public long getLineFragmentInsertionPointsForCharacterAtIndexAlternatePositionsInDisplayOrderPositionsCharacterIndexes​(long charIndex,
                                                                                                                               boolean aFlag,
                                                                                                                               boolean dFlag,
                                                                                                                               org.moe.natj.general.ptr.NFloatPtr positions,
                                                                                                                               org.moe.natj.general.ptr.NUIntPtr charIndexes)
        Allows clients to obtain all insertion points for a line fragment in one call. The caller specifies the line fragment by supplying one character index within it, and can choose whether to obtain primary or alternate insertion points, and whether they should be in logical or in display order. The return value is the number of insertion points returned. Each pointer passed in should either be NULL, or else point to sufficient memory to hold as many elements as there are insertion points in the line fragment (which cannot be more than the number of characters + 1). The positions buffer passed in will be filled in with the positions of the insertion points, in the order specified, and the charIndexes buffer passed in will be filled in with the corresponding character indexes. Positions indicate a transverse offset relative to the line fragment rect's origin. Internal caching is used to ensure that repeated calls to this method for the same line fragment (possibly with differing values for other arguments) will not be significantly more expensive than a single call.
      • glyphAtIndex

        public char glyphAtIndex​(long glyphIndex)
        Use -CGGlyphAtIndex: instead
      • glyphAtIndexIsValidIndex

        public char glyphAtIndexIsValidIndex​(long glyphIndex,
                                             org.moe.natj.general.ptr.BoolPtr isValidIndex)
        Use -CGGlyphAtIndex:isValidIndex: instead
      • glyphIndexForCharacterAtIndex

        public long glyphIndexForCharacterAtIndex​(long charIndex)
        If non-contiguous layout is not enabled, this will cause generation of all glyphs up to and including those associated with the specified character. It will return the glyph index for the first glyph associated with the character at the specified index.
      • glyphIndexForPointInTextContainer

        public long glyphIndexForPointInTextContainer​(CGPoint point,
                                                      NSTextContainer container)
      • glyphIndexForPointInTextContainerFractionOfDistanceThroughGlyph

        public long glyphIndexForPointInTextContainerFractionOfDistanceThroughGlyph​(CGPoint point,
                                                                                    NSTextContainer container,
                                                                                    org.moe.natj.general.ptr.NFloatPtr partialFraction)
        Returns the index of the glyph falling under the given point, expressed in the given container's coordinate system. If no glyph is under the point, the nearest glyph is returned, where nearest is defined according to the requirements of selection by touch or mouse. Clients who wish to determine whether the the point actually lies within the bounds of the glyph returned should follow this with a call to boundingRectForGlyphRange:inTextContainer: and test whether the point falls in the rect returned by that method. If partialFraction is non-NULL, it will return by reference the fraction of the distance between the location of the glyph returned and the location of the next glyph.
      • glyphRangeForBoundingRectInTextContainer

        public NSRange glyphRangeForBoundingRectInTextContainer​(CGRect bounds,
                                                                NSTextContainer container)
        Returns a contiguous glyph range containing all glyphs that would need to be displayed in order to draw all glyphs that fall (even partially) within the bounding rect given. This range might include glyphs which do not fall into the rect at all. At most this will return the glyph range for the whole container. The WithoutAdditionalLayout variant will not generate glyphs or perform layout in attempting to answer, and thus may not be entirely correct. Bounding rects are always in container coordinates.
      • glyphRangeForBoundingRectWithoutAdditionalLayoutInTextContainer

        public NSRange glyphRangeForBoundingRectWithoutAdditionalLayoutInTextContainer​(CGRect bounds,
                                                                                       NSTextContainer container)
      • glyphRangeForCharacterRangeActualCharacterRange

        public NSRange glyphRangeForCharacterRangeActualCharacterRange​(NSRange charRange,
                                                                       NSRange actualCharRange)
        Returns the range of glyphs that are generated from the characters in the given charRange. If actualCharRange is not NULL, it will return by reference the actual range of characters that fully define the glyph range returned. This range may be identical to or slightly larger than the requested character range. For example, if the text storage contains the characters "o" and (umlaut) and the glyph store contains the single precomposed glyph (o-umlaut), and if the character range given encloses only the first or second character, then actualCharRange will be set to enclose both characters. If the length of charRange is zero, the resulting glyph range will be a zero-length range just after the glyph(s) corresponding to the preceding character, and actualCharRange will also be zero-length. If non-contiguous layout is not enabled, this will force the generation of glyphs for all characters up to and including the end of the specified range.
      • glyphRangeForTextContainer

        public NSRange glyphRangeForTextContainer​(NSTextContainer container)
        Returns the range of characters which have been laid into the given container. This is a less efficient method than the similar -textContainerForGlyphAtIndex:effectiveRange:.
      • hasNonContiguousLayout

        public boolean hasNonContiguousLayout()
        Even if non-contiguous layout is allowed, it may not always be used, and there may not always be layout holes. This method returns YES if there might currently be non-contiguous portions of the text laid out.
      • hyphenationFactor

        public double hyphenationFactor()
        0.0 - 1.0. Whenever (width of the real contents of the line) / (the line fragment width) is below this value, hyphenation will be attempted when laying out the line. By default, the value is 0.0, meaning hyphenation is off. A value of 1.0 causes hyphenation to be attempted always. Note that hyphenation will slow down text layout and increase memory usage, so it should be used sparingly. Maybe overridden on a per-paragraph basis by the NSParagraphStyle's hyphenationFactor.
      • init

        public NSLayoutManager init()
        Designated Initializer. Sets up this instance. The NSLayoutManager starts off without an NSTextStorage.
        Overrides:
        init in class NSObject
      • insertTextContainerAtIndex

        public void insertTextContainerAtIndex​(NSTextContainer container,
                                               long index)
        Insert a container into the array before the container at index. Must invalidate layout of all glyphs in the containers from the one previously at index to the last container.
      • invalidateDisplayForCharacterRange

        public void invalidateDisplayForCharacterRange​(NSRange charRange)
        These methods invalidate display for the glyph or character range given. For the character range variant, unlaid parts of the range are remembered and will be redisplayed at some point later when the layout is available. For the glyph range variant any part of the range that does not yet have glyphs generated is ignored. Neither method actually causes layout.
      • invalidateDisplayForGlyphRange

        public void invalidateDisplayForGlyphRange​(NSRange glyphRange)
      • invalidateGlyphsForCharacterRangeChangeInLengthActualCharacterRange

        public void invalidateGlyphsForCharacterRangeChangeInLengthActualCharacterRange​(NSRange charRange,
                                                                                        long delta,
                                                                                        NSRange actualCharRange)
        This removes all glyphs for the old character range, adjusts the character indices of all the subsequent glyphs by the change in length, and invalidates the new character range. If actualCharRange is non-NULL it will be set to the actual range invalidated after any necessary expansion.
      • invalidateLayoutForCharacterRangeActualCharacterRange

        public void invalidateLayoutForCharacterRangeActualCharacterRange​(NSRange charRange,
                                                                          NSRange actualCharRange)
        This method invalidates the layout information for the given range of characters. If actualCharRange is non-NULL it will be set to the actual range invalidated after any necessary expansion.
      • isValidGlyphIndex

        public boolean isValidGlyphIndex​(long glyphIndex)
      • lineFragmentRectForGlyphAtIndexEffectiveRange

        public CGRect lineFragmentRectForGlyphAtIndexEffectiveRange​(long glyphIndex,
                                                                    NSRange effectiveGlyphRange)
        Returns the rect for the line fragment in which the given glyph is laid and (optionally) by reference the whole range of glyphs that are in that fragment. This will cause glyph generation and layout for the line fragment containing the specified glyph, or if non-contiguous layout is not enabled, up to and including that line fragment. Line fragment rects are always in container coordinates.
      • lineFragmentRectForGlyphAtIndexEffectiveRangeWithoutAdditionalLayout

        public CGRect lineFragmentRectForGlyphAtIndexEffectiveRangeWithoutAdditionalLayout​(long glyphIndex,
                                                                                           NSRange effectiveGlyphRange,
                                                                                           boolean flag)
      • lineFragmentUsedRectForGlyphAtIndexEffectiveRange

        public CGRect lineFragmentUsedRectForGlyphAtIndexEffectiveRange​(long glyphIndex,
                                                                        NSRange effectiveGlyphRange)
        Returns the usage rect for the line fragment in which the given glyph is laid and (optionally) by reference the whole range of glyphs that are in that fragment. This will cause glyph generation and layout for the line fragment containing the specified glyph, or if non-contiguous layout is not enabled, up to and including that line fragment. Line fragment used rects are always in container coordinates.
      • lineFragmentUsedRectForGlyphAtIndexEffectiveRangeWithoutAdditionalLayout

        public CGRect lineFragmentUsedRectForGlyphAtIndexEffectiveRangeWithoutAdditionalLayout​(long glyphIndex,
                                                                                               NSRange effectiveGlyphRange,
                                                                                               boolean flag)
      • locationForGlyphAtIndex

        public CGPoint locationForGlyphAtIndex​(long glyphIndex)
        Returns the location for the given glyph within its line fragment. If this glyph does not have an explicit location set for it (i.e., it is part of (but not first in) a sequence of nominally spaced characters), the location is calculated by glyph advancements from the location of the most recent preceding glyph with a location set. Glyph locations are relative to their line fragment rect's origin. This will cause glyph generation and layout for the line fragment containing the specified glyph, or if non-contiguous layout is not enabled, up to and including that line fragment.
      • notShownAttributeForGlyphAtIndex

        public boolean notShownAttributeForGlyphAtIndex​(long glyphIndex)
        Some glyphs are not shown. This method returns whether the given glyph has been designated as not shown. This will cause glyph generation and layout for the line fragment containing the specified glyph, or if non-contiguous layout is not enabled, up to and including that line fragment.
      • numberOfGlyphs

        public long numberOfGlyphs()
        Returns the total number of glyphs. If non-contiguous layout is not enabled, this will force generation of glyphs for all characters.
      • processEditingForTextStorageEditedRangeChangeInLengthInvalidatedRange

        public void processEditingForTextStorageEditedRangeChangeInLengthInvalidatedRange​(NSTextStorage textStorage,
                                                                                          long editMask,
                                                                                          NSRange newCharRange,
                                                                                          long delta,
                                                                                          NSRange invalidatedCharRange)
        Sent from processEditing in NSTextStorage. The newCharRange is the range in the final string which was explicitly edited. The invalidatedRange includes portions that changed as a result of attribute fixing. invalidatedRange is either equal to newCharRange or larger. Layout managers should not change the contents of the text storage during the execution of this message.
      • propertyForGlyphAtIndex

        public long propertyForGlyphAtIndex​(long glyphIndex)
        If non-contiguous layout is not enabled, this will cause generation of all glyphs up to and including glyphIndex. It will return the glyph property associated with the glyph at the specified index.
      • rangeOfNominallySpacedGlyphsContainingIndex

        public NSRange rangeOfNominallySpacedGlyphsContainingIndex​(long glyphIndex)
        Returns the range including the first glyph from glyphIndex on back that has a location set and up to, but not including the next glyph that has a location set.
      • removeTextContainerAtIndex

        public void removeTextContainerAtIndex​(long index)
        Removes the container at index from the array. Must invalidate layout of all glyphs in the container being removed and any containers which come after it.
      • setAllowsNonContiguousLayout

        public void setAllowsNonContiguousLayout​(boolean value)
        If YES, then the layout manager may perform glyph generation and layout for a given portion of the text, without having glyphs or layout for preceding portions. The default is NO. Turning this setting on will significantly alter which portions of the text will have glyph generation or layout performed when a given generation-causing method is invoked. It also gives significant performance benefits, especially for large documents.
      • setAttachmentSizeForGlyphRange

        public void setAttachmentSizeForGlyphRange​(CGSize attachmentSize,
                                                   NSRange glyphRange)
        For a glyph corresponding to an attachment, this method should be called to set the size the attachment cell will occupy.
      • setDelegate_unsafe

        public void setDelegate_unsafe​(NSLayoutManagerDelegate value)
        Delegate ***************************
      • setDrawsOutsideLineFragmentForGlyphAtIndex

        public void setDrawsOutsideLineFragmentForGlyphAtIndex​(boolean flag,
                                                               long glyphIndex)
        Used to indicate that a particular glyph for some reason will draw outside of its line fragment rect. This can commonly happen if a fixed line height is used (consider a 12 point line height and a 24 point glyph). This information is important for determining whether additional lines need to be redrawn as a result of changes to any given line fragment.
      • setExtraLineFragmentRectUsedRectTextContainer

        public void setExtraLineFragmentRectUsedRectTextContainer​(CGRect fragmentRect,
                                                                  CGRect usedRect,
                                                                  NSTextContainer container)
        Sets the bounds and container for the extra line fragment. The extra line fragment is used when the text backing ends with a hard line break or when the text backing is totally empty, to define the extra line which needs to be displayed at the end of the text. Line fragment rects and line fragment used rects are always in container coordinates. This method should be invoked only when there is a non-empty extra line fragment.
      • setGlyphsPropertiesCharacterIndexesFontForGlyphRange

        public void setGlyphsPropertiesCharacterIndexesFontForGlyphRange​(org.moe.natj.general.ptr.ConstCharPtr glyphs,
                                                                         org.moe.natj.general.ptr.ConstNIntPtr props,
                                                                         org.moe.natj.general.ptr.ConstNUIntPtr charIndexes,
                                                                         UIFont aFont,
                                                                         NSRange glyphRange)
        Sets the initial glyphs and properties for a character range. This method is invoked mainly from the glyph generation process. Only place apps are allowed to directly call this method is from -layoutManager:shouldGenerateGlyphs:properties:characterIndexes:forGlyphRange:. Each array has glyphRange.length items. charIndexes must be contiguous (no skipped indexes). It allows multiple items to have a same character index (a character index generating multiple glyph IDs). Due to the font substitution, aFont passed into this method might not match the font in the attributes dictionary. Calling this method for a range with the layout information invalidates the layout and display.
      • setHyphenationFactor

        public void setHyphenationFactor​(double value)
        0.0 - 1.0. Whenever (width of the real contents of the line) / (the line fragment width) is below this value, hyphenation will be attempted when laying out the line. By default, the value is 0.0, meaning hyphenation is off. A value of 1.0 causes hyphenation to be attempted always. Note that hyphenation will slow down text layout and increase memory usage, so it should be used sparingly. Maybe overridden on a per-paragraph basis by the NSParagraphStyle's hyphenationFactor.
      • setLineFragmentRectForGlyphRangeUsedRect

        public void setLineFragmentRectForGlyphRangeUsedRect​(CGRect fragmentRect,
                                                             NSRange glyphRange,
                                                             CGRect usedRect)
        Associates the given line fragment bounds with the given range of glyphs. The typesetter should call this method second, after setting the line fragment rect and before setting the location or any of the layout bits. In the course of layout, all glyphs should end up being included in a range passed to this method, but only glyphs which start a new line fragment should be at the start of such ranges. Line fragment rects and line fragment used rects are always in container coordinates.
      • setLocationForStartOfGlyphRange

        public void setLocationForStartOfGlyphRange​(CGPoint location,
                                                    NSRange glyphRange)
        Sets the location for the first glyph of the given range. Setting the location for a glyph range implies that its first glyph is not nominally spaced with respect to the previous glyph. In the course of layout, all glyphs should end up being included in a range passed to this method, but only glyphs which start a new nominal range should be at the start of such ranges. The first glyph in a line fragment should always start a new nominal range. Glyph locations are given relative to their line fragment rect's origin.
      • setNotShownAttributeForGlyphAtIndex

        public void setNotShownAttributeForGlyphAtIndex​(boolean flag,
                                                        long glyphIndex)
        Some glyphs are not shown. The typesetter decides which ones and sets this attribute in the layout manager to ensure that those glyphs will not be displayed.
      • setShowsControlCharacters

        public void setShowsControlCharacters​(boolean value)
        If YES, then control characters will be rendered visibly (usually like "^M"). The default is NO.
      • setShowsInvisibleCharacters

        public void setShowsInvisibleCharacters​(boolean value)
        If YES, then whitespace and other "invisible" characters will be shown with special glyphs or other drawing. The default is NO.
      • setTextContainerForGlyphRange

        public void setTextContainerForGlyphRange​(NSTextContainer container,
                                                  NSRange glyphRange)
        Associates the given container with the given range of glyphs. This method should be called by the typesetter first, before setting line fragment rect or any of the layout bits, for each range of glyphs it lays out. This method will reset several key layout attributes (like not shown and draws outside line fragment) to their default values. In the course of layout, all glyphs should end up being included in a range passed to this method. The range passed in is not expected to be the entire range of glyphs for that text container; usually, in fact, it will be the range for a given line fragment being laid out in that container.
      • setTextStorage_unsafe

        public void setTextStorage_unsafe​(NSTextStorage value)
        Accessor for the NSTextStorage object owning the receiver. Avoid assigning a text storage directly through this property. Adding a layout manager to a text storage through -[NSTextStorage addLayoutManager:] will use the property for assigning the new text storage.
      • setTextStorage

        public void setTextStorage​(NSTextStorage value)
        Accessor for the NSTextStorage object owning the receiver. Avoid assigning a text storage directly through this property. Adding a layout manager to a text storage through -[NSTextStorage addLayoutManager:] will use the property for assigning the new text storage.
      • setUsesFontLeading

        public void setUsesFontLeading​(boolean value)
        By default, a layout manager will use leading as specified by the font. However, this is not appropriate for most UI text, for which a fixed leading is usually specified by UI layout guidelines. These methods allow the use of the font's leading to be turned off.
      • showCGGlyphsPositionsCountFontMatrixAttributesInContext

        public void showCGGlyphsPositionsCountFontMatrixAttributesInContext​(org.moe.natj.general.ptr.ConstCharPtr glyphs,
                                                                            org.moe.natj.general.ptr.ConstPtr<CGPoint> positions,
                                                                            long glyphCount,
                                                                            UIFont font,
                                                                            CGAffineTransform textMatrix,
                                                                            NSDictionary<java.lang.String,​?> attributes,
                                                                            CGContextRef graphicsContext)
        This is the glyph rendering primitive method. Renders glyphs at positions into the graphicsContext. The positions are in the user space coordinate system. graphicsContext that passed in is already configured according to the text attributes arguments: font, textMatrix, and attributes. The font argument represents the font applied to the graphics state. The value can be different from the NSFontAttributeName value in the attributes argument because of various font substitutions that the system automatically executes. The textMatrix is the affine transform mapping the text space coordinate system to the user space coordinate system. The tx and ty components of textMatrix are ignored since Quartz overrides them with the glyph positions.
      • showsControlCharacters

        public boolean showsControlCharacters()
        If YES, then control characters will be rendered visibly (usually like "^M"). The default is NO.
      • showsInvisibleCharacters

        public boolean showsInvisibleCharacters()
        If YES, then whitespace and other "invisible" characters will be shown with special glyphs or other drawing. The default is NO.
      • strikethroughGlyphRangeStrikethroughTypeLineFragmentRectLineFragmentGlyphRangeContainerOrigin

        public void strikethroughGlyphRangeStrikethroughTypeLineFragmentRectLineFragmentGlyphRangeContainerOrigin​(NSRange glyphRange,
                                                                                                                  long strikethroughVal,
                                                                                                                  CGRect lineRect,
                                                                                                                  NSRange lineGlyphRange,
                                                                                                                  CGPoint containerOrigin)
      • textContainerChangedGeometry

        public void textContainerChangedGeometry​(NSTextContainer container)
        Called by NSTextContainer whenever it changes size or shape. Invalidates layout of all glyphs in container and all subsequent containers.
      • textContainerForGlyphAtIndexEffectiveRange

        public NSTextContainer textContainerForGlyphAtIndexEffectiveRange​(long glyphIndex,
                                                                          NSRange effectiveGlyphRange)
        Returns the container in which the given glyph is laid and (optionally) by reference the whole range of glyphs that are in that container. This will cause glyph generation and layout for the line fragment containing the specified glyph, or if non-contiguous layout is not enabled, up to and including that line fragment; if non-contiguous layout is not enabled and effectiveGlyphRange is non-NULL, this will additionally cause glyph generation and layout for the entire text container containing the specified glyph.
      • textContainerForGlyphAtIndexEffectiveRangeWithoutAdditionalLayout

        public NSTextContainer textContainerForGlyphAtIndexEffectiveRangeWithoutAdditionalLayout​(long glyphIndex,
                                                                                                 NSRange effectiveGlyphRange,
                                                                                                 boolean flag)
      • textContainers

        public NSArray<? extends NSTextContainer> textContainers()
        NSTextContainer objects owner by the receiver.
      • textStorage

        public NSTextStorage textStorage()
        Accessor for the NSTextStorage object owning the receiver. Avoid assigning a text storage directly through this property. Adding a layout manager to a text storage through -[NSTextStorage addLayoutManager:] will use the property for assigning the new text storage.
      • truncatedGlyphRangeInLineFragmentForGlyphAtIndex

        public NSRange truncatedGlyphRangeInLineFragmentForGlyphAtIndex​(long glyphIndex)
        Returns a range of truncated glyph range for a line fragment containing the specified index. When there is no truncation for the line fragment, it returns {NSNotFound, 0}.
      • underlineGlyphRangeUnderlineTypeLineFragmentRectLineFragmentGlyphRangeContainerOrigin

        public void underlineGlyphRangeUnderlineTypeLineFragmentRectLineFragmentGlyphRangeContainerOrigin​(NSRange glyphRange,
                                                                                                          long underlineVal,
                                                                                                          CGRect lineRect,
                                                                                                          NSRange lineGlyphRange,
                                                                                                          CGPoint containerOrigin)
      • usedRectForTextContainer

        public CGRect usedRectForTextContainer​(NSTextContainer container)
        Returns the container's currently used area. This determines the size that the view would need to be in order to display all the glyphs that are currently laid into the container. This causes neither glyph generation nor layout. Used rects are always in container coordinates.
      • usesFontLeading

        public boolean usesFontLeading()
        By default, a layout manager will use leading as specified by the font. However, this is not appropriate for most UI text, for which a fixed leading is usually specified by UI layout guidelines. These methods allow the use of the font's leading to be turned off.
      • 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.
      • 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.
      • setUsesDefaultHyphenation

        public void setUsesDefaultHyphenation​(boolean value)
        When YES, NSLayoutManager will attempt to hyphenate when wrapping lines. May be overridden on a per-paragraph basis by the NSParagraphStyle's hyphenationFactor. 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".
      • showCGGlyphsPositionsCountFontTextMatrixAttributesInContext

        public void showCGGlyphsPositionsCountFontTextMatrixAttributesInContext​(org.moe.natj.general.ptr.ConstCharPtr glyphs,
                                                                                CGPoint positions,
                                                                                long glyphCount,
                                                                                UIFont font,
                                                                                CGAffineTransform textMatrix,
                                                                                NSDictionary<java.lang.String,​?> attributes,
                                                                                CGContextRef CGContext)
        This is the glyph rendering primitive method. Renders glyphs at positions into the CGContext. The positions are in the user space coordinate system. CGContext that is passed in is already configured according to the text attributes arguments: font, textMatrix, and attributes. The font argument represents the font applied to the graphics state. The value can be different from the NSFontAttributeName value in the attributes argument because of various font substitutions that the system automatically executes. The textMatrix is the affine transform mapping the text space coordinate system to the user space coordinate system. The tx and ty components of textMatrix are ignored since Quartz overrides them with the glyph positions.
      • 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
      • usesDefaultHyphenation

        public boolean usesDefaultHyphenation()
        When YES, NSLayoutManager will attempt to hyphenate when wrapping lines. May be overridden on a per-paragraph basis by the NSParagraphStyle's hyphenationFactor. 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".