diff --git a/src/Constants.iOS.cs.in b/src/Constants.iOS.cs.in index 7d9412c2d9..bba21b28b3 100644 --- a/src/Constants.iOS.cs.in +++ b/src/Constants.iOS.cs.in @@ -114,5 +114,6 @@ namespace MonoTouch { public const string CoreMLLibrary = "/System/Library/Frameworks/CoreML.framework/CoreML"; public const string VisionLibrary = "/System/Library/Frameworks/Vision.framework/Vision"; public const string FileProviderLibrary = "/System/Library/Frameworks/FileProvider.framework/FileProvider"; + public const string FileProviderUILibrary = "/System/Library/Frameworks/FileProviderUI.framework/FileProviderUI"; } } diff --git a/src/fileproviderui.cs b/src/fileproviderui.cs new file mode 100644 index 0000000000..9428c47d82 --- /dev/null +++ b/src/fileproviderui.cs @@ -0,0 +1,65 @@ +// +// FileProvider C# bindings +// +// Authors: +// Alex Soto +// +// Copyright 2017 Xamarin Inc. All rights reserved. +// + +#if XAMCORE_2_0 + +using System; +using XamCore.ObjCRuntime; +using XamCore.Foundation; +using XamCore.UIKit; +using XamCore.FileProvider; + +namespace XamCore.FileProviderUI { + + [iOS (11,0)] + [ErrorDomain ("FPUIErrorDomain")] + [Native] + enum FPUIExtensionErrorCode : nuint { + UserCancelled, + Failed + } + + [iOS (11,0)] + [DisableDefaultCtor] + [BaseType (typeof (NSExtensionContext))] + interface FPUIActionExtensionContext { + + [NullAllowed, Export ("domainIdentifier")] + string DomainIdentifier { get; } + + [Export ("completeRequest")] + void CompleteRequest (); + + [Export ("cancelRequestWithError:")] + void CancelRequest (NSError error); + } + + [iOS (11,0)] + [BaseType (typeof (UIViewController))] + interface FPUIActionExtensionViewController { + + [Export ("initWithNibName:bundle:")] + [PostGet ("NibBundle")] + IntPtr Constructor ([NullAllowed] string nibName, [NullAllowed] NSBundle bundle); + + [Export ("extensionContext", ArgumentSemantic.Strong)] + FPUIActionExtensionContext ExtensionContext { get; } + + [Export ("prepareForError:")] + void Prepare (NSError error); + + [Protected] + [Export ("prepareForActionWithIdentifier:itemIdentifiers:")] + void Prepare (string actionIdentifier, NSString [] itemIdentifiers); + + [Wrap ("Prepare (actionIdentifier, itemIdentifiers.GetConstants())")] + void Prepare (string actionIdentifier, NSFileProviderItemIdentifier [] itemIdentifiers); + } +} +#endif diff --git a/src/frameworks.sources b/src/frameworks.sources index bf1129ffb3..e069496273 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -1659,6 +1659,7 @@ IOS_FRAMEWORKS = \ EventKitUI \ ExternalAccessory \ FileProvider \ + FileProviderUI \ GLKit \ GameController \ GameplayKit \ diff --git a/tests/introspection/iOS/iOSApiProtocolTest.cs b/tests/introspection/iOS/iOSApiProtocolTest.cs index 37bee14364..0244527237 100644 --- a/tests/introspection/iOS/iOSApiProtocolTest.cs +++ b/tests/introspection/iOS/iOSApiProtocolTest.cs @@ -206,6 +206,7 @@ namespace Introspection { case "ILMessageFilterExtensionContext": // Conformance not in headers case "MSMessageLiveLayout": case "NSFileProviderDomain": // Conformance not in headers + case "FPUIActionExtensionContext": // Conformance not in headers return true; #if __WATCHOS__ case "CLKComplicationTemplate": @@ -340,6 +341,7 @@ namespace Introspection { case "NSRelationshipDescription": case "MSMessageLiveLayout": case "NSFileProviderDomain": // Conformance not in headers + case "FPUIActionExtensionContext": // Conformance not in headers return true; #if __WATCHOS__ case "CLKComplicationTemplate": @@ -425,6 +427,7 @@ namespace Introspection { case "ILMessageFilterExtensionContext": // b2: Conformance not in headers case "HMCharacteristicEvent": // Selectors not available on 32 bit case "NSFileProviderDomain": // Conformance not in headers + case "FPUIActionExtensionContext": // Conformance not in headers return true; #if __WATCHOS__ diff --git a/tools/common/Frameworks.cs b/tools/common/Frameworks.cs index fda7d7b968..2f4b0640a5 100644 --- a/tools/common/Frameworks.cs +++ b/tools/common/Frameworks.cs @@ -252,6 +252,7 @@ public class Frameworks : Dictionary { "CoreML", "CoreML", 11 }, { "Vision", "Vision", 11 }, { "FileProvider", "FileProvider", 11 }, + { "FileProviderUI", "FileProviderUI", 11 }, }; } return ios_frameworks; diff --git a/tools/mtouch/Makefile b/tools/mtouch/Makefile index c419a33c59..796eb27dee 100644 --- a/tools/mtouch/Makefile +++ b/tools/mtouch/Makefile @@ -271,7 +271,9 @@ SIMLAUNCHER_FRAMEWORKS = \ -weak_framework Intents \ -weak_framework IntentsUI \ \ - -weak_framework ARKit + -weak_framework ARKit \ + -weak_framework FileProvider \ + -weak_framework FileProviderUI # note: there _was_ no CoreAudioKit.framework or Metal.framework for the simulator (before recent iOS9 betas) # note 2: there's no GameKit, in iOS 9 (beta 3 at least), you're supposed to reference GameCenter instead (looks fixed in beta 4)