Package apple.uikit

Class NSTextStorage

  • All Implemented Interfaces:
    NSCoding, NSCopying, NSItemProviderReading, NSItemProviderWriting, NSMutableCopying, NSSecureCoding, NSObject

    public class NSTextStorage
    extends NSMutableAttributedString
    implements NSSecureCoding
    Note for subclassing NSTextStorage: NSTextStorage is a semi-abstract subclass of NSMutableAttributedString. It implements change management (beginEditing/endEditing), verification of attributes, delegate handling, and layout management notification. The one aspect it does not implement is the actual attributed string storage --- this is left up to the subclassers, which need to override the two NSMutableAttributedString primitives in addition to two NSAttributedString primitives: - (NSString *)string; - (NSDictionary *)attributesAtIndex:(NSUInteger)location effectiveRange:(NSRangePointer)range; - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)str; - (void)setAttributes:(NSDictionary *)attrs range:(NSRange)range; These primitives should perform the change then call edited:range:changeInLength: to get everything else to happen.
    • Constructor Detail

      • NSTextStorage

        protected NSTextStorage​(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()
      • supportsSecureCoding

        public static boolean supportsSecureCoding()
      • version_static

        public static long version_static()
      • addLayoutManager

        public void addLayoutManager​(NSLayoutManager aLayoutManager)
        Adds aLayoutManager to the receiver. Sends -[NSLayoutManager setTextStorage:] to aLayoutManager with the receiver.
      • changeInLength

        public long changeInLength()
        The length delta for the pending changes.
      • editedRangeChangeInLength

        public void editedRangeChangeInLength​(long editedMask,
                                              NSRange editedRange,
                                              long delta)
        Notifies and records a recent change. If there are no outstanding -beginEditing calls, this method calls -processEditing to trigger post-editing processes. This method has to be called by the primitives after changes are made if subclassed and overridden. editedRange is the range in the original string (before the edit).
      • editedMask

        public long editedMask()
        The NSTextStorageEditActions mask indicating that there are pending changes for attributes, characters, or both.
      • editedRange

        public NSRange editedRange()
        The range for pending changes. {NSNotFound, 0} when there is no pending changes.
      • ensureAttributesAreFixedInRange

        public void ensureAttributesAreFixedInRange​(NSRange range)
        Ensures all attributes in range are validated and ready to be used. An NSTextStorage that is lazy is required to call the following method before accessing any attributes. This gives the attribute fixing a chance to occur if necessary. NSTextStorage subclasses that wish to support laziness must call it from all attribute accessors that they implement. The default concrete subclass does call this from its accessors.
      • fixesAttributesLazily

        public boolean fixesAttributesLazily()
        Indicates if the receiver fixes invalidated attributes lazily. The concrete UIKit subclass fixes attributes lazily by default. The abstract class (hence, all custom subclasses) is not lazy.
      • initWithURLOptionsDocumentAttributesError

        public NSTextStorage initWithURLOptionsDocumentAttributesError​(NSURL url,
                                                                       NSDictionary<java.lang.String,​?> options,
                                                                       org.moe.natj.general.ptr.Ptr<NSDictionary<java.lang.String,​?>> dict,
                                                                       org.moe.natj.general.ptr.Ptr<NSError> error)
        Description copied from class: NSAttributedString
        Methods initializing the receiver contents with an external document data. options specify document attributes for interpreting the document contents. NSDocumentTypeDocumentAttribute, NSCharacterEncodingDocumentAttribute, and NSDefaultAttributesDocumentAttribute are supported options key. When they are not specified, these methods will examine the data and do their best to detect the appropriate attributes. If dict is non-NULL, it will return a dictionary with various document-wide attributes accessible via NS...DocumentAttribute keys.
        Overrides:
        initWithURLOptionsDocumentAttributesError in class NSMutableAttributedString
      • invalidateAttributesInRange

        public void invalidateAttributesInRange​(NSRange range)
        Notes the range of attributes that requires validation. If the NSTextStorage is not lazy this just calls fixAttributesInRange:. If it is lazy this instead just records the range needing fixing in order to do it later.
      • layoutManagers

        public NSArray<? extends NSLayoutManager> layoutManagers()
        NSLayoutManager objects owned by the receiver.
      • processEditing

        public void processEditing()
        Sends out -textStorage:willProcessEditing, fixes the attributes, sends out -textStorage:didProcessEditing, and notifies the layout managers of change with the -processEditingForTextStorage:edited:range:changeInLength:invalidatedRange: method. Invoked from -edited:range:changeInLength: or -endEditing.
      • removeLayoutManager

        public void removeLayoutManager​(NSLayoutManager aLayoutManager)
        Removes aLayoutManager from the receiver if already owned by it. Sends -[NSLayoutManager setTextStorage:] to aLayoutManager with nil.
      • setDelegate_unsafe

        public void setDelegate_unsafe​(NSTextStorageDelegate value)
        Delegate ***************************
      • setDelegate

        public void setDelegate​(NSTextStorageDelegate value)
        Delegate ***************************
      • _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
        Overrides:
        _supportsSecureCoding in class NSMutableAttributedString
      • itemProviderVisibilityForRepresentationWithTypeIdentifier_static

        public static long itemProviderVisibilityForRepresentationWithTypeIdentifier_static​(java.lang.String typeIdentifier)
      • objectWithItemProviderDataTypeIdentifierError

        public static java.lang.Object objectWithItemProviderDataTypeIdentifierError​(NSData data,
                                                                                     java.lang.String typeIdentifier,
                                                                                     org.moe.natj.general.ptr.Ptr<NSError> outError)
      • readableTypeIdentifiersForItemProvider

        public static NSArray<java.lang.String> readableTypeIdentifiersForItemProvider()
      • writableTypeIdentifiersForItemProvider_static

        public static NSArray<java.lang.String> writableTypeIdentifiersForItemProvider_static()