diff --git a/src/CoreSpotlight/CSEnums.cs b/src/CoreSpotlight/CSEnums.cs index 5683695d2d72..3273e9e783f6 100644 --- a/src/CoreSpotlight/CSEnums.cs +++ b/src/CoreSpotlight/CSEnums.cs @@ -70,7 +70,7 @@ public enum CSFileProtection { CompleteUntilFirstUserAuthentication, } - [NoTV, Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)] + [TV (18, 0), Mac (15, 0), iOS (18, 0), MacCatalyst (18, 0)] [Native] public enum CSUserInteraction : long { Select, diff --git a/src/corespotlight.cs b/src/corespotlight.cs index 15909ab16879..ebdd770f1a60 100644 --- a/src/corespotlight.cs +++ b/src/corespotlight.cs @@ -19,6 +19,22 @@ namespace CoreSpotlight { + [Partial] + interface CoreSpotlightConstants { + [Field ("CoreSpotlightVersionNumber")] + double CoreSpotlightVersionNumber { get; } + + [Field ("CoreSpotlightVersionString")] + [Internal] + IntPtr _CoreSpotlightVersionString { get; } + + [Static] + string CoreSpotlightVersionString { + [Wrap ("Marshal.PtrToStringUTF8 (_CoreSpotlightVersionString)!")] + get; + } + } + /// 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. /// /// Apple documentation for CSIndexExtensionRequestHandler @@ -110,7 +126,6 @@ interface CSSearchableIndex { [Export ("initWithName:")] NativeHandle Constructor (string name); - [NoMac] [MacCatalyst (13, 1)] [Export ("initWithName:protectionClass:")] NativeHandle Constructor (string name, [NullAllowed] NSString protectionClass); @@ -221,8 +236,20 @@ interface CSSearchableIndexDelegate { [Export ("fileURLForSearchableIndex:itemIdentifier:typeIdentifier:inPlace:error:")] [return: NullAllowed] NSUrl GetFileUrl (CSSearchableIndex searchableIndex, string itemIdentifier, string typeIdentifier, bool inPlace, out NSError outError); + + [NoTV] + [iOS (18, 4), Mac (15, 4), MacCatalyst (18, 4)] + [Export ("searchableItemsForIdentifiers:searchableItemsHandler:")] + void GetSearchableItems (string [] identifiers, CSSearchableIndexDelegateGetSearchableItemsHandler searchableItemsHandler); + + [NoTV] + [iOS (18, 4), Mac (15, 4), MacCatalyst (18, 4)] + [Export ("searchableItemsDidUpdate:")] + void DidUpdate (CSSearchableItem [] items); } + delegate void CSSearchableIndexDelegateGetSearchableItemsHandler (CSSearchableItem [] items); + /// A uniquely identifiable, searchable object in a . /// /// Apple documentation for CSSearchableItem @@ -299,6 +326,10 @@ interface CSSearchableItem : NSSecureCoding, NSCopying { [NoTV] [Export ("isUpdate", ArgumentSemantic.Assign)] bool IsUpdate { get; set; } + + [NoTV, iOS (18, 4), MacCatalyst (18, 4), Mac (15, 4)] + [Export ("updateListenerOptions", ArgumentSemantic.Assign)] + CSSearchableItemUpdateListenerOptions UpdateListenerOptions { get; set; } } /// Represents a string-like object that returns a locale-specific version of a string. @@ -2194,14 +2225,12 @@ interface CSSearchableItemAttributeSet : NSCopying, NSSecureCoding { [Field ("CSActionIdentifier")] NSString ActionIdentifier { get; } - [NoTV, NoMac, iOS (15, 0)] - [NoMacCatalyst] + [NoTV, NoMac, iOS (15, 0), MacCatalyst (18, 0)] [Export ("actionIdentifiers", ArgumentSemantic.Copy)] string [] ActionIdentifiers { get; set; } [NullAllowed] - [NoTV, NoMac, iOS (15, 0)] - [NoMacCatalyst] + [NoTV, NoMac, iOS (15, 0), MacCatalyst (18, 0)] [Export ("sharedItemContentType", ArgumentSemantic.Copy)] UTType SharedItemContentType { get; set; } @@ -2323,6 +2352,26 @@ interface CSSearchableItemAttributeSet : NSCopying, NSSecureCoding { [MacCatalyst (13, 1)] [NullAllowed, Export ("providerInPlaceFileTypeIdentifiers", ArgumentSemantic.Copy)] string [] ProviderInPlaceFileTypeIdentifiers { get; set; } + + [NoTV] + [iOS (18, 4), MacCatalyst (18, 4), Mac (15, 4)] + [Export ("moveFrom:")] + void MoveFrom (CSSearchableItemAttributeSet sourceAttributeSet); + + [NoTV] + [iOS (18, 4), MacCatalyst (18, 4), Mac (15, 4)] + [Export ("isPriority", ArgumentSemantic.Strong), NullAllowed] + NSNumber IsPriority { get; } + + [NoTV] + [iOS (18, 4), MacCatalyst (18, 4), Mac (15, 4)] + [Export ("textContentSummary", ArgumentSemantic.Copy), NullAllowed] + string TextContentSummary { get; } + + [NoTV] + [iOS (18, 4), MacCatalyst (18, 4), Mac (15, 4)] + [Export ("transcribedTextContent", ArgumentSemantic.Strong), NullAllowed] + string TranscribedTextContent { get; set; } } /// @@ -2520,7 +2569,7 @@ public enum CSSearchQuerySourceOptions : long { AllowMail = 1L << 0, } - [NoTV, iOS (16, 0), MacCatalyst (16, 0)] + [TV (16, 0), iOS (16, 0), MacCatalyst (16, 0)] [Native] public enum CSSuggestionKind : long { None, @@ -2528,4 +2577,11 @@ public enum CSSuggestionKind : long { Default, } + [Native] + [TV (18, 4), iOS (18, 4), MacCatalyst (18, 4), Mac (15, 4)] + public enum CSSearchableItemUpdateListenerOptions : ulong { + Default = 0, + Summarization = 1 << 1, + Priority = 1 << 2, + } } diff --git a/tests/cecil-tests/Documentation.KnownFailures.txt b/tests/cecil-tests/Documentation.KnownFailures.txt index cda91eccdd1c..77b60802bb34 100644 --- a/tests/cecil-tests/Documentation.KnownFailures.txt +++ b/tests/cecil-tests/Documentation.KnownFailures.txt @@ -6391,6 +6391,9 @@ F:CoreServices.LSRoles.None F:CoreServices.LSRoles.Shell F:CoreServices.LSRoles.Viewer F:CoreSpotlight.CSIndexErrorCode.MismatchedClientState +F:CoreSpotlight.CSSearchableItemUpdateListenerOptions.Default +F:CoreSpotlight.CSSearchableItemUpdateListenerOptions.Priority +F:CoreSpotlight.CSSearchableItemUpdateListenerOptions.Summarization F:CoreSpotlight.CSSearchQuerySourceOptions.AllowMail F:CoreSpotlight.CSSearchQuerySourceOptions.Default F:CoreSpotlight.CSSuggestionKind.Custom @@ -28041,6 +28044,7 @@ M:CoreServices.LaunchServices.Open(Foundation.NSUrl) M:CoreServices.LaunchServices.Register(Foundation.NSUrl,System.Boolean) M:CoreServices.LaunchServices.SetDefaultHandlerForUrlScheme(System.String,System.String) M:CoreServices.LaunchServices.SetDefaultRoleHandlerForContentType(System.String,System.String,CoreServices.LSRoles) +M:CoreSpotlight.CoreSpotlightConstants.#ctor M:CoreSpotlight.CSCustomAttributeKey.#ctor(System.String,System.Boolean,System.Boolean,System.Boolean,System.Boolean) M:CoreSpotlight.CSCustomAttributeKey.#ctor(System.String) M:CoreSpotlight.CSCustomAttributeKey.Copy(Foundation.NSZone) @@ -28050,8 +28054,10 @@ M:CoreSpotlight.CSImportExtension.Update(CoreSpotlight.CSSearchableItemAttribute M:CoreSpotlight.CSIndexExtensionRequestHandler.BeginRequestWithExtensionContext(Foundation.NSExtensionContext) M:CoreSpotlight.CSIndexExtensionRequestHandler.DidFinishThrottle(CoreSpotlight.CSSearchableIndex) M:CoreSpotlight.CSIndexExtensionRequestHandler.DidThrottle(CoreSpotlight.CSSearchableIndex) +M:CoreSpotlight.CSIndexExtensionRequestHandler.DidUpdate(CoreSpotlight.CSSearchableItem[]) M:CoreSpotlight.CSIndexExtensionRequestHandler.GetData(CoreSpotlight.CSSearchableIndex,System.String,System.String,Foundation.NSError@) M:CoreSpotlight.CSIndexExtensionRequestHandler.GetFileUrl(CoreSpotlight.CSSearchableIndex,System.String,System.String,System.Boolean,Foundation.NSError@) +M:CoreSpotlight.CSIndexExtensionRequestHandler.GetSearchableItems(System.String[],CoreSpotlight.CSSearchableIndexDelegateGetSearchableItemsHandler) M:CoreSpotlight.CSIndexExtensionRequestHandler.ReindexAllSearchableItems(CoreSpotlight.CSSearchableIndex,System.Action) M:CoreSpotlight.CSIndexExtensionRequestHandler.ReindexSearchableItems(CoreSpotlight.CSSearchableIndex,System.String[],System.Action) M:CoreSpotlight.CSLocalizedString.#ctor(Foundation.NSDictionary) @@ -28084,12 +28090,16 @@ M:CoreSpotlight.CSSearchableIndex.ProvideDataAsync(System.String,System.String,S M:CoreSpotlight.CSSearchableIndexBundleDataResult.#ctor(Foundation.NSData) M:CoreSpotlight.CSSearchableIndexDelegate_Extensions.DidFinishThrottle(CoreSpotlight.ICSSearchableIndexDelegate,CoreSpotlight.CSSearchableIndex) M:CoreSpotlight.CSSearchableIndexDelegate_Extensions.DidThrottle(CoreSpotlight.ICSSearchableIndexDelegate,CoreSpotlight.CSSearchableIndex) +M:CoreSpotlight.CSSearchableIndexDelegate_Extensions.DidUpdate(CoreSpotlight.ICSSearchableIndexDelegate,CoreSpotlight.CSSearchableItem[]) M:CoreSpotlight.CSSearchableIndexDelegate_Extensions.GetData(CoreSpotlight.ICSSearchableIndexDelegate,CoreSpotlight.CSSearchableIndex,System.String,System.String,Foundation.NSError@) M:CoreSpotlight.CSSearchableIndexDelegate_Extensions.GetFileUrl(CoreSpotlight.ICSSearchableIndexDelegate,CoreSpotlight.CSSearchableIndex,System.String,System.String,System.Boolean,Foundation.NSError@) +M:CoreSpotlight.CSSearchableIndexDelegate_Extensions.GetSearchableItems(CoreSpotlight.ICSSearchableIndexDelegate,System.String[],CoreSpotlight.CSSearchableIndexDelegateGetSearchableItemsHandler) M:CoreSpotlight.CSSearchableIndexDelegate.DidFinishThrottle(CoreSpotlight.CSSearchableIndex) M:CoreSpotlight.CSSearchableIndexDelegate.DidThrottle(CoreSpotlight.CSSearchableIndex) +M:CoreSpotlight.CSSearchableIndexDelegate.DidUpdate(CoreSpotlight.CSSearchableItem[]) M:CoreSpotlight.CSSearchableIndexDelegate.GetData(CoreSpotlight.CSSearchableIndex,System.String,System.String,Foundation.NSError@) M:CoreSpotlight.CSSearchableIndexDelegate.GetFileUrl(CoreSpotlight.CSSearchableIndex,System.String,System.String,System.Boolean,Foundation.NSError@) +M:CoreSpotlight.CSSearchableIndexDelegate.GetSearchableItems(System.String[],CoreSpotlight.CSSearchableIndexDelegateGetSearchableItemsHandler) M:CoreSpotlight.CSSearchableIndexDelegate.ReindexAllSearchableItems(CoreSpotlight.CSSearchableIndex,System.Action) M:CoreSpotlight.CSSearchableIndexDelegate.ReindexSearchableItems(CoreSpotlight.CSSearchableIndex,System.String[],System.Action) M:CoreSpotlight.CSSearchableItem.#ctor(System.String,System.String,CoreSpotlight.CSSearchableItemAttributeSet) @@ -28100,6 +28110,7 @@ M:CoreSpotlight.CSSearchableItemAttributeSet.#ctor(System.String) M:CoreSpotlight.CSSearchableItemAttributeSet.#ctor(UniformTypeIdentifiers.UTType) M:CoreSpotlight.CSSearchableItemAttributeSet.Copy(Foundation.NSZone) M:CoreSpotlight.CSSearchableItemAttributeSet.EncodeTo(Foundation.NSCoder) +M:CoreSpotlight.CSSearchableItemAttributeSet.MoveFrom(CoreSpotlight.CSSearchableItemAttributeSet) M:CoreSpotlight.CSSearchQuery.#ctor(System.String,CoreSpotlight.CSSearchQueryContext) M:CoreSpotlight.CSSearchQuery.#ctor(System.String,System.String[]) M:CoreSpotlight.CSSearchQuery.Cancel @@ -28121,8 +28132,10 @@ M:CoreSpotlight.CSUserQuery.UserEngaged(CoreSpotlight.CSSuggestion,CoreSpotlight M:CoreSpotlight.CSUserQueryContext.Create(CoreSpotlight.CSSuggestion) M:CoreSpotlight.ICSSearchableIndexDelegate.DidFinishThrottle(CoreSpotlight.CSSearchableIndex) M:CoreSpotlight.ICSSearchableIndexDelegate.DidThrottle(CoreSpotlight.CSSearchableIndex) +M:CoreSpotlight.ICSSearchableIndexDelegate.DidUpdate(CoreSpotlight.CSSearchableItem[]) M:CoreSpotlight.ICSSearchableIndexDelegate.GetData(CoreSpotlight.CSSearchableIndex,System.String,System.String,Foundation.NSError@) M:CoreSpotlight.ICSSearchableIndexDelegate.GetFileUrl(CoreSpotlight.CSSearchableIndex,System.String,System.String,System.Boolean,Foundation.NSError@) +M:CoreSpotlight.ICSSearchableIndexDelegate.GetSearchableItems(System.String[],CoreSpotlight.CSSearchableIndexDelegateGetSearchableItemsHandler) M:CoreSpotlight.ICSSearchableIndexDelegate.ReindexAllSearchableItems(CoreSpotlight.CSSearchableIndex,System.Action) M:CoreSpotlight.ICSSearchableIndexDelegate.ReindexSearchableItems(CoreSpotlight.CSSearchableIndex,System.String[],System.Action) M:CoreTelephony.CTCellularPlanProvisioning.AddPlan(CoreTelephony.CTCellularPlanProvisioningRequest,System.Action{CoreTelephony.CTCellularPlanProvisioningAddPlanResult}) @@ -52984,14 +52997,20 @@ P:CoreServices.FSEventStream.DeviceBeingWatched P:CoreServices.FSEventStream.LatestEventId P:CoreServices.FSEventStream.PathsBeingWatched P:CoreServices.FSEventStreamEventsArgs.Events +P:CoreSpotlight.CoreSpotlightConstants.CoreSpotlightVersionNumber +P:CoreSpotlight.CoreSpotlightConstants.CoreSpotlightVersionString P:CoreSpotlight.CSSearchableIndex.IndexDelegate P:CoreSpotlight.CSSearchableIndexBundleDataResult.Arg1 P:CoreSpotlight.CSSearchableItem.IsUpdate +P:CoreSpotlight.CSSearchableItem.UpdateListenerOptions P:CoreSpotlight.CSSearchableItemAttributeSet.ActionIdentifier P:CoreSpotlight.CSSearchableItemAttributeSet.ActionIdentifiers P:CoreSpotlight.CSSearchableItemAttributeSet.DarkThumbnailUrl +P:CoreSpotlight.CSSearchableItemAttributeSet.IsPriority P:CoreSpotlight.CSSearchableItemAttributeSet.Item(CoreSpotlight.CSCustomAttributeKey) P:CoreSpotlight.CSSearchableItemAttributeSet.SharedItemContentType +P:CoreSpotlight.CSSearchableItemAttributeSet.TextContentSummary +P:CoreSpotlight.CSSearchableItemAttributeSet.TranscribedTextContent P:CoreSpotlight.CSSearchQueryContext.FetchAttributes P:CoreSpotlight.CSSearchQueryContext.FilterQueries P:CoreSpotlight.CSSearchQueryContext.KeyboardLanguage @@ -66596,9 +66615,12 @@ T:CoreServices.LaunchServices T:CoreServices.LSAcceptanceFlags T:CoreServices.LSResult T:CoreServices.LSRoles +T:CoreSpotlight.CoreSpotlightConstants T:CoreSpotlight.CSImportExtension T:CoreSpotlight.CSSearchableIndexBundleDataResult +T:CoreSpotlight.CSSearchableIndexDelegateGetSearchableItemsHandler T:CoreSpotlight.CSSearchableIndexEndIndexHandler +T:CoreSpotlight.CSSearchableItemUpdateListenerOptions T:CoreSpotlight.CSSearchQueryContext T:CoreSpotlight.CSSearchQuerySourceOptions T:CoreSpotlight.CSSuggestion diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreSpotlight.ignore b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreSpotlight.ignore deleted file mode 100644 index 288ce16eac59..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreSpotlight.ignore +++ /dev/null @@ -1,5 +0,0 @@ -## not annotated for catalyst and not responding on macOS 12 beta 3 -!missing-selector! CSSearchableItemAttributeSet::actionIdentifiers not bound -!missing-selector! CSSearchableItemAttributeSet::setActionIdentifiers: not bound -!missing-selector! CSSearchableItemAttributeSet::setSharedItemContentType: not bound -!missing-selector! CSSearchableItemAttributeSet::sharedItemContentType not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreSpotlight.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreSpotlight.todo deleted file mode 100644 index 5525c6cf02a4..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreSpotlight.todo +++ /dev/null @@ -1,10 +0,0 @@ -!missing-enum! CSSearchableItemUpdateListenerOptions not bound -!missing-protocol-member! CSSearchableIndexDelegate::searchableItemsDidUpdate: not found -!missing-protocol-member! CSSearchableIndexDelegate::searchableItemsForIdentifiers:searchableItemsHandler: not found -!missing-selector! CSSearchableItem::setUpdateListenerOptions: not bound -!missing-selector! CSSearchableItem::updateListenerOptions not bound -!missing-selector! CSSearchableItemAttributeSet::isPriority not bound -!missing-selector! CSSearchableItemAttributeSet::moveFrom: not bound -!missing-selector! CSSearchableItemAttributeSet::setTranscribedTextContent: not bound -!missing-selector! CSSearchableItemAttributeSet::textContentSummary not bound -!missing-selector! CSSearchableItemAttributeSet::transcribedTextContent not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/common-CoreSpotlight.ignore b/tests/xtro-sharpie/api-annotations-dotnet/common-CoreSpotlight.ignore deleted file mode 100644 index b68e9824067d..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/common-CoreSpotlight.ignore +++ /dev/null @@ -1,4 +0,0 @@ -# note: framework not available on watchOS - -!missing-field! CoreSpotlightVersionNumber not bound -!missing-field! CoreSpotlightVersionString not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreSpotlight.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreSpotlight.todo deleted file mode 100644 index 5525c6cf02a4..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreSpotlight.todo +++ /dev/null @@ -1,10 +0,0 @@ -!missing-enum! CSSearchableItemUpdateListenerOptions not bound -!missing-protocol-member! CSSearchableIndexDelegate::searchableItemsDidUpdate: not found -!missing-protocol-member! CSSearchableIndexDelegate::searchableItemsForIdentifiers:searchableItemsHandler: not found -!missing-selector! CSSearchableItem::setUpdateListenerOptions: not bound -!missing-selector! CSSearchableItem::updateListenerOptions not bound -!missing-selector! CSSearchableItemAttributeSet::isPriority not bound -!missing-selector! CSSearchableItemAttributeSet::moveFrom: not bound -!missing-selector! CSSearchableItemAttributeSet::setTranscribedTextContent: not bound -!missing-selector! CSSearchableItemAttributeSet::textContentSummary not bound -!missing-selector! CSSearchableItemAttributeSet::transcribedTextContent not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreSpotlight.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreSpotlight.ignore deleted file mode 100644 index d44c95c83cf7..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreSpotlight.ignore +++ /dev/null @@ -1,2 +0,0 @@ -## protectionClass is a `NSFileProtectionType` which is not available on macOS -!missing-selector! CSSearchableIndex::initWithName:protectionClass: not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreSpotlight.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreSpotlight.todo deleted file mode 100644 index 5525c6cf02a4..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreSpotlight.todo +++ /dev/null @@ -1,10 +0,0 @@ -!missing-enum! CSSearchableItemUpdateListenerOptions not bound -!missing-protocol-member! CSSearchableIndexDelegate::searchableItemsDidUpdate: not found -!missing-protocol-member! CSSearchableIndexDelegate::searchableItemsForIdentifiers:searchableItemsHandler: not found -!missing-selector! CSSearchableItem::setUpdateListenerOptions: not bound -!missing-selector! CSSearchableItem::updateListenerOptions not bound -!missing-selector! CSSearchableItemAttributeSet::isPriority not bound -!missing-selector! CSSearchableItemAttributeSet::moveFrom: not bound -!missing-selector! CSSearchableItemAttributeSet::setTranscribedTextContent: not bound -!missing-selector! CSSearchableItemAttributeSet::textContentSummary not bound -!missing-selector! CSSearchableItemAttributeSet::transcribedTextContent not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreSpotlight.ignore b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreSpotlight.ignore deleted file mode 100644 index 05ccc03b6f3f..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreSpotlight.ignore +++ /dev/null @@ -1,2 +0,0 @@ -# framework is not present on tvOS as of xcode 14.0 -!missing-enum! CSSuggestionKind not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreSpotlight.todo b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreSpotlight.todo deleted file mode 100644 index 84d262c442c4..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreSpotlight.todo +++ /dev/null @@ -1,2 +0,0 @@ -!missing-enum! CSUserInteraction not bound -!missing-enum! CSSearchableItemUpdateListenerOptions not bound