Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CoreSpotlight] Updated spotlight bindings for xcode 9. #2193

Merged
merged 6 commits into from
Jul 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/CoreSpotlight/CSSearchableItemAttributeSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System;
using XamCore.Foundation;
using XamCore.ObjCRuntime;

namespace XamCore.CoreSpotlight {

Expand All @@ -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;
}
}
}
}

Expand Down
45 changes: 45 additions & 0 deletions src/corespotlight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we know which type is exposed ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really, it is not very clear, it is an integer but not sure about the size.


// 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)]
Expand Down