Class NSItemProvider

  • All Implemented Interfaces:
    NSCopying, NSObject

    public class NSItemProvider
    extends NSObject
    implements NSCopying
    An NSItemProvider is a high level abstraction for an item supporting multiple representations.
    • Constructor Detail

      • NSItemProvider

        protected NSItemProvider​(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()
      • copyWithZone

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

        public boolean hasItemConformingToTypeIdentifier​(java.lang.String typeIdentifier)
        Returns YES if the item provider has at least one item that conforms to the supplied type identifier.
      • initWithContentsOfURL

        public NSItemProvider initWithContentsOfURL​(NSURL fileURL)
        Initialize an NSItemProvider with load handlers for the given file URL, and the file content. A type identifier is inferred from the file extension.
      • initWithItemTypeIdentifier

        public NSItemProvider initWithItemTypeIdentifier​(NSSecureCoding item,
                                                         java.lang.String typeIdentifier)
        Initialize an NSItemProvider with an object assigned to a single UTI. `item` is retained.
      • loadItemForTypeIdentifierOptionsCompletionHandler

        public void loadItemForTypeIdentifierOptionsCompletionHandler​(java.lang.String typeIdentifier,
                                                                      NSDictionary<?,​?> options,
                                                                      NSItemProvider.Block_loadItemForTypeIdentifierOptionsCompletionHandler completionHandler)
        Loads the best matching item for a type identifier. The returned object depends on the class specified for the completion handler's `item` parameter. See the table above for coercion rules.
      • loadPreviewImageWithOptionsCompletionHandler

        public void loadPreviewImageWithOptionsCompletionHandler​(NSDictionary<?,​?> options,
                                                                 NSItemProvider.Block_loadPreviewImageWithOptionsCompletionHandler completionHandler)
        Loads the preview image for this item by either calling the supplied preview block or falling back to a QuickLook-based handler. This method, like loadItemForTypeIdentifier:options:completionHandler:, supports implicit type coercion for the item parameter of the completion block. Allowed value classes are: NSData, NSURL, UIImage/NSImage.
      • registeredTypeIdentifiers

        public NSArray<java.lang.String> registeredTypeIdentifiers()
        Returns the list of registered type identifiers, in the order they were registered.
      • hasRepresentationConformingToTypeIdentifierFileOptions

        public boolean hasRepresentationConformingToTypeIdentifierFileOptions​(java.lang.String typeIdentifier,
                                                                              long fileOptions)
      • initWithObject

        public NSItemProvider initWithObject​(NSItemProviderWriting object)
        Instantiate an NSItemProvider by querying an object for its eligible type identifiers via the NSItemProviderWriting protocol.
      • loadFileRepresentationForTypeIdentifierCompletionHandler

        public NSProgress loadFileRepresentationForTypeIdentifierCompletionHandler​(java.lang.String typeIdentifier,
                                                                                   NSItemProvider.Block_loadFileRepresentationForTypeIdentifierCompletionHandler completionHandler)
        Writes a copy of the data to a temporary file. This file will be deleted when the completion handler returns. Your program should copy or move the file within the completion handler.
      • loadInPlaceFileRepresentationForTypeIdentifierCompletionHandler

        public NSProgress loadInPlaceFileRepresentationForTypeIdentifierCompletionHandler​(java.lang.String typeIdentifier,
                                                                                          NSItemProvider.Block_loadInPlaceFileRepresentationForTypeIdentifierCompletionHandler completionHandler)
        Open the original file in place, if possible. If a file is not available for opening in place, a copy of the file is written to a temporary location, and `isInPlace` is set to NO. Your program may then copy or move the file, or the system will delete this file at some point in the future.
      • preferredPresentationSize

        public CGSize preferredPresentationSize()
        Estimated presentation size, in points. CGSizeZero value indicates this information is not available.
      • preferredPresentationStyle

        public long preferredPresentationStyle()
      • registerObjectVisibility

        public void registerObjectVisibility​(NSItemProviderWriting object,
                                             long visibility)
        Add representations from an object using the NSItemProviderWriting protocol. Duplicate representations are ignored.
      • registeredTypeIdentifiersWithFileOptions

        public NSArray<java.lang.String> registeredTypeIdentifiersWithFileOptions​(long fileOptions)
      • setPreferredPresentationSize

        public void setPreferredPresentationSize​(CGSize value)
        Estimated presentation size, in points. CGSizeZero value indicates this information is not available.
      • setPreferredPresentationStyle

        public void setPreferredPresentationStyle​(long value)
      • setSuggestedName

        public void setSuggestedName​(java.lang.String value)
      • setTeamData

        public void setTeamData​(NSData value)
      • suggestedName

        public java.lang.String suggestedName()
      • teamData

        public NSData teamData()
      • previewImageHandler

        public NSItemProvider.Block_previewImageHandler_ret previewImageHandler()
        Sets a custom preview image handler block for this item provider. The returned item should preferably be NSData or a file NSURL.
      • registerFileRepresentationForTypeIdentifierFileOptionsVisibilityLoadHandler

        public void registerFileRepresentationForTypeIdentifierFileOptionsVisibilityLoadHandler​(java.lang.String typeIdentifier,
                                                                                                long fileOptions,
                                                                                                long visibility,
                                                                                                NSItemProvider.Block_registerFileRepresentationForTypeIdentifierFileOptionsVisibilityLoadHandler loadHandler)
        Registers a file-backed representation. Set `coordinated` to YES if the returned file must be accessed using NSFileCoordinator. If `NSItemProviderFileOptionOpenInPlace` is not provided, the file provided will be copied before the load handler returns.
      • setPreviewImageHandler

        public void setPreviewImageHandler​(NSItemProvider.Block_setPreviewImageHandler value)
        Sets a custom preview image handler block for this item provider. The returned item should preferably be NSData or a file NSURL.