Class NSAttributedString

    • Constructor Detail

      • NSAttributedString

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static NSAttributedString allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • attributedStringWithAttachment

        @NotNull
        public static @NotNull NSAttributedString attributedStringWithAttachment​(@NotNull
                                                                                 @NotNull NSTextAttachment attachment)
        A convenience method for creating an attributed string containing attachment using NSAttachmentCharacter as the base character. API-Since: 7.0
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • 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()
      • 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

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • 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()
      • attributeAtIndexEffectiveRange

        @Nullable
        public @Nullable java.lang.Object attributeAtIndexEffectiveRange​(@NotNull
                                                                         @NotNull java.lang.String attrName,
                                                                         long location,
                                                                         @Nullable
                                                                         @Nullable NSRange range)
      • attributeAtIndexLongestEffectiveRangeInRange

        @Nullable
        public @Nullable java.lang.Object attributeAtIndexLongestEffectiveRangeInRange​(@NotNull
                                                                                       @NotNull java.lang.String attrName,
                                                                                       long location,
                                                                                       @Nullable
                                                                                       @Nullable NSRange range,
                                                                                       NSRange rangeLimit)
      • attributesAtIndexEffectiveRange

        @NotNull
        public @NotNull NSDictionary<java.lang.String,​?> attributesAtIndexEffectiveRange​(long location,
                                                                                               @Nullable
                                                                                               @Nullable NSRange range)
      • attributesAtIndexLongestEffectiveRangeInRange

        @NotNull
        public @NotNull NSDictionary<java.lang.String,​?> attributesAtIndexLongestEffectiveRangeInRange​(long location,
                                                                                                             @Nullable
                                                                                                             @Nullable NSRange range,
                                                                                                             NSRange rangeLimit)
      • boundingRectWithSizeOptionsContext

        public CGRect boundingRectWithSizeOptionsContext​(CGSize size,
                                                         long options,
                                                         @Nullable
                                                         @Nullable NSStringDrawingContext context)
        API-Since: 6.0
      • containsAttachmentsInRange

        public boolean containsAttachmentsInRange​(NSRange range)
        Returns YES if the receiver contains a property configured (NSAttachmentAttributeName with NSAttachmentCharacter) in range API-Since: 9.0
      • copyWithZone

        @NotNull
        public @NotNull java.lang.Object copyWithZone​(@Nullable
                                                      @Nullable org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • dataFromRangeDocumentAttributesError

        @Nullable
        public @Nullable NSData dataFromRangeDocumentAttributesError​(NSRange range,
                                                                     @NotNull
                                                                     @NotNull NSDictionary<java.lang.String,​?> dict,
                                                                     @Nullable
                                                                     @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Generates an NSData object for the receiver contents in range. It requires a document attributes dict specifying at least the NSDocumentTypeDocumentAttribute to determine the format to be written. API-Since: 7.0
      • drawAtPoint

        public void drawAtPoint​(CGPoint point)
        API-Since: 6.0
      • drawInRect

        public void drawInRect​(CGRect rect)
        API-Since: 6.0
      • drawWithRectOptionsContext

        public void drawWithRectOptionsContext​(CGRect rect,
                                               long options,
                                               @Nullable
                                               @Nullable NSStringDrawingContext context)
        API-Since: 6.0
      • fileWrapperFromRangeDocumentAttributesError

        @Nullable
        public @Nullable NSFileWrapper fileWrapperFromRangeDocumentAttributesError​(NSRange range,
                                                                                   @NotNull
                                                                                   @NotNull NSDictionary<java.lang.String,​?> dict,
                                                                                   @Nullable
                                                                                   @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Returns an NSFileWrapper object for the receiver contents in range. It requires a document attributes dict specifying at least the NSDocumentTypeDocumentAttribute to determine the format to be written. The method returns a directory file wrapper for those document types represented by a file package such as NSRTFDTextDocumentType; otherwise, it returns a regular-file file wrapper. API-Since: 7.0
      • initWithDataOptionsDocumentAttributesError

        public NSAttributedString initWithDataOptionsDocumentAttributesError​(@NotNull
                                                                             @NotNull NSData data,
                                                                             @NotNull
                                                                             @NotNull NSDictionary<java.lang.String,​?> options,
                                                                             @Nullable
                                                                             @Nullable org.moe.natj.general.ptr.Ptr<NSDictionary<java.lang.String,​?>> dict,
                                                                             @Nullable
                                                                             @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        API-Since: 7.0
      • initWithFileURLOptionsDocumentAttributesError

        @Deprecated
        public NSAttributedString initWithFileURLOptionsDocumentAttributesError​(@NotNull
                                                                                @NotNull NSURL url,
                                                                                @NotNull
                                                                                @NotNull NSDictionary<?,​?> options,
                                                                                @Nullable
                                                                                @Nullable org.moe.natj.general.ptr.Ptr<NSDictionary<?,​?>> dict,
                                                                                @Nullable
                                                                                @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Deprecated.
        API-Since: 7.0 Deprecated-Since: 9.0
      • initWithString

        public NSAttributedString initWithString​(@NotNull
                                                 @NotNull java.lang.String str)
      • initWithStringAttributes

        public NSAttributedString initWithStringAttributes​(@NotNull
                                                           @NotNull java.lang.String str,
                                                           @Nullable
                                                           @Nullable NSDictionary<java.lang.String,​?> attrs)
      • initWithURLOptionsDocumentAttributesError

        public NSAttributedString initWithURLOptionsDocumentAttributesError​(@NotNull
                                                                            @NotNull NSURL url,
                                                                            @NotNull
                                                                            @NotNull NSDictionary<java.lang.String,​?> options,
                                                                            @Nullable
                                                                            @Nullable org.moe.natj.general.ptr.Ptr<NSDictionary<java.lang.String,​?>> dict,
                                                                            @Nullable
                                                                            @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        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. API-Since: 9.0
      • isEqualToAttributedString

        public boolean isEqualToAttributedString​(@NotNull
                                                 @NotNull NSAttributedString other)
      • length

        public long length()
      • mutableCopyWithZone

        @NotNull
        public @NotNull java.lang.Object mutableCopyWithZone​(@Nullable
                                                             @Nullable org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        mutableCopyWithZone in interface NSMutableCopying
      • size

        public CGSize size()
        API-Since: 6.0
      • string

        @NotNull
        public @NotNull java.lang.String string()
        Override these two APIs when subclassing NSAttributedString
      • _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
      • itemProviderVisibilityForRepresentationWithTypeIdentifier_static

        public static long itemProviderVisibilityForRepresentationWithTypeIdentifier_static​(@NotNull
                                                                                            @NotNull java.lang.String typeIdentifier)
      • itemProviderVisibilityForRepresentationWithTypeIdentifier

        public long itemProviderVisibilityForRepresentationWithTypeIdentifier​(@NotNull
                                                                              @NotNull java.lang.String typeIdentifier)
      • objectWithItemProviderDataTypeIdentifierError

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

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

        @NotNull
        public static @NotNull NSArray<java.lang.String> writableTypeIdentifiersForItemProvider_static()
      • writableTypeIdentifiersForItemProvider

        @NotNull
        public @NotNull NSArray<java.lang.String> writableTypeIdentifiersForItemProvider()
      • loadFromHTMLWithDataOptionsCompletionHandler

        public static void loadFromHTMLWithDataOptionsCompletionHandler​(@NotNull
                                                                        @NotNull NSData data,
                                                                        @NotNull
                                                                        @NotNull NSDictionary<java.lang.String,​?> options,
                                                                        @NotNull
                                                                        @NotNull NSAttributedString.Block_loadFromHTMLWithDataOptionsCompletionHandler completionHandler)
        Converts HTML data into an attributed string. The completionHandler is passed the attributed string result along with any document-level attributes, or an error. If neither NSTextEncodingNameDocumentOption nor NSCharacterEncodingDocumentOption is supplied, a best-guess encoding is used. API-Since: 13.0
        Parameters:
        data - The HTML data to use as the contents.
        options - Document attributes for interpreting the document contents. NSTextSizeMultiplierDocumentOption, NSTimeoutDocumentOption, NSTextEncodingNameDocumentOption, and NSCharacterEncodingDocumentOption are supported option keys.
        completionHandler - A block to invoke when the operation completes or fails.
      • loadFromHTMLWithFileURLOptionsCompletionHandler

        public static void loadFromHTMLWithFileURLOptionsCompletionHandler​(@NotNull
                                                                           @NotNull NSURL fileURL,
                                                                           @NotNull
                                                                           @NotNull NSDictionary<java.lang.String,​?> options,
                                                                           @NotNull
                                                                           @NotNull NSAttributedString.Block_loadFromHTMLWithFileURLOptionsCompletionHandler completionHandler)
        Converts a local HTML file into an attributed string. The completionHandler is passed the attributed string result along with any document-level attributes, or an error. If NSReadAccessURLDocumentOption references a single file, only that file may be loaded by WebKit. If NSReadAccessURLDocumentOption references a directory, files inside that directory may be loaded by WebKit. API-Since: 13.0
        Parameters:
        fileURL - The file URL to load.
        options - Document attributes for interpreting the document contents. NSTextSizeMultiplierDocumentOption, NSTimeoutDocumentOption and NSReadAccessURLDocumentOption are supported option keys.
        completionHandler - A block to invoke when the operation completes or fails.
      • loadFromHTMLWithRequestOptionsCompletionHandler

        public static void loadFromHTMLWithRequestOptionsCompletionHandler​(@NotNull
                                                                           @NotNull NSURLRequest request,
                                                                           @NotNull
                                                                           @NotNull NSDictionary<java.lang.String,​?> options,
                                                                           @NotNull
                                                                           @NotNull NSAttributedString.Block_loadFromHTMLWithRequestOptionsCompletionHandler completionHandler)
        Loads an HTML URL request and converts the contents into an attributed string. The completionHandler is passed the attributed string result along with any document-level attributes, or an error. API-Since: 13.0
        Parameters:
        request - The request specifying the URL to load.
        options - Document attributes for interpreting the document contents. NSTextSizeMultiplierDocumentOption and NSTimeoutDocumentOption are supported option keys.
        completionHandler - A block to invoke when the operation completes or fails.
      • loadFromHTMLWithStringOptionsCompletionHandler

        public static void loadFromHTMLWithStringOptionsCompletionHandler​(@NotNull
                                                                          @NotNull java.lang.String string,
                                                                          @NotNull
                                                                          @NotNull NSDictionary<java.lang.String,​?> options,
                                                                          @NotNull
                                                                          @NotNull NSAttributedString.Block_loadFromHTMLWithStringOptionsCompletionHandler completionHandler)
        Converts an HTML string into an attributed string. The completionHandler is passed the attributed string result along with any document-level attributes, or an error. NSBaseURLDocumentOption is used to resolve relative URLs within the document. API-Since: 13.0
        Parameters:
        string - The HTML string to use as the contents.
        options - Document attributes for interpreting the document contents. NSTextSizeMultiplierDocumentOption, NSTimeoutDocumentOption and NSBaseURLDocumentOption are supported option keys.
        completionHandler - A block to invoke when the operation completes or fails.
      • attributedStringByInflectingString

        @NotNull
        public @NotNull NSAttributedString attributedStringByInflectingString()
        If the string has portions tagged with NSInflectionRuleAttributeName that have no format specifiers, create a new string with those portions inflected by following the rule in the attribute. API-Since: 15.0
      • initWithContentsOfMarkdownFileAtURLOptionsBaseURLError

        public NSAttributedString initWithContentsOfMarkdownFileAtURLOptionsBaseURLError​(@NotNull
                                                                                         @NotNull NSURL markdownFile,
                                                                                         @Nullable
                                                                                         @Nullable NSAttributedStringMarkdownParsingOptions options,
                                                                                         @Nullable
                                                                                         @Nullable NSURL baseURL,
                                                                                         @Nullable
                                                                                         @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        These constructors have a 'baseURL' parameter. If specified, links in the document will be relative to this URL, and images in the document will be looked for relative to this URL (if the other options allow image loading). Defaults to nil. If set to nil, paths will not be resolved. API-Since: 15.0
      • initWithFormatOptionsLocale

        public NSAttributedString initWithFormatOptionsLocale​(@NotNull
                                                              @NotNull NSAttributedString format,
                                                              long options,
                                                              @Nullable
                                                              @Nullable NSLocale locale,
                                                              java.lang.Object... varargs)
        Formats the string using the specified locale (or the canonical one, if nil). API-Since: 15.0
      • initWithFormatOptionsLocaleArguments

        public NSAttributedString initWithFormatOptionsLocaleArguments​(@NotNull
                                                                       @NotNull NSAttributedString format,
                                                                       long options,
                                                                       @Nullable
                                                                       @Nullable NSLocale locale,
                                                                       org.moe.natj.general.ptr.BytePtr arguments)
        Formats the string using the arguments list and the specified locale (or the canonical one, if nil). API-Since: 15.0
      • initWithMarkdownStringOptionsBaseURLError

        public NSAttributedString initWithMarkdownStringOptionsBaseURLError​(@NotNull
                                                                            @NotNull java.lang.String markdownString,
                                                                            @Nullable
                                                                            @Nullable NSAttributedStringMarkdownParsingOptions options,
                                                                            @Nullable
                                                                            @Nullable NSURL baseURL,
                                                                            @Nullable
                                                                            @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        API-Since: 15.0
      • localizedAttributedStringWithFormat

        @NotNull
        public static @NotNull NSAttributedString localizedAttributedStringWithFormat​(@NotNull
                                                                                      @NotNull NSAttributedString format,
                                                                                      java.lang.Object... varargs)
        Formats the string using the current locale and default options. API-Since: 15.0
      • localizedAttributedStringWithFormatOptions

        @NotNull
        public static @NotNull NSAttributedString localizedAttributedStringWithFormatOptions​(@NotNull
                                                                                             @NotNull NSAttributedString format,
                                                                                             long options,
                                                                                             java.lang.Object... varargs)
        Formats the string using the current locale and the specified options. API-Since: 15.0
      • initWithFormatOptionsLocaleContext

        public NSAttributedString initWithFormatOptionsLocaleContext​(@NotNull
                                                                     @NotNull NSAttributedString format,
                                                                     long options,
                                                                     @Nullable
                                                                     @Nullable NSLocale locale,
                                                                     @NotNull
                                                                     @NotNull NSDictionary<java.lang.String,​?> context,
                                                                     java.lang.Object... varargs)
        Formats the string using the specified locale (or the canonical one, if nil). API-Since: 17.0
      • initWithFormatOptionsLocaleContextArguments

        public NSAttributedString initWithFormatOptionsLocaleContextArguments​(@NotNull
                                                                              @NotNull NSAttributedString format,
                                                                              long options,
                                                                              @Nullable
                                                                              @Nullable NSLocale locale,
                                                                              @NotNull
                                                                              @NotNull NSDictionary<java.lang.String,​?> context,
                                                                              org.moe.natj.general.ptr.BytePtr arguments)
        Formats the string using the arguments list and the specified locale (or the canonical one, if nil). API-Since: 17.0
      • localizedAttributedStringWithFormatContext

        @NotNull
        public static @NotNull NSAttributedString localizedAttributedStringWithFormatContext​(@NotNull
                                                                                             @NotNull NSAttributedString format,
                                                                                             @NotNull
                                                                                             @NotNull NSDictionary<java.lang.String,​?> context,
                                                                                             java.lang.Object... varargs)
        Formats the string using the current locale and default options. API-Since: 17.0
      • localizedAttributedStringWithFormatOptionsContext

        @NotNull
        public static @NotNull NSAttributedString localizedAttributedStringWithFormatOptionsContext​(@NotNull
                                                                                                    @NotNull NSAttributedString format,
                                                                                                    long options,
                                                                                                    @NotNull
                                                                                                    @NotNull NSDictionary<java.lang.String,​?> context,
                                                                                                    java.lang.Object... varargs)
        Formats the string using the current locale and the specified options. API-Since: 17.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.