diff --git a/src/foundation.cs b/src/foundation.cs index 49d5f9118799..5e5a43030439 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -37,6 +37,7 @@ using CoreFoundation; using Foundation; using CoreGraphics; +using UniformTypeIdentifiers; #if HAS_APPCLIP using AppClip; #endif @@ -10351,8 +10352,44 @@ CGSize PreferredPresentationSize { [MacCatalyst (13, 0)] [Export ("preferredPresentationStyle", ArgumentSemantic.Assign)] UIPreferredPresentationStyle PreferredPresentationStyle { get; set; } + + // from interface UTType (NSItemProvider) + + [Watch (9,0), TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("initWithContentsOfURL:contentType:openInPlace:coordinated:visibility:")] + NativeHandle Constructor (NSUrl fileUrl, [NullAllowed] UTType contentType, bool openInPlace, bool coordinated, NSItemProviderRepresentationVisibility visibility); + + [Watch (9,0), TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("registerDataRepresentationForContentType:visibility:loadHandler:")] + void RegisterDataRepresentation (UTType contentType, NSItemProviderRepresentationVisibility visibility, NSItemProviderUTTypeLoadDelegate loadHandler); + + [Watch (9,0), TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("registerFileRepresentationForContentType:visibility:openInPlace:loadHandler:")] + void RegisterFileRepresentation (UTType contentType, NSItemProviderRepresentationVisibility visibility, bool openInPlace, NSItemProviderUTTypeLoadDelegate loadHandler); + + [Watch (9,0), TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("registeredContentTypes", ArgumentSemantic.Copy)] + UTType[] RegisteredContentTypes { get; } + + [Watch (9,0), TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("registeredContentTypesForOpenInPlace", ArgumentSemantic.Copy)] + UTType[] RegisteredContentTypesForOpenInPlace { get; } + + [Watch (9,0), TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("registeredContentTypesConformingToContentType:")] + UTType[] RegisteredContentTypesConforming (UTType contentType); + + [Watch (9,0), TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("loadDataRepresentationForContentType:completionHandler:")] + NSProgress LoadDataRepresentation (UTType contentType, ItemProviderDataCompletionHandler completionHandler); + + [Watch (9,0), TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("loadFileRepresentationForContentType:openInPlace:completionHandler:")] + NSProgress LoadFileRepresentation (UTType contentType, bool openInPlace, ItemProviderDataCompletionHandler completionHandler); } + [Watch (9,0), TV (16,0), Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + delegate NSProgress NSItemProviderUTTypeLoadDelegate ([BlockCallback] ItemProviderDataCompletionHandler completionHandler); delegate NSProgress RegisterFileRepresentationLoadHandler ([BlockCallback] RegisterFileRepresentationCompletionHandler completionHandler); delegate void RegisterFileRepresentationCompletionHandler (NSUrl fileUrl, bool coordinated, NSError error); delegate void ItemProviderDataCompletionHandler (NSData data, NSError error); diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-UniformTypeIdentifiers.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-UniformTypeIdentifiers.todo deleted file mode 100644 index 1c969785eaa3..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-UniformTypeIdentifiers.todo +++ /dev/null @@ -1,8 +0,0 @@ -!missing-selector! NSItemProvider::initWithContentsOfURL:contentType:openInPlace:coordinated:visibility: not bound -!missing-selector! NSItemProvider::loadDataRepresentationForContentType:completionHandler: not bound -!missing-selector! NSItemProvider::loadFileRepresentationForContentType:openInPlace:completionHandler: not bound -!missing-selector! NSItemProvider::registerDataRepresentationForContentType:visibility:loadHandler: not bound -!missing-selector! NSItemProvider::registeredContentTypes not bound -!missing-selector! NSItemProvider::registeredContentTypesConformingToContentType: not bound -!missing-selector! NSItemProvider::registeredContentTypesForOpenInPlace not bound -!missing-selector! NSItemProvider::registerFileRepresentationForContentType:visibility:openInPlace:loadHandler: not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-UniformTypeIdentifiers.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-UniformTypeIdentifiers.todo deleted file mode 100644 index 1c969785eaa3..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-UniformTypeIdentifiers.todo +++ /dev/null @@ -1,8 +0,0 @@ -!missing-selector! NSItemProvider::initWithContentsOfURL:contentType:openInPlace:coordinated:visibility: not bound -!missing-selector! NSItemProvider::loadDataRepresentationForContentType:completionHandler: not bound -!missing-selector! NSItemProvider::loadFileRepresentationForContentType:openInPlace:completionHandler: not bound -!missing-selector! NSItemProvider::registerDataRepresentationForContentType:visibility:loadHandler: not bound -!missing-selector! NSItemProvider::registeredContentTypes not bound -!missing-selector! NSItemProvider::registeredContentTypesConformingToContentType: not bound -!missing-selector! NSItemProvider::registeredContentTypesForOpenInPlace not bound -!missing-selector! NSItemProvider::registerFileRepresentationForContentType:visibility:openInPlace:loadHandler: not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UniformTypeIdentifiers.todo b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UniformTypeIdentifiers.todo deleted file mode 100644 index 1c969785eaa3..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-UniformTypeIdentifiers.todo +++ /dev/null @@ -1,8 +0,0 @@ -!missing-selector! NSItemProvider::initWithContentsOfURL:contentType:openInPlace:coordinated:visibility: not bound -!missing-selector! NSItemProvider::loadDataRepresentationForContentType:completionHandler: not bound -!missing-selector! NSItemProvider::loadFileRepresentationForContentType:openInPlace:completionHandler: not bound -!missing-selector! NSItemProvider::registerDataRepresentationForContentType:visibility:loadHandler: not bound -!missing-selector! NSItemProvider::registeredContentTypes not bound -!missing-selector! NSItemProvider::registeredContentTypesConformingToContentType: not bound -!missing-selector! NSItemProvider::registeredContentTypesForOpenInPlace not bound -!missing-selector! NSItemProvider::registerFileRepresentationForContentType:visibility:openInPlace:loadHandler: not bound diff --git a/tests/xtro-sharpie/iOS-UniformTypeIdentifiers.todo b/tests/xtro-sharpie/iOS-UniformTypeIdentifiers.todo deleted file mode 100644 index 1c969785eaa3..000000000000 --- a/tests/xtro-sharpie/iOS-UniformTypeIdentifiers.todo +++ /dev/null @@ -1,8 +0,0 @@ -!missing-selector! NSItemProvider::initWithContentsOfURL:contentType:openInPlace:coordinated:visibility: not bound -!missing-selector! NSItemProvider::loadDataRepresentationForContentType:completionHandler: not bound -!missing-selector! NSItemProvider::loadFileRepresentationForContentType:openInPlace:completionHandler: not bound -!missing-selector! NSItemProvider::registerDataRepresentationForContentType:visibility:loadHandler: not bound -!missing-selector! NSItemProvider::registeredContentTypes not bound -!missing-selector! NSItemProvider::registeredContentTypesConformingToContentType: not bound -!missing-selector! NSItemProvider::registeredContentTypesForOpenInPlace not bound -!missing-selector! NSItemProvider::registerFileRepresentationForContentType:visibility:openInPlace:loadHandler: not bound diff --git a/tests/xtro-sharpie/macOS-UniformTypeIdentifiers.todo b/tests/xtro-sharpie/macOS-UniformTypeIdentifiers.todo deleted file mode 100644 index 1c969785eaa3..000000000000 --- a/tests/xtro-sharpie/macOS-UniformTypeIdentifiers.todo +++ /dev/null @@ -1,8 +0,0 @@ -!missing-selector! NSItemProvider::initWithContentsOfURL:contentType:openInPlace:coordinated:visibility: not bound -!missing-selector! NSItemProvider::loadDataRepresentationForContentType:completionHandler: not bound -!missing-selector! NSItemProvider::loadFileRepresentationForContentType:openInPlace:completionHandler: not bound -!missing-selector! NSItemProvider::registerDataRepresentationForContentType:visibility:loadHandler: not bound -!missing-selector! NSItemProvider::registeredContentTypes not bound -!missing-selector! NSItemProvider::registeredContentTypesConformingToContentType: not bound -!missing-selector! NSItemProvider::registeredContentTypesForOpenInPlace not bound -!missing-selector! NSItemProvider::registerFileRepresentationForContentType:visibility:openInPlace:loadHandler: not bound diff --git a/tests/xtro-sharpie/tvOS-UniformTypeIdentifiers.todo b/tests/xtro-sharpie/tvOS-UniformTypeIdentifiers.todo deleted file mode 100644 index 1c969785eaa3..000000000000 --- a/tests/xtro-sharpie/tvOS-UniformTypeIdentifiers.todo +++ /dev/null @@ -1,8 +0,0 @@ -!missing-selector! NSItemProvider::initWithContentsOfURL:contentType:openInPlace:coordinated:visibility: not bound -!missing-selector! NSItemProvider::loadDataRepresentationForContentType:completionHandler: not bound -!missing-selector! NSItemProvider::loadFileRepresentationForContentType:openInPlace:completionHandler: not bound -!missing-selector! NSItemProvider::registerDataRepresentationForContentType:visibility:loadHandler: not bound -!missing-selector! NSItemProvider::registeredContentTypes not bound -!missing-selector! NSItemProvider::registeredContentTypesConformingToContentType: not bound -!missing-selector! NSItemProvider::registeredContentTypesForOpenInPlace not bound -!missing-selector! NSItemProvider::registerFileRepresentationForContentType:visibility:openInPlace:loadHandler: not bound diff --git a/tests/xtro-sharpie/watchOS-UniformTypeIdentifiers.todo b/tests/xtro-sharpie/watchOS-UniformTypeIdentifiers.todo deleted file mode 100644 index 1c969785eaa3..000000000000 --- a/tests/xtro-sharpie/watchOS-UniformTypeIdentifiers.todo +++ /dev/null @@ -1,8 +0,0 @@ -!missing-selector! NSItemProvider::initWithContentsOfURL:contentType:openInPlace:coordinated:visibility: not bound -!missing-selector! NSItemProvider::loadDataRepresentationForContentType:completionHandler: not bound -!missing-selector! NSItemProvider::loadFileRepresentationForContentType:openInPlace:completionHandler: not bound -!missing-selector! NSItemProvider::registerDataRepresentationForContentType:visibility:loadHandler: not bound -!missing-selector! NSItemProvider::registeredContentTypes not bound -!missing-selector! NSItemProvider::registeredContentTypesConformingToContentType: not bound -!missing-selector! NSItemProvider::registeredContentTypesForOpenInPlace not bound -!missing-selector! NSItemProvider::registerFileRepresentationForContentType:visibility:openInPlace:loadHandler: not bound