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] Add support for xcode 15. #18918

Merged
Show file tree
Hide file tree
Changes from 4 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
12 changes: 12 additions & 0 deletions src/Foundation/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1371,4 +1371,16 @@ public enum NSUrlSessionDelayedRequestDisposition : long {
public enum NSXpcConnectionOptions : ulong {
Privileged = (1 << 12),
}

[Mac (11, 0), MacCatalyst (13, 1)]
public enum NSFileProtectionType {
[Field ("NSFileProtectionComplete")]
Complete,
[Field ("NSFileProtectionCompleteUnlessOpen")]
CompleteUnlessOpen,
[Field ("NSFileProtectionCompleteUntilFirstUserAuthentication")]
CompleteUntilFirstUserAuthentication,
[Field ("NSFileProtectionNone")]
None,
}
}
17 changes: 17 additions & 0 deletions src/corespotlight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ interface CSSearchableIndex {
[Export ("initWithName:protectionClass:")]
NativeHandle Constructor (string name, [NullAllowed] NSString protectionClass);

[EditorBrowsable (EditorBrowsableState.Advanced)]
[iOS (9, 0), Mac (10, 11), MacCatalyst (13, 1), NoTV, NoWatch]
[Export ("initWithName:protectionClass:bundleIdentifier:options:")]
NativeHandle Constructor (string name, [NullAllowed] string protectionClass, string bundleIdentifier, nint options);
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Agreed, let's add the enum

mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved

[Wrap ("this (name, protectionClass.GetConstant (), bundleIdentifier, options)")]
[iOS (9, 0), Mac (10, 11), MacCatalyst (13, 1), NoTV, NoWatch]
NativeHandle Constructor (string name, NSFileProtectionType protectionClass, string bundleIdentifier, nint options);

[Export ("indexSearchableItems:completionHandler:")]
[Async]
void Index (CSSearchableItem [] items, [NullAllowed] Action<NSError> completionHandler);
Expand Down Expand Up @@ -1190,6 +1199,14 @@ interface CSSuggestion : NSSecureCoding, NSCopying {

[Export ("compareByRank:")]
NSComparisonResult CompareByRank (CSSuggestion other);

[iOS (16, 0), MacCatalyst (16, 0), Mac (13, 0), NoTV, NoWatch]
[Export ("score")]
NSNumber Score { get; }

[iOS (16, 0), MacCatalyst (16, 0), Mac (13, 0), NoTV, NoWatch]
[Export ("suggestionDataSources")]
NSObject [] SuggestionDataSources { get; }
}

[NoTV, Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0)]
Expand Down
4 changes: 4 additions & 0 deletions src/foundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13444,21 +13444,25 @@ partial interface NSFileManager {
[Field ("NSFileProtectionKey")]
NSString FileProtectionKey { get; }

[Obsolete ("Use the 'NSFileProtectionType' instead.")]
[Mac (11, 0)]
[MacCatalyst (13, 1)]
[Field ("NSFileProtectionNone")]
NSString FileProtectionNone { get; }

[Obsolete ("Use the 'NSFileProtectionType' instead.")]
[Mac (11, 0)]
[MacCatalyst (13, 1)]
[Field ("NSFileProtectionComplete")]
NSString FileProtectionComplete { get; }

[Obsolete ("Use the 'NSFileProtectionType' instead.")]
[Mac (11, 0)]
[MacCatalyst (13, 1)]
[Field ("NSFileProtectionCompleteUnlessOpen")]
NSString FileProtectionCompleteUnlessOpen { get; }

[Obsolete ("Use the 'NSFileProtectionType' instead.")]
[Mac (11, 0)]
[MacCatalyst (13, 1)]
[Field ("NSFileProtectionCompleteUntilFirstUserAuthentication")]
Expand Down

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions tests/xtro-sharpie/iOS-CoreSpotlight.todo

This file was deleted.

3 changes: 0 additions & 3 deletions tests/xtro-sharpie/macOS-CoreSpotlight.todo

This file was deleted.

Loading