Package apple.uikit

Class NSTextAttachment

    • Constructor Detail

      • NSTextAttachment

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static NSTextAttachment allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • 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()
      • version_static

        public static long version_static()
      • attachmentBoundsForTextContainerProposedLineFragmentGlyphPositionCharacterIndex

        public CGRect attachmentBoundsForTextContainerProposedLineFragmentGlyphPositionCharacterIndex​(@Nullable
                                                                                                      @Nullable NSTextContainer textContainer,
                                                                                                      CGRect lineFrag,
                                                                                                      CGPoint position,
                                                                                                      long charIndex)
        Description copied from interface: NSTextAttachmentContainer
        Returns the layout bounds to the layout manager. The bounds origin is interpreted to match position inside lineFrag. The NSTextAttachment implementation returns -bounds if not CGRectZero; otherwise, it derives the bounds value from -[image size]. Conforming objects can implement more sophisticated logic for negotiating the frame size based on the available container space and proposed line fragment rect. API-Since: 7.0
        Specified by:
        attachmentBoundsForTextContainerProposedLineFragmentGlyphPositionCharacterIndex in interface NSTextAttachmentContainer
      • bounds

        public CGRect bounds()
        Defines the layout bounds of the receiver's graphical representation in the text coordinate system. The origin is at the glyph location on the text baseline. The default value is CGRectZero. API-Since: 7.0
      • contents

        @Nullable
        public @Nullable NSData contents()
        These two properties define the contents for the text attachment. Modifying these properties have a side effect of invalidating -image and -fileWrapper properties. -fileType is an UTI describing the format for -contents. API-Since: 7.0
      • fileType

        @Nullable
        public @Nullable java.lang.String fileType()
        API-Since: 7.0
      • fileWrapper

        @Nullable
        public @Nullable NSFileWrapper fileWrapper()
        Optionally, NSTextAttachment can be associated with a file wrapper. Modifying this property has a side effect of invalidating -image, -contents, and fileType properties.
      • image

        @Nullable
        public @Nullable UIImage image()
        Image representing the text attachment contents. Modifying this property invalidates -contents, -fileType, and -FileWrapper properties. API-Since: 7.0
      • imageForBoundsTextContainerCharacterIndex

        @Nullable
        public @Nullable UIImage imageForBoundsTextContainerCharacterIndex​(CGRect imageBounds,
                                                                           @Nullable
                                                                           @Nullable NSTextContainer textContainer,
                                                                           long charIndex)
        Description copied from interface: NSTextAttachmentContainer
        Returns the image object rendered by NSLayoutManager at imageBounds inside textContainer. It should return an image appropriate for the target rendering context derived by arguments to this method. The NSTextAttachment implementation returns -image when non-nil. If -image==nil, it returns an image based on -contents and -fileType properties. API-Since: 7.0
        Specified by:
        imageForBoundsTextContainerCharacterIndex in interface NSTextAttachmentContainer
      • initWithDataOfType

        public NSTextAttachment initWithDataOfType​(@Nullable
                                                   @Nullable NSData contentData,
                                                   @Nullable
                                                   @Nullable java.lang.String uti)
        Designated initializer. Both arguments can be nil. When contentData==nil || uti==nil, the receiver is consider to be an attachment without document contents. In this case, the NSAttributedString methods writing external file format tries to save the return value of -[NSTextAttachment image] instead. API-Since: 7.0
      • setBounds

        public void setBounds​(CGRect value)
        Defines the layout bounds of the receiver's graphical representation in the text coordinate system. The origin is at the glyph location on the text baseline. The default value is CGRectZero. API-Since: 7.0
      • setContents

        public void setContents​(@Nullable
                                @Nullable NSData value)
        These two properties define the contents for the text attachment. Modifying these properties have a side effect of invalidating -image and -fileWrapper properties. -fileType is an UTI describing the format for -contents. API-Since: 7.0
      • setFileType

        public void setFileType​(@Nullable
                                @Nullable java.lang.String value)
        API-Since: 7.0
      • setFileWrapper

        public void setFileWrapper​(@Nullable
                                   @Nullable NSFileWrapper value)
        Optionally, NSTextAttachment can be associated with a file wrapper. Modifying this property has a side effect of invalidating -image, -contents, and fileType properties.
      • setImage

        public void setImage​(@Nullable
                             @Nullable UIImage value)
        Image representing the text attachment contents. Modifying this property invalidates -contents, -fileType, and -FileWrapper properties. API-Since: 7.0
      • 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
      • textAttachmentWithImage

        @NotNull
        public static @NotNull NSTextAttachment textAttachmentWithImage​(@NotNull
                                                                        @NotNull UIImage image)
        API-Since: 13.0
      • allowsTextAttachmentView

        public boolean allowsTextAttachmentView()
        When YES, the text attachment tries to use a text attachment view returned by -viewProviderForParentView:location:textContainer:. YES by default API-Since: 15.0
      • attachmentBoundsForAttributesLocationTextContainerProposedLineFragmentPosition

        public CGRect attachmentBoundsForAttributesLocationTextContainerProposedLineFragmentPosition​(@NotNull
                                                                                                     @NotNull NSDictionary<java.lang.String,​?> attributes,
                                                                                                     @NotNull
                                                                                                     @NotNull NSTextLocation location,
                                                                                                     @Nullable
                                                                                                     @Nullable NSTextContainer textContainer,
                                                                                                     CGRect proposedLineFragment,
                                                                                                     CGPoint position)
        Description copied from interface: NSTextAttachmentLayout
        Returns the layout bounds. The bounds origin is interpreted to match position inside proposedLineFragment. The NSTextAttachment implementation returns -bounds if not CGRectZero; otherwise, it derives the bounds value from image.size. Conforming objects can implement more sophisticated logic for negotiating the frame size based on the available container space and proposed line fragment rect. API-Since: 15.0
        Specified by:
        attachmentBoundsForAttributesLocationTextContainerProposedLineFragmentPosition in interface NSTextAttachmentLayout
      • imageForBoundsAttributesLocationTextContainer

        @Nullable
        public @Nullable UIImage imageForBoundsAttributesLocationTextContainer​(CGRect bounds,
                                                                               @NotNull
                                                                               @NotNull NSDictionary<java.lang.String,​?> attributes,
                                                                               @NotNull
                                                                               @NotNull NSTextLocation location,
                                                                               @Nullable
                                                                               @Nullable NSTextContainer textContainer)
        Description copied from interface: NSTextAttachmentLayout
        Returns the image object rendered at bounds inside textContainer. It should return an image appropriate for the target rendering context derived by arguments to this method. The NSTextAttachment implementation returns -image when non-nil. If -image==nil, it returns an image based on -contents and -fileType properties. API-Since: 15.0
        Specified by:
        imageForBoundsAttributesLocationTextContainer in interface NSTextAttachmentLayout
      • lineLayoutPadding

        public double lineLayoutPadding()
        Layout padding before and after the text attachment bounds. The layout and rendering bounds X origin gets inset by the padding value. This affects the relationship between the text attachment bounds. 0.0 by default API-Since: 15.0
      • registerTextAttachmentViewProviderClassForFileType

        public static void registerTextAttachmentViewProviderClassForFileType​(@NotNull
                                                                              @NotNull org.moe.natj.objc.Class textAttachmentViewProviderClass,
                                                                              @NotNull
                                                                              @NotNull java.lang.String fileType)
        API-Since: 15.0
      • setAllowsTextAttachmentView

        public void setAllowsTextAttachmentView​(boolean value)
        When YES, the text attachment tries to use a text attachment view returned by -viewProviderForParentView:location:textContainer:. YES by default API-Since: 15.0
      • setLineLayoutPadding

        public void setLineLayoutPadding​(double value)
        Layout padding before and after the text attachment bounds. The layout and rendering bounds X origin gets inset by the padding value. This affects the relationship between the text attachment bounds. 0.0 by default API-Since: 15.0
      • textAttachmentViewProviderClassForFileType

        @Nullable
        public static @Nullable org.moe.natj.objc.Class textAttachmentViewProviderClassForFileType​(@NotNull
                                                                                                   @NotNull java.lang.String fileType)
        Factory methods for defining the mapping between UTI and text attachment view provider class API-Since: 15.0
      • usesTextAttachmentView

        public boolean usesTextAttachmentView()
        Returns YES if the text attachment is configured to use text attachment views. By default, it checks -allowsTextAttachmentView, +textAttachmentViewClassForFileType:, and its contents API-Since: 15.0
      • viewProviderForParentViewLocationTextContainer

        @Nullable
        public @Nullable NSTextAttachmentViewProvider viewProviderForParentViewLocationTextContainer​(@Nullable
                                                                                                     @Nullable UIView parentView,
                                                                                                     @NotNull
                                                                                                     @NotNull NSTextLocation location,
                                                                                                     @Nullable
                                                                                                     @Nullable NSTextContainer textContainer)
        Description copied from interface: NSTextAttachmentLayout
        Returns the text attachment view provider corresponding to -fileType. The default implementation queries the text attachment view provider class via +[NSTextAttachment textAttachmentViewProviderClassForFileType:]. When non-nil, it instantiates a view, then, fills properties declared in NSTextAttachmentViewProvider if implemented API-Since: 15.0
        Specified by:
        viewProviderForParentViewLocationTextContainer in interface NSTextAttachmentLayout
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.