diff --git a/src/corespotlight.cs b/src/corespotlight.cs index 026500e38f80..757d64828841 100644 --- a/src/corespotlight.cs +++ b/src/corespotlight.cs @@ -90,6 +90,13 @@ interface CSSearchableIndex { [Export ("deleteAllSearchableItemsWithCompletionHandler:")] [Async] void DeleteAll ([NullAllowed] Action completionHandler); + + // from interface CSExternalProvider (CSSearchableIndex) + + [Async (ResultTypeName="CSSearchableIndexBundleDataResult")] + [NoTV, iOS (16,0), Mac (13,0), MacCatalyst (16,0)] + [Export ("provideDataForBundle:identifier:type:completionHandler:")] + void ProvideData (string bundle, string identifier, string type, Action completionHandler); } delegate void CSSearchableIndexFetchHandler (NSData clientState, NSError error); @@ -1074,6 +1081,11 @@ interface CSSearchQuery { [Export ("initWithQueryString:attributes:")] NativeHandle Constructor (string queryString, [NullAllowed] string[] attributes); + [Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Export ("initWithQueryString:queryContext:")] + [DesignatedInitializer] + NativeHandle Constructor (string queryString, CSSearchQueryContext queryContext); + [Export ("cancelled")] bool Cancelled { [Bind ("isCancelled")] get; } @@ -1105,4 +1117,126 @@ interface CSImportExtension : NSExtensionRequestHandling bool Update (CSSearchableItemAttributeSet attributes, NSUrl contentUrl, [NullAllowed] out NSError error); } + [NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (CSSearchQuery))] + [DisableDefaultCtor] + interface CSUserQuery + { + [Export ("initWithUserQueryString:queryContext:")] + [DesignatedInitializer] + NativeHandle Constructor ([NullAllowed] string userQueryString, CSUserQueryContext queryContext); + + [Export ("foundSuggestionCount")] + nint FoundSuggestionCount { get; } + + [NullAllowed, Export ("foundSuggestionsHandler", ArgumentSemantic.Copy)] + Action> FoundSuggestionsHandler { get; set; } + + [Export ("start")] + void Start (); + + [Export ("cancel")] + void Cancel (); + } + + [NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (CSSearchQueryContext))] + [DisableDefaultCtor] + interface CSUserQueryContext + { + [Static] + [Export ("userQueryContext")] + CSUserQueryContext UserQueryContext { get; } + + [Static] + [Export ("userQueryContextWithCurrentSuggestion:")] + CSUserQueryContext Create ([NullAllowed] CSSuggestion currentSuggestion); + + [Export ("maxSuggestionCount")] + nint MaxSuggestionCount { get; set; } + } + + [NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (CSUserQueryContext))] + [DisableDefaultCtor] + interface CSTopHitQueryContext + { + [Static] + [Export ("topHitQueryContext")] + CSTopHitQueryContext TopHitQueryContext { get; } + + [Static] + [Export ("topHitQueryContextWithCurrentSuggestion:")] + CSTopHitQueryContext Create ([NullAllowed] CSSuggestion currentSuggestion); + + [Export ("maxItemCount")] + nint MaxItemCount { get; set; } + } + + [NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (CSUserQuery))] + [DisableDefaultCtor] + interface CSTopHitQuery + { + [Export ("initWithUserQueryString:queryContext:")] + [DesignatedInitializer] + NativeHandle Constructor ([NullAllowed] string userQueryString, CSTopHitQueryContext queryContext); + } + + [NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] + interface CSSuggestion : NSSecureCoding, NSCopying + { + + [Field ("CSSuggestionHighlightAttributeName")] + NSString HighlightAttributeName { get; } + + [Export ("localizedAttributedSuggestion")] + NSAttributedString LocalizedAttributedSuggestion { get; } + + [Export ("suggestionKind")] + CSSuggestionKind SuggestionKind { get; } + + [Export ("compare:")] + NSComparisonResult Compare (CSSuggestion other); + } + + [NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [BaseType (typeof (NSObject))] + interface CSSearchQueryContext : NSSecureCoding, NSCopying + { + [NullAllowed, Export ("fetchAttributes", ArgumentSemantic.Strong)] + string[] FetchAttributes { get; set; } + + [NullAllowed, Export ("protectionClasses", ArgumentSemantic.Strong)] + string[] ProtectionClasses { get; set; } + + [NullAllowed, Export ("filterQueries", ArgumentSemantic.Copy)] + string[] FilterQueries { get; set; } + + [NullAllowed, Export ("keyboardLanguage", ArgumentSemantic.Strong)] + string KeyboardLanguage { get; set; } + + [Export ("sourceOptions", ArgumentSemantic.Assign)] + CSSearchQuerySourceOptions SourceOptions { get; set; } + } + + [NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] + [Native] + public enum CSSearchQuerySourceOptions : long + { + Default = 0, + AllowMail = 1L << 0, + } + + [NoTV, Mac (10,13), iOS (16,0), MacCatalyst (16,0)] + [Native] + public enum CSSuggestionKind : long + { + None, + Custom, + Default, + } + } 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 d776cd6930cf..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreSpotlight.todo +++ /dev/null @@ -1,39 +0,0 @@ -!missing-enum! CSSearchQuerySourceOptions not bound -!missing-enum! CSSuggestionKind not bound -!missing-field! CSSuggestionHighlightAttributeName not bound -!missing-selector! +CSTopHitQueryContext::topHitQueryContext not bound -!missing-selector! +CSTopHitQueryContext::topHitQueryContextWithCurrentSuggestion: not bound -!missing-selector! +CSUserQueryContext::userQueryContext not bound -!missing-selector! +CSUserQueryContext::userQueryContextWithCurrentSuggestion: not bound -!missing-selector! CSSearchableIndex::provideDataForBundle:identifier:type:completionHandler: not bound -!missing-selector! CSSearchQuery::initWithQueryString:queryContext: not bound -!missing-selector! CSSearchQueryContext::fetchAttributes not bound -!missing-selector! CSSearchQueryContext::filterQueries not bound -!missing-selector! CSSearchQueryContext::keyboardLanguage not bound -!missing-selector! CSSearchQueryContext::protectionClasses not bound -!missing-selector! CSSearchQueryContext::setFetchAttributes: not bound -!missing-selector! CSSearchQueryContext::setFilterQueries: not bound -!missing-selector! CSSearchQueryContext::setKeyboardLanguage: not bound -!missing-selector! CSSearchQueryContext::setProtectionClasses: not bound -!missing-selector! CSSearchQueryContext::setSourceOptions: not bound -!missing-selector! CSSearchQueryContext::sourceOptions not bound -!missing-selector! CSSuggestion::compare: not bound -!missing-selector! CSSuggestion::localizedAttributedSuggestion not bound -!missing-selector! CSSuggestion::suggestionKind not bound -!missing-selector! CSTopHitQuery::initWithUserQueryString:queryContext: not bound -!missing-selector! CSTopHitQueryContext::maxItemCount not bound -!missing-selector! CSTopHitQueryContext::setMaxItemCount: not bound -!missing-selector! CSUserQuery::cancel not bound -!missing-selector! CSUserQuery::foundSuggestionCount not bound -!missing-selector! CSUserQuery::foundSuggestionsHandler not bound -!missing-selector! CSUserQuery::initWithUserQueryString:queryContext: not bound -!missing-selector! CSUserQuery::setFoundSuggestionsHandler: not bound -!missing-selector! CSUserQuery::start not bound -!missing-selector! CSUserQueryContext::maxSuggestionCount not bound -!missing-selector! CSUserQueryContext::setMaxSuggestionCount: not bound -!missing-type! CSSearchQueryContext not bound -!missing-type! CSSuggestion not bound -!missing-type! CSTopHitQuery not bound -!missing-type! CSTopHitQueryContext not bound -!missing-type! CSUserQuery not bound -!missing-type! CSUserQueryContext 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 d776cd6930cf..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreSpotlight.todo +++ /dev/null @@ -1,39 +0,0 @@ -!missing-enum! CSSearchQuerySourceOptions not bound -!missing-enum! CSSuggestionKind not bound -!missing-field! CSSuggestionHighlightAttributeName not bound -!missing-selector! +CSTopHitQueryContext::topHitQueryContext not bound -!missing-selector! +CSTopHitQueryContext::topHitQueryContextWithCurrentSuggestion: not bound -!missing-selector! +CSUserQueryContext::userQueryContext not bound -!missing-selector! +CSUserQueryContext::userQueryContextWithCurrentSuggestion: not bound -!missing-selector! CSSearchableIndex::provideDataForBundle:identifier:type:completionHandler: not bound -!missing-selector! CSSearchQuery::initWithQueryString:queryContext: not bound -!missing-selector! CSSearchQueryContext::fetchAttributes not bound -!missing-selector! CSSearchQueryContext::filterQueries not bound -!missing-selector! CSSearchQueryContext::keyboardLanguage not bound -!missing-selector! CSSearchQueryContext::protectionClasses not bound -!missing-selector! CSSearchQueryContext::setFetchAttributes: not bound -!missing-selector! CSSearchQueryContext::setFilterQueries: not bound -!missing-selector! CSSearchQueryContext::setKeyboardLanguage: not bound -!missing-selector! CSSearchQueryContext::setProtectionClasses: not bound -!missing-selector! CSSearchQueryContext::setSourceOptions: not bound -!missing-selector! CSSearchQueryContext::sourceOptions not bound -!missing-selector! CSSuggestion::compare: not bound -!missing-selector! CSSuggestion::localizedAttributedSuggestion not bound -!missing-selector! CSSuggestion::suggestionKind not bound -!missing-selector! CSTopHitQuery::initWithUserQueryString:queryContext: not bound -!missing-selector! CSTopHitQueryContext::maxItemCount not bound -!missing-selector! CSTopHitQueryContext::setMaxItemCount: not bound -!missing-selector! CSUserQuery::cancel not bound -!missing-selector! CSUserQuery::foundSuggestionCount not bound -!missing-selector! CSUserQuery::foundSuggestionsHandler not bound -!missing-selector! CSUserQuery::initWithUserQueryString:queryContext: not bound -!missing-selector! CSUserQuery::setFoundSuggestionsHandler: not bound -!missing-selector! CSUserQuery::start not bound -!missing-selector! CSUserQueryContext::maxSuggestionCount not bound -!missing-selector! CSUserQueryContext::setMaxSuggestionCount: not bound -!missing-type! CSSearchQueryContext not bound -!missing-type! CSSuggestion not bound -!missing-type! CSTopHitQuery not bound -!missing-type! CSTopHitQueryContext not bound -!missing-type! CSUserQuery not bound -!missing-type! CSUserQueryContext not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreSpotlight.ignore b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreSpotlight.ignore new file mode 100644 index 000000000000..05ccc03b6f3f --- /dev/null +++ b/tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreSpotlight.ignore @@ -0,0 +1,2 @@ +# 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 ead53633b52d..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/tvOS-CoreSpotlight.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-enum! CSSuggestionKind not bound diff --git a/tests/xtro-sharpie/iOS-CoreSpotlight.todo b/tests/xtro-sharpie/iOS-CoreSpotlight.todo deleted file mode 100644 index d776cd6930cf..000000000000 --- a/tests/xtro-sharpie/iOS-CoreSpotlight.todo +++ /dev/null @@ -1,39 +0,0 @@ -!missing-enum! CSSearchQuerySourceOptions not bound -!missing-enum! CSSuggestionKind not bound -!missing-field! CSSuggestionHighlightAttributeName not bound -!missing-selector! +CSTopHitQueryContext::topHitQueryContext not bound -!missing-selector! +CSTopHitQueryContext::topHitQueryContextWithCurrentSuggestion: not bound -!missing-selector! +CSUserQueryContext::userQueryContext not bound -!missing-selector! +CSUserQueryContext::userQueryContextWithCurrentSuggestion: not bound -!missing-selector! CSSearchableIndex::provideDataForBundle:identifier:type:completionHandler: not bound -!missing-selector! CSSearchQuery::initWithQueryString:queryContext: not bound -!missing-selector! CSSearchQueryContext::fetchAttributes not bound -!missing-selector! CSSearchQueryContext::filterQueries not bound -!missing-selector! CSSearchQueryContext::keyboardLanguage not bound -!missing-selector! CSSearchQueryContext::protectionClasses not bound -!missing-selector! CSSearchQueryContext::setFetchAttributes: not bound -!missing-selector! CSSearchQueryContext::setFilterQueries: not bound -!missing-selector! CSSearchQueryContext::setKeyboardLanguage: not bound -!missing-selector! CSSearchQueryContext::setProtectionClasses: not bound -!missing-selector! CSSearchQueryContext::setSourceOptions: not bound -!missing-selector! CSSearchQueryContext::sourceOptions not bound -!missing-selector! CSSuggestion::compare: not bound -!missing-selector! CSSuggestion::localizedAttributedSuggestion not bound -!missing-selector! CSSuggestion::suggestionKind not bound -!missing-selector! CSTopHitQuery::initWithUserQueryString:queryContext: not bound -!missing-selector! CSTopHitQueryContext::maxItemCount not bound -!missing-selector! CSTopHitQueryContext::setMaxItemCount: not bound -!missing-selector! CSUserQuery::cancel not bound -!missing-selector! CSUserQuery::foundSuggestionCount not bound -!missing-selector! CSUserQuery::foundSuggestionsHandler not bound -!missing-selector! CSUserQuery::initWithUserQueryString:queryContext: not bound -!missing-selector! CSUserQuery::setFoundSuggestionsHandler: not bound -!missing-selector! CSUserQuery::start not bound -!missing-selector! CSUserQueryContext::maxSuggestionCount not bound -!missing-selector! CSUserQueryContext::setMaxSuggestionCount: not bound -!missing-type! CSSearchQueryContext not bound -!missing-type! CSSuggestion not bound -!missing-type! CSTopHitQuery not bound -!missing-type! CSTopHitQueryContext not bound -!missing-type! CSUserQuery not bound -!missing-type! CSUserQueryContext not bound diff --git a/tests/xtro-sharpie/macOS-CoreSpotlight.todo b/tests/xtro-sharpie/macOS-CoreSpotlight.todo deleted file mode 100644 index d776cd6930cf..000000000000 --- a/tests/xtro-sharpie/macOS-CoreSpotlight.todo +++ /dev/null @@ -1,39 +0,0 @@ -!missing-enum! CSSearchQuerySourceOptions not bound -!missing-enum! CSSuggestionKind not bound -!missing-field! CSSuggestionHighlightAttributeName not bound -!missing-selector! +CSTopHitQueryContext::topHitQueryContext not bound -!missing-selector! +CSTopHitQueryContext::topHitQueryContextWithCurrentSuggestion: not bound -!missing-selector! +CSUserQueryContext::userQueryContext not bound -!missing-selector! +CSUserQueryContext::userQueryContextWithCurrentSuggestion: not bound -!missing-selector! CSSearchableIndex::provideDataForBundle:identifier:type:completionHandler: not bound -!missing-selector! CSSearchQuery::initWithQueryString:queryContext: not bound -!missing-selector! CSSearchQueryContext::fetchAttributes not bound -!missing-selector! CSSearchQueryContext::filterQueries not bound -!missing-selector! CSSearchQueryContext::keyboardLanguage not bound -!missing-selector! CSSearchQueryContext::protectionClasses not bound -!missing-selector! CSSearchQueryContext::setFetchAttributes: not bound -!missing-selector! CSSearchQueryContext::setFilterQueries: not bound -!missing-selector! CSSearchQueryContext::setKeyboardLanguage: not bound -!missing-selector! CSSearchQueryContext::setProtectionClasses: not bound -!missing-selector! CSSearchQueryContext::setSourceOptions: not bound -!missing-selector! CSSearchQueryContext::sourceOptions not bound -!missing-selector! CSSuggestion::compare: not bound -!missing-selector! CSSuggestion::localizedAttributedSuggestion not bound -!missing-selector! CSSuggestion::suggestionKind not bound -!missing-selector! CSTopHitQuery::initWithUserQueryString:queryContext: not bound -!missing-selector! CSTopHitQueryContext::maxItemCount not bound -!missing-selector! CSTopHitQueryContext::setMaxItemCount: not bound -!missing-selector! CSUserQuery::cancel not bound -!missing-selector! CSUserQuery::foundSuggestionCount not bound -!missing-selector! CSUserQuery::foundSuggestionsHandler not bound -!missing-selector! CSUserQuery::initWithUserQueryString:queryContext: not bound -!missing-selector! CSUserQuery::setFoundSuggestionsHandler: not bound -!missing-selector! CSUserQuery::start not bound -!missing-selector! CSUserQueryContext::maxSuggestionCount not bound -!missing-selector! CSUserQueryContext::setMaxSuggestionCount: not bound -!missing-type! CSSearchQueryContext not bound -!missing-type! CSSuggestion not bound -!missing-type! CSTopHitQuery not bound -!missing-type! CSTopHitQueryContext not bound -!missing-type! CSUserQuery not bound -!missing-type! CSUserQueryContext not bound diff --git a/tests/xtro-sharpie/tvOS-CoreSpotlight.ignore b/tests/xtro-sharpie/tvOS-CoreSpotlight.ignore new file mode 100644 index 000000000000..05ccc03b6f3f --- /dev/null +++ b/tests/xtro-sharpie/tvOS-CoreSpotlight.ignore @@ -0,0 +1,2 @@ +# framework is not present on tvOS as of xcode 14.0 +!missing-enum! CSSuggestionKind not bound diff --git a/tests/xtro-sharpie/tvOS-CoreSpotlight.todo b/tests/xtro-sharpie/tvOS-CoreSpotlight.todo deleted file mode 100644 index ead53633b52d..000000000000 --- a/tests/xtro-sharpie/tvOS-CoreSpotlight.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-enum! CSSuggestionKind not bound