diff --git a/src/CoreSpotlight/CSSearchableItemAttributeSet.cs b/src/CoreSpotlight/CSSearchableItemAttributeSet.cs index f761e94e0c2a..807861c077ea 100644 --- a/src/CoreSpotlight/CSSearchableItemAttributeSet.cs +++ b/src/CoreSpotlight/CSSearchableItemAttributeSet.cs @@ -4,6 +4,7 @@ using System; using XamCore.Foundation; +using XamCore.ObjCRuntime; namespace XamCore.CoreSpotlight { @@ -17,6 +18,34 @@ public INSSecureCoding this [CSCustomAttributeKey key] { SetValue (value, key); } } + + // Manually deal with these properties until we get BindAs working + [iOS (11,0), NoTV, Mac (10, 11)] + public bool? IsUserCreated { + get { + return _IsUserCreated?.BoolValue; + } set { + _IsUserCreated = value.HasValue ? new NSNumber (value.Value) : null; + } + } + + [iOS (11, 0), NoTV, Mac (10, 11)] + public bool? IsUserOwned { + get { + return _IsUserOwned?.BoolValue; + } set { + _IsUserOwned = value.HasValue ? new NSNumber (value.Value) : null; + } + } + + [iOS (11, 0), NoTV, Mac (10, 11)] + public bool? IsUserCurated { + get { + return _IsUserCurated?.BoolValue; + } set { + _IsUserCurated = value.HasValue ? new NSNumber (value.Value) : null; + } + } } } diff --git a/src/corespotlight.cs b/src/corespotlight.cs index 2302c8b58ca9..08236e41cc06 100644 --- a/src/corespotlight.cs +++ b/src/corespotlight.cs @@ -124,6 +124,16 @@ interface CSSearchableIndexDelegate { [Export ("searchableIndexDidFinishThrottle:")] void DidFinishThrottle (CSSearchableIndex searchableIndex); + + [iOS (11,0), NoTV, Mac (10,13)] + [Export ("dataForSearchableIndex:itemIdentifier:typeIdentifier:error:")] + [return: NullAllowed] + NSData GetData (CSSearchableIndex searchableIndex, string itemIdentifier, string typeIdentifier, out NSError outError); + + [iOS (11,0), NoTV, Mac (10,13)] + [Export ("fileURLForSearchableIndex:itemIdentifier:typeIdentifier:inPlace:error:")] + [return: NullAllowed] + NSUrl GetFileUrl (CSSearchableIndex searchableIndex, string itemIdentifier, string typeIdentifier, bool inPlace, out NSError outError); } [NoTV] // CS_TVOS_UNAVAILABLE @@ -979,6 +989,41 @@ interface CSSearchableItemAttributeSet : NSCopying, NSSecureCoding { [Export ("valueForCustomKey:")] [return: NullAllowed] INSSecureCoding ValueForCustomKey (CSCustomAttributeKey key); + + // CSSearchableItemAttributeSet_CSGeneral + + [iOS (11,0), NoTV, Mac (10, 11)] + [NullAllowed, Export ("userCreated", ArgumentSemantic.Strong)] + [Internal] // We would like to use [BindAs (typeof (bool?))] + NSNumber _IsUserCreated { [Bind ("isUserCreated")] get; set; } + + [iOS (11, 0), NoTV, Mac (10, 11)] + [NullAllowed, Export ("userOwned", ArgumentSemantic.Strong)] + [Internal] // We would like to use[BindAs (typeof (bool?))] + NSNumber _IsUserOwned { [Bind ("isUserOwned")] get; set; } + + [iOS (11, 0), NoTV, Mac (10, 11)] + [NullAllowed, Export ("userCurated", ArgumentSemantic.Strong)] + [Internal] // We would like to use [BindAs (typeof (bool?))] + NSNumber _IsUserCurated { [Bind ("isUserCurated")] get; set; } + + [iOS (11, 0), NoTV, Mac (10, 11)] + [NullAllowed, Export ("rankingHint", ArgumentSemantic.Strong)] + NSNumber RankingHint { get; set; } + + // CSSearchableItemAttributeSet_CSItemProvider + + [iOS (11, 0), NoTV, Mac (10, 11)] + [NullAllowed, Export ("providerDataTypeIdentifiers", ArgumentSemantic.Copy)] + string[] ProviderDataTypeIdentifiers { get; set; } + + [iOS (11, 0), NoTV, Mac (10, 11)] + [NullAllowed, Export ("providerFileTypeIdentifiers", ArgumentSemantic.Copy)] + string[] ProviderFileTypeIdentifiers { get; set; } + + [iOS (11, 0), NoTV, Mac (10, 11)] + [NullAllowed, Export ("providerInPlaceFileTypeIdentifiers", ArgumentSemantic.Copy)] + string[] ProviderInPlaceFileTypeIdentifiers { get; set; } } [NoTV][iOS (10,0)]