Skip to content

Commit d4befb8

Browse files
authored
[CoreSpotlight] Implement up to Xcode 16.3 beta 2. (#22330)
1 parent c7f28d2 commit d4befb8

File tree

11 files changed

+85
-52
lines changed

11 files changed

+85
-52
lines changed

src/CoreSpotlight/CSEnums.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public enum CSFileProtection {
7070
CompleteUntilFirstUserAuthentication,
7171
}
7272

73-
[NoTV, Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
73+
[TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
7474
[Native]
7575
public enum CSUserInteraction : long {
7676
Select,

src/corespotlight.cs

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@
1919

2020
namespace CoreSpotlight {
2121

22+
[Partial]
23+
interface CoreSpotlightConstants {
24+
[Field ("CoreSpotlightVersionNumber")]
25+
double CoreSpotlightVersionNumber { get; }
26+
27+
[Field ("CoreSpotlightVersionString")]
28+
[Internal]
29+
IntPtr _CoreSpotlightVersionString { get; }
30+
31+
[Static]
32+
string CoreSpotlightVersionString {
33+
[Wrap ("Marshal.PtrToStringUTF8 (_CoreSpotlightVersionString)!")]
34+
get;
35+
}
36+
}
37+
2238
/// <summary>Handler for communication between the application and the index on the device. The app does not need to be running for this communication to occur.</summary>
2339
///
2440
/// <related type="externalDocumentation" href="https://developer.apple.com/library/ios/documentation/CoreSpotlight/Reference/CSIndexExtensionRequestHandler_Class/index.html">Apple documentation for <c>CSIndexExtensionRequestHandler</c></related>
@@ -110,7 +126,6 @@ interface CSSearchableIndex {
110126
[Export ("initWithName:")]
111127
NativeHandle Constructor (string name);
112128

113-
[NoMac]
114129
[MacCatalyst (13, 1)]
115130
[Export ("initWithName:protectionClass:")]
116131
NativeHandle Constructor (string name, [NullAllowed] NSString protectionClass);
@@ -221,8 +236,20 @@ interface CSSearchableIndexDelegate {
221236
[Export ("fileURLForSearchableIndex:itemIdentifier:typeIdentifier:inPlace:error:")]
222237
[return: NullAllowed]
223238
NSUrl GetFileUrl (CSSearchableIndex searchableIndex, string itemIdentifier, string typeIdentifier, bool inPlace, out NSError outError);
239+
240+
[NoTV]
241+
[iOS (18, 4), Mac (15, 4), MacCatalyst (18, 4)]
242+
[Export ("searchableItemsForIdentifiers:searchableItemsHandler:")]
243+
void GetSearchableItems (string [] identifiers, CSSearchableIndexDelegateGetSearchableItemsHandler searchableItemsHandler);
244+
245+
[NoTV]
246+
[iOS (18, 4), Mac (15, 4), MacCatalyst (18, 4)]
247+
[Export ("searchableItemsDidUpdate:")]
248+
void DidUpdate (CSSearchableItem [] items);
224249
}
225250

251+
delegate void CSSearchableIndexDelegateGetSearchableItemsHandler (CSSearchableItem [] items);
252+
226253
/// <summary>A uniquely identifiable, searchable object in a <see cref="T:CoreSpotlight.CSSearchableIndex" />.</summary>
227254
///
228255
/// <related type="externalDocumentation" href="https://developer.apple.com/library/ios/documentation/CoreSpotlight/Reference/CSSearchableItem_Class/index.html">Apple documentation for <c>CSSearchableItem</c></related>
@@ -299,6 +326,10 @@ interface CSSearchableItem : NSSecureCoding, NSCopying {
299326
[NoTV]
300327
[Export ("isUpdate", ArgumentSemantic.Assign)]
301328
bool IsUpdate { get; set; }
329+
330+
[NoTV, iOS (18, 4), MacCatalyst (18, 4), Mac (15, 4)]
331+
[Export ("updateListenerOptions", ArgumentSemantic.Assign)]
332+
CSSearchableItemUpdateListenerOptions UpdateListenerOptions { get; set; }
302333
}
303334

304335
/// <summary>Represents a string-like object that returns a locale-specific version of a string.</summary>
@@ -2194,14 +2225,12 @@ interface CSSearchableItemAttributeSet : NSCopying, NSSecureCoding {
21942225
[Field ("CSActionIdentifier")]
21952226
NSString ActionIdentifier { get; }
21962227

2197-
[NoTV, NoMac, iOS (15, 0)]
2198-
[NoMacCatalyst]
2228+
[NoTV, NoMac, iOS (15, 0), MacCatalyst (18, 0)]
21992229
[Export ("actionIdentifiers", ArgumentSemantic.Copy)]
22002230
string [] ActionIdentifiers { get; set; }
22012231

22022232
[NullAllowed]
2203-
[NoTV, NoMac, iOS (15, 0)]
2204-
[NoMacCatalyst]
2233+
[NoTV, NoMac, iOS (15, 0), MacCatalyst (18, 0)]
22052234
[Export ("sharedItemContentType", ArgumentSemantic.Copy)]
22062235
UTType SharedItemContentType { get; set; }
22072236

@@ -2323,6 +2352,26 @@ interface CSSearchableItemAttributeSet : NSCopying, NSSecureCoding {
23232352
[MacCatalyst (13, 1)]
23242353
[NullAllowed, Export ("providerInPlaceFileTypeIdentifiers", ArgumentSemantic.Copy)]
23252354
string [] ProviderInPlaceFileTypeIdentifiers { get; set; }
2355+
2356+
[NoTV]
2357+
[iOS (18, 4), MacCatalyst (18, 4), Mac (15, 4)]
2358+
[Export ("moveFrom:")]
2359+
void MoveFrom (CSSearchableItemAttributeSet sourceAttributeSet);
2360+
2361+
[NoTV]
2362+
[iOS (18, 4), MacCatalyst (18, 4), Mac (15, 4)]
2363+
[Export ("isPriority", ArgumentSemantic.Strong), NullAllowed]
2364+
NSNumber IsPriority { get; }
2365+
2366+
[NoTV]
2367+
[iOS (18, 4), MacCatalyst (18, 4), Mac (15, 4)]
2368+
[Export ("textContentSummary", ArgumentSemantic.Copy), NullAllowed]
2369+
string TextContentSummary { get; }
2370+
2371+
[NoTV]
2372+
[iOS (18, 4), MacCatalyst (18, 4), Mac (15, 4)]
2373+
[Export ("transcribedTextContent", ArgumentSemantic.Strong), NullAllowed]
2374+
string TranscribedTextContent { get; set; }
23262375
}
23272376

23282377
/// <include file="../docs/api/CoreSpotlight/CSSearchQuery.xml" path="/Documentation/Docs[@DocId='T:CoreSpotlight.CSSearchQuery']/*" />
@@ -2520,12 +2569,19 @@ public enum CSSearchQuerySourceOptions : long {
25202569
AllowMail = 1L << 0,
25212570
}
25222571

2523-
[NoTV, iOS (16, 0), MacCatalyst (16, 0)]
2572+
[TV (16, 0), iOS (16, 0), MacCatalyst (16, 0)]
25242573
[Native]
25252574
public enum CSSuggestionKind : long {
25262575
None,
25272576
Custom,
25282577
Default,
25292578
}
25302579

2580+
[Native]
2581+
[TV (18, 4), iOS (18, 4), MacCatalyst (18, 4), Mac (15, 4)]
2582+
public enum CSSearchableItemUpdateListenerOptions : ulong {
2583+
Default = 0,
2584+
Summarization = 1 << 1,
2585+
Priority = 1 << 2,
2586+
}
25312587
}

tests/cecil-tests/Documentation.KnownFailures.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6391,6 +6391,9 @@ F:CoreServices.LSRoles.None
63916391
F:CoreServices.LSRoles.Shell
63926392
F:CoreServices.LSRoles.Viewer
63936393
F:CoreSpotlight.CSIndexErrorCode.MismatchedClientState
6394+
F:CoreSpotlight.CSSearchableItemUpdateListenerOptions.Default
6395+
F:CoreSpotlight.CSSearchableItemUpdateListenerOptions.Priority
6396+
F:CoreSpotlight.CSSearchableItemUpdateListenerOptions.Summarization
63946397
F:CoreSpotlight.CSSearchQuerySourceOptions.AllowMail
63956398
F:CoreSpotlight.CSSearchQuerySourceOptions.Default
63966399
F:CoreSpotlight.CSSuggestionKind.Custom
@@ -28041,6 +28044,7 @@ M:CoreServices.LaunchServices.Open(Foundation.NSUrl)
2804128044
M:CoreServices.LaunchServices.Register(Foundation.NSUrl,System.Boolean)
2804228045
M:CoreServices.LaunchServices.SetDefaultHandlerForUrlScheme(System.String,System.String)
2804328046
M:CoreServices.LaunchServices.SetDefaultRoleHandlerForContentType(System.String,System.String,CoreServices.LSRoles)
28047+
M:CoreSpotlight.CoreSpotlightConstants.#ctor
2804428048
M:CoreSpotlight.CSCustomAttributeKey.#ctor(System.String,System.Boolean,System.Boolean,System.Boolean,System.Boolean)
2804528049
M:CoreSpotlight.CSCustomAttributeKey.#ctor(System.String)
2804628050
M:CoreSpotlight.CSCustomAttributeKey.Copy(Foundation.NSZone)
@@ -28050,8 +28054,10 @@ M:CoreSpotlight.CSImportExtension.Update(CoreSpotlight.CSSearchableItemAttribute
2805028054
M:CoreSpotlight.CSIndexExtensionRequestHandler.BeginRequestWithExtensionContext(Foundation.NSExtensionContext)
2805128055
M:CoreSpotlight.CSIndexExtensionRequestHandler.DidFinishThrottle(CoreSpotlight.CSSearchableIndex)
2805228056
M:CoreSpotlight.CSIndexExtensionRequestHandler.DidThrottle(CoreSpotlight.CSSearchableIndex)
28057+
M:CoreSpotlight.CSIndexExtensionRequestHandler.DidUpdate(CoreSpotlight.CSSearchableItem[])
2805328058
M:CoreSpotlight.CSIndexExtensionRequestHandler.GetData(CoreSpotlight.CSSearchableIndex,System.String,System.String,Foundation.NSError@)
2805428059
M:CoreSpotlight.CSIndexExtensionRequestHandler.GetFileUrl(CoreSpotlight.CSSearchableIndex,System.String,System.String,System.Boolean,Foundation.NSError@)
28060+
M:CoreSpotlight.CSIndexExtensionRequestHandler.GetSearchableItems(System.String[],CoreSpotlight.CSSearchableIndexDelegateGetSearchableItemsHandler)
2805528061
M:CoreSpotlight.CSIndexExtensionRequestHandler.ReindexAllSearchableItems(CoreSpotlight.CSSearchableIndex,System.Action)
2805628062
M:CoreSpotlight.CSIndexExtensionRequestHandler.ReindexSearchableItems(CoreSpotlight.CSSearchableIndex,System.String[],System.Action)
2805728063
M:CoreSpotlight.CSLocalizedString.#ctor(Foundation.NSDictionary)
@@ -28084,12 +28090,16 @@ M:CoreSpotlight.CSSearchableIndex.ProvideDataAsync(System.String,System.String,S
2808428090
M:CoreSpotlight.CSSearchableIndexBundleDataResult.#ctor(Foundation.NSData)
2808528091
M:CoreSpotlight.CSSearchableIndexDelegate_Extensions.DidFinishThrottle(CoreSpotlight.ICSSearchableIndexDelegate,CoreSpotlight.CSSearchableIndex)
2808628092
M:CoreSpotlight.CSSearchableIndexDelegate_Extensions.DidThrottle(CoreSpotlight.ICSSearchableIndexDelegate,CoreSpotlight.CSSearchableIndex)
28093+
M:CoreSpotlight.CSSearchableIndexDelegate_Extensions.DidUpdate(CoreSpotlight.ICSSearchableIndexDelegate,CoreSpotlight.CSSearchableItem[])
2808728094
M:CoreSpotlight.CSSearchableIndexDelegate_Extensions.GetData(CoreSpotlight.ICSSearchableIndexDelegate,CoreSpotlight.CSSearchableIndex,System.String,System.String,Foundation.NSError@)
2808828095
M:CoreSpotlight.CSSearchableIndexDelegate_Extensions.GetFileUrl(CoreSpotlight.ICSSearchableIndexDelegate,CoreSpotlight.CSSearchableIndex,System.String,System.String,System.Boolean,Foundation.NSError@)
28096+
M:CoreSpotlight.CSSearchableIndexDelegate_Extensions.GetSearchableItems(CoreSpotlight.ICSSearchableIndexDelegate,System.String[],CoreSpotlight.CSSearchableIndexDelegateGetSearchableItemsHandler)
2808928097
M:CoreSpotlight.CSSearchableIndexDelegate.DidFinishThrottle(CoreSpotlight.CSSearchableIndex)
2809028098
M:CoreSpotlight.CSSearchableIndexDelegate.DidThrottle(CoreSpotlight.CSSearchableIndex)
28099+
M:CoreSpotlight.CSSearchableIndexDelegate.DidUpdate(CoreSpotlight.CSSearchableItem[])
2809128100
M:CoreSpotlight.CSSearchableIndexDelegate.GetData(CoreSpotlight.CSSearchableIndex,System.String,System.String,Foundation.NSError@)
2809228101
M:CoreSpotlight.CSSearchableIndexDelegate.GetFileUrl(CoreSpotlight.CSSearchableIndex,System.String,System.String,System.Boolean,Foundation.NSError@)
28102+
M:CoreSpotlight.CSSearchableIndexDelegate.GetSearchableItems(System.String[],CoreSpotlight.CSSearchableIndexDelegateGetSearchableItemsHandler)
2809328103
M:CoreSpotlight.CSSearchableIndexDelegate.ReindexAllSearchableItems(CoreSpotlight.CSSearchableIndex,System.Action)
2809428104
M:CoreSpotlight.CSSearchableIndexDelegate.ReindexSearchableItems(CoreSpotlight.CSSearchableIndex,System.String[],System.Action)
2809528105
M:CoreSpotlight.CSSearchableItem.#ctor(System.String,System.String,CoreSpotlight.CSSearchableItemAttributeSet)
@@ -28100,6 +28110,7 @@ M:CoreSpotlight.CSSearchableItemAttributeSet.#ctor(System.String)
2810028110
M:CoreSpotlight.CSSearchableItemAttributeSet.#ctor(UniformTypeIdentifiers.UTType)
2810128111
M:CoreSpotlight.CSSearchableItemAttributeSet.Copy(Foundation.NSZone)
2810228112
M:CoreSpotlight.CSSearchableItemAttributeSet.EncodeTo(Foundation.NSCoder)
28113+
M:CoreSpotlight.CSSearchableItemAttributeSet.MoveFrom(CoreSpotlight.CSSearchableItemAttributeSet)
2810328114
M:CoreSpotlight.CSSearchQuery.#ctor(System.String,CoreSpotlight.CSSearchQueryContext)
2810428115
M:CoreSpotlight.CSSearchQuery.#ctor(System.String,System.String[])
2810528116
M:CoreSpotlight.CSSearchQuery.Cancel
@@ -28121,8 +28132,10 @@ M:CoreSpotlight.CSUserQuery.UserEngaged(CoreSpotlight.CSSuggestion,CoreSpotlight
2812128132
M:CoreSpotlight.CSUserQueryContext.Create(CoreSpotlight.CSSuggestion)
2812228133
M:CoreSpotlight.ICSSearchableIndexDelegate.DidFinishThrottle(CoreSpotlight.CSSearchableIndex)
2812328134
M:CoreSpotlight.ICSSearchableIndexDelegate.DidThrottle(CoreSpotlight.CSSearchableIndex)
28135+
M:CoreSpotlight.ICSSearchableIndexDelegate.DidUpdate(CoreSpotlight.CSSearchableItem[])
2812428136
M:CoreSpotlight.ICSSearchableIndexDelegate.GetData(CoreSpotlight.CSSearchableIndex,System.String,System.String,Foundation.NSError@)
2812528137
M:CoreSpotlight.ICSSearchableIndexDelegate.GetFileUrl(CoreSpotlight.CSSearchableIndex,System.String,System.String,System.Boolean,Foundation.NSError@)
28138+
M:CoreSpotlight.ICSSearchableIndexDelegate.GetSearchableItems(System.String[],CoreSpotlight.CSSearchableIndexDelegateGetSearchableItemsHandler)
2812628139
M:CoreSpotlight.ICSSearchableIndexDelegate.ReindexAllSearchableItems(CoreSpotlight.CSSearchableIndex,System.Action)
2812728140
M:CoreSpotlight.ICSSearchableIndexDelegate.ReindexSearchableItems(CoreSpotlight.CSSearchableIndex,System.String[],System.Action)
2812828141
M:CoreTelephony.CTCellularPlanProvisioning.AddPlan(CoreTelephony.CTCellularPlanProvisioningRequest,System.Action{CoreTelephony.CTCellularPlanProvisioningAddPlanResult})
@@ -52984,14 +52997,20 @@ P:CoreServices.FSEventStream.DeviceBeingWatched
5298452997
P:CoreServices.FSEventStream.LatestEventId
5298552998
P:CoreServices.FSEventStream.PathsBeingWatched
5298652999
P:CoreServices.FSEventStreamEventsArgs.Events
53000+
P:CoreSpotlight.CoreSpotlightConstants.CoreSpotlightVersionNumber
53001+
P:CoreSpotlight.CoreSpotlightConstants.CoreSpotlightVersionString
5298753002
P:CoreSpotlight.CSSearchableIndex.IndexDelegate
5298853003
P:CoreSpotlight.CSSearchableIndexBundleDataResult.Arg1
5298953004
P:CoreSpotlight.CSSearchableItem.IsUpdate
53005+
P:CoreSpotlight.CSSearchableItem.UpdateListenerOptions
5299053006
P:CoreSpotlight.CSSearchableItemAttributeSet.ActionIdentifier
5299153007
P:CoreSpotlight.CSSearchableItemAttributeSet.ActionIdentifiers
5299253008
P:CoreSpotlight.CSSearchableItemAttributeSet.DarkThumbnailUrl
53009+
P:CoreSpotlight.CSSearchableItemAttributeSet.IsPriority
5299353010
P:CoreSpotlight.CSSearchableItemAttributeSet.Item(CoreSpotlight.CSCustomAttributeKey)
5299453011
P:CoreSpotlight.CSSearchableItemAttributeSet.SharedItemContentType
53012+
P:CoreSpotlight.CSSearchableItemAttributeSet.TextContentSummary
53013+
P:CoreSpotlight.CSSearchableItemAttributeSet.TranscribedTextContent
5299553014
P:CoreSpotlight.CSSearchQueryContext.FetchAttributes
5299653015
P:CoreSpotlight.CSSearchQueryContext.FilterQueries
5299753016
P:CoreSpotlight.CSSearchQueryContext.KeyboardLanguage
@@ -66596,9 +66615,12 @@ T:CoreServices.LaunchServices
6659666615
T:CoreServices.LSAcceptanceFlags
6659766616
T:CoreServices.LSResult
6659866617
T:CoreServices.LSRoles
66618+
T:CoreSpotlight.CoreSpotlightConstants
6659966619
T:CoreSpotlight.CSImportExtension
6660066620
T:CoreSpotlight.CSSearchableIndexBundleDataResult
66621+
T:CoreSpotlight.CSSearchableIndexDelegateGetSearchableItemsHandler
6660166622
T:CoreSpotlight.CSSearchableIndexEndIndexHandler
66623+
T:CoreSpotlight.CSSearchableItemUpdateListenerOptions
6660266624
T:CoreSpotlight.CSSearchQueryContext
6660366625
T:CoreSpotlight.CSSearchQuerySourceOptions
6660466626
T:CoreSpotlight.CSSuggestion

tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreSpotlight.ignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreSpotlight.todo

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/xtro-sharpie/api-annotations-dotnet/common-CoreSpotlight.ignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreSpotlight.todo

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreSpotlight.ignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreSpotlight.todo

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreSpotlight.ignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)