Skip to content

Commit 22d6e44

Browse files
authored
[CoreSpotlight] Implement Xcode 16.0 beta 1-6 changes. (#20866)
Note: there were no changes in beta 2-6.
1 parent e0782fa commit 22d6e44

File tree

8 files changed

+68
-69
lines changed

8 files changed

+68
-69
lines changed

src/CoreSpotlight/CSEnums.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public enum CSIndexErrorCode : long {
2828
RemoteConnectionError = -1003,
2929
QuotaExceeded = -1004,
3030
IndexingUnsupported = -1005,
31+
MismatchedClientState = -1006,
3132
}
3233

3334
/// <summary>Enumerates errors that can occur while running a Core Spotlight query with <see cref="M:CoreSpotlight.CSSearchQuery.Start" />.</summary>
@@ -53,4 +54,12 @@ public enum CSFileProtection {
5354
CompleteUnlessOpen,
5455
CompleteUntilFirstUserAuthentication,
5556
}
57+
58+
[NoTV, Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
59+
[Native]
60+
public enum CSUserInteraction : long {
61+
Select,
62+
Default = Select,
63+
Focus,
64+
}
5665
}

src/corespotlight.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ interface CSSearchableIndex {
126126
/// <summary>Completion handler used in <see cref="M:CoreSpotlight.CSSearchableIndex_CSOptionalBatchingExtension.FetchLastClientState(CoreSpotlight.CSSearchableIndex,CoreSpotlight.CSSearchableIndexFetchHandler)" />.</summary>
127127
delegate void CSSearchableIndexFetchHandler (NSData clientState, NSError error);
128128

129+
delegate void CSSearchableIndexEndIndexHandler ([NullAllowed] NSError error);
130+
129131
/// <summary>Extension methods for <format type="text/html"><a href="https://docs.microsoft.com/en-us/search/index?search=T:CoreServices.CSSearchableIndex&amp;scope=Xamarin" title="T:CoreServices.CSSearchableIndex">T:CoreServices.CSSearchableIndex</a></format>.</summary>
130132
[NoTV] // CS_TVOS_UNAVAILABLE
131133
[MacCatalyst (13, 1)]
@@ -141,6 +143,10 @@ interface CSSearchableIndex_CSOptionalBatchingExtension {
141143

142144
[Export ("fetchLastClientStateWithCompletionHandler:")]
143145
void FetchLastClientState (CSSearchableIndexFetchHandler completionHandler);
146+
147+
[NoTV, Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
148+
[Export ("endIndexBatchWithExpectedClientState:newClientState:completionHandler:")]
149+
void EndIndexBatch ([NullAllowed] NSData expectedClientState, NSData newClientState, [NullAllowed] CSSearchableIndexEndIndexHandler completionHandler);
144150
}
145151

146152
/// <summary>Interface representing the required methods (if any) of the protocol <see cref="T:CoreSpotlight.CSSearchableIndexDelegate" />.</summary>
@@ -229,6 +235,10 @@ interface CSSearchableItem : NSSecureCoding, NSCopying {
229235
[NoTV, iOS (16, 0), MacCatalyst (16, 0), Mac (13, 0), NoWatch]
230236
[Export ("compareByRank:")]
231237
NSComparisonResult CompareByRank (CSSearchableItem other);
238+
239+
[NoTV, NoWatch]
240+
[Export ("isUpdate", ArgumentSemantic.Assign)]
241+
bool IsUpdate { get; set; }
232242
}
233243

234244
/// <summary>Represents a string-like object that returns a locale-specific version of a string.</summary>
@@ -1133,6 +1143,9 @@ interface CSSearchableItemAttributeSet : NSCopying, NSSecureCoding {
11331143
[BaseType (typeof (NSObject))]
11341144
[DisableDefaultCtor]
11351145
interface CSSearchQuery {
1146+
[Deprecated (PlatformName.iOS, 16, 0, message: "Use the constructor that takes a 'CSSearchQueryContext' parameter instead.")]
1147+
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use the constructor that takes a 'CSSearchQueryContext' parameter instead.")]
1148+
[Deprecated (PlatformName.MacOSX, 13, 0, message: "Use the constructor that takes a 'CSSearchQueryContext' parameter instead.")]
11361149
[Export ("initWithQueryString:attributes:")]
11371150
NativeHandle Constructor (string queryString, [NullAllowed] string [] attributes);
11381151

@@ -1190,6 +1203,29 @@ interface CSUserQuery {
11901203

11911204
[Export ("cancel")]
11921205
void Cancel ();
1206+
1207+
[Static]
1208+
[Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
1209+
[Export ("prepare")]
1210+
void Prepare ();
1211+
1212+
[Static]
1213+
[Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
1214+
[Export ("prepareProtectionClasses:")]
1215+
void Prepare (NSString [] protectionClasses);
1216+
1217+
[Static]
1218+
[Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
1219+
[Wrap ("Prepare (protectionClasses.ToConstantArray ()!)")]
1220+
void Prepare (NSFileProtectionType [] protectionClasses);
1221+
1222+
[Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
1223+
[Export ("userEngagedWithItem:visibleItems:userInteractionType:")]
1224+
void UserEngaged (CSSearchableItem item, CSSearchableItem [] visibleItems, CSUserInteraction userInteractionType);
1225+
1226+
[Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
1227+
[Export ("userEngagedWithSuggestion:visibleSuggestions:userInteractionType:")]
1228+
void UserEngaged (CSSuggestion suggestion, CSSuggestion [] visibleSuggestions, CSUserInteraction userInteractionType);
11931229
}
11941230

11951231
[NoTV, Mac (13, 0), iOS (16, 0), MacCatalyst (16, 0)]
@@ -1212,6 +1248,14 @@ interface CSUserQueryContext {
12121248

12131249
[Export ("maxResultCount")]
12141250
nint MaxResultCount { get; set; }
1251+
1252+
[Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
1253+
[Export ("disableSemanticSearch")]
1254+
bool DisableSemanticSearch { get; set; }
1255+
1256+
[Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)]
1257+
[Export ("maxRankedResultCount")]
1258+
nint MaxRankedResultCount { get; set; }
12151259
}
12161260

12171261

tests/cecil-tests/Documentation.KnownFailures.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7899,6 +7899,7 @@ F:CoreSpotlight.CSIndexErrorCode.IndexingUnsupported
78997899
F:CoreSpotlight.CSIndexErrorCode.IndexUnavailableError
79007900
F:CoreSpotlight.CSIndexErrorCode.InvalidClientStateError
79017901
F:CoreSpotlight.CSIndexErrorCode.InvalidItemError
7902+
F:CoreSpotlight.CSIndexErrorCode.MismatchedClientState
79027903
F:CoreSpotlight.CSIndexErrorCode.QuotaExceeded
79037904
F:CoreSpotlight.CSIndexErrorCode.RemoteConnectionError
79047905
F:CoreSpotlight.CSIndexErrorCode.UnknownError
@@ -7911,6 +7912,9 @@ F:CoreSpotlight.CSSearchQuerySourceOptions.Default
79117912
F:CoreSpotlight.CSSuggestionKind.Custom
79127913
F:CoreSpotlight.CSSuggestionKind.Default
79137914
F:CoreSpotlight.CSSuggestionKind.None
7915+
F:CoreSpotlight.CSUserInteraction.Default
7916+
F:CoreSpotlight.CSUserInteraction.Focus
7917+
F:CoreSpotlight.CSUserInteraction.Select
79147918
F:CoreTelephony.CTCellularDataRestrictedState.NotRestricted
79157919
F:CoreTelephony.CTCellularDataRestrictedState.Restricted
79167920
F:CoreTelephony.CTCellularDataRestrictedState.Unknown
@@ -33237,6 +33241,7 @@ M:CoreSpotlight.CSPerson.#ctor(System.String,System.String[],Foundation.NSString
3323733241
M:CoreSpotlight.CSPerson.Copy(Foundation.NSZone)
3323833242
M:CoreSpotlight.CSPerson.EncodeTo(Foundation.NSCoder)
3323933243
M:CoreSpotlight.CSSearchableIndex_CSOptionalBatchingExtension.BeginIndexBatch(CoreSpotlight.CSSearchableIndex)
33244+
M:CoreSpotlight.CSSearchableIndex_CSOptionalBatchingExtension.EndIndexBatch(CoreSpotlight.CSSearchableIndex,Foundation.NSData,Foundation.NSData,CoreSpotlight.CSSearchableIndexEndIndexHandler)
3324033245
M:CoreSpotlight.CSSearchableIndex_CSOptionalBatchingExtension.EndIndexBatch(CoreSpotlight.CSSearchableIndex,Foundation.NSData,System.Action{Foundation.NSError})
3324133246
M:CoreSpotlight.CSSearchableIndex_CSOptionalBatchingExtension.FetchLastClientState(CoreSpotlight.CSSearchableIndex,CoreSpotlight.CSSearchableIndexFetchHandler)
3324233247
M:CoreSpotlight.CSSearchableIndex.#ctor(System.String,CoreSpotlight.CSFileProtection)
@@ -33287,7 +33292,12 @@ M:CoreSpotlight.CSSuggestion.Copy(Foundation.NSZone)
3328733292
M:CoreSpotlight.CSSuggestion.EncodeTo(Foundation.NSCoder)
3328833293
M:CoreSpotlight.CSUserQuery.#ctor(System.String,CoreSpotlight.CSUserQueryContext)
3328933294
M:CoreSpotlight.CSUserQuery.Cancel
33295+
M:CoreSpotlight.CSUserQuery.Prepare
33296+
M:CoreSpotlight.CSUserQuery.Prepare(Foundation.NSFileProtectionType[])
33297+
M:CoreSpotlight.CSUserQuery.Prepare(Foundation.NSString[])
3329033298
M:CoreSpotlight.CSUserQuery.Start
33299+
M:CoreSpotlight.CSUserQuery.UserEngaged(CoreSpotlight.CSSearchableItem,CoreSpotlight.CSSearchableItem[],CoreSpotlight.CSUserInteraction)
33300+
M:CoreSpotlight.CSUserQuery.UserEngaged(CoreSpotlight.CSSuggestion,CoreSpotlight.CSSuggestion[],CoreSpotlight.CSUserInteraction)
3329133301
M:CoreSpotlight.CSUserQueryContext.Create(CoreSpotlight.CSSuggestion)
3329233302
M:CoreSpotlight.ICSSearchableIndexDelegate.DidFinishThrottle(CoreSpotlight.CSSearchableIndex)
3329333303
M:CoreSpotlight.ICSSearchableIndexDelegate.DidThrottle(CoreSpotlight.CSSearchableIndex)
@@ -64357,6 +64367,7 @@ P:CoreSpotlight.CSSearchableItem.AttributeSet
6435764367
P:CoreSpotlight.CSSearchableItem.ContinuationActionType
6435864368
P:CoreSpotlight.CSSearchableItem.DomainIdentifier
6435964369
P:CoreSpotlight.CSSearchableItem.ExpirationDate
64370+
P:CoreSpotlight.CSSearchableItem.IsUpdate
6436064371
P:CoreSpotlight.CSSearchableItem.QueryString
6436164372
P:CoreSpotlight.CSSearchableItem.UniqueIdentifier
6436264373
P:CoreSpotlight.CSSearchableItemAttributeSet.AccountHandles
@@ -64564,7 +64575,9 @@ P:CoreSpotlight.CSSuggestion.SuggestionDataSources
6456464575
P:CoreSpotlight.CSSuggestion.SuggestionKind
6456564576
P:CoreSpotlight.CSUserQuery.FoundSuggestionCount
6456664577
P:CoreSpotlight.CSUserQuery.FoundSuggestionsHandler
64578+
P:CoreSpotlight.CSUserQueryContext.DisableSemanticSearch
6456764579
P:CoreSpotlight.CSUserQueryContext.EnableRankedResults
64580+
P:CoreSpotlight.CSUserQueryContext.MaxRankedResultCount
6456864581
P:CoreSpotlight.CSUserQueryContext.MaxResultCount
6456964582
P:CoreSpotlight.CSUserQueryContext.MaxSuggestionCount
6457064583
P:CoreSpotlight.CSUserQueryContext.UserQueryContext
@@ -81160,10 +81173,12 @@ T:CoreServices.LSResult
8116081173
T:CoreServices.LSRoles
8116181174
T:CoreSpotlight.CSImportExtension
8116281175
T:CoreSpotlight.CSSearchableIndexBundleDataResult
81176+
T:CoreSpotlight.CSSearchableIndexEndIndexHandler
8116381177
T:CoreSpotlight.CSSearchQueryContext
8116481178
T:CoreSpotlight.CSSearchQuerySourceOptions
8116581179
T:CoreSpotlight.CSSuggestion
8116681180
T:CoreSpotlight.CSSuggestionKind
81181+
T:CoreSpotlight.CSUserInteraction
8116781182
T:CoreSpotlight.CSUserQuery
8116881183
T:CoreSpotlight.CSUserQueryContext
8116981184
T:CoreTelephony.CTCellularPlanProvisioning

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

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

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

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

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

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

tests/xtro-sharpie/iOS-CoreSpotlight.todo

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

tests/xtro-sharpie/macOS-CoreSpotlight.todo

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

0 commit comments

Comments
 (0)