[safariservices] Update for Xcode 11 beta 1 to 5 (#6767)

Also introduce `PlatformName.MacCatalyst` while keeping the old
`UIKitForMac`, with the same value, until we can clean up existing
bindings globally (and without too much conflicts).
This commit is contained in:
Sebastien Pouliot 2019-08-14 10:41:44 -04:00 коммит произвёл GitHub
Родитель 667abf2b83
Коммит 6daac2c687
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 43 добавлений и 9 удалений

Просмотреть файл

@ -37,7 +37,8 @@ namespace ObjCRuntime
iOS,
WatchOS,
TvOS,
UIKitForMac,
MacCatalyst,
UIKitForMac = MacCatalyst, // temporary
}
public enum AvailabilityKind

Просмотреть файл

@ -5,14 +5,19 @@
// Sebastien Pouliot <sebastien@xamarin.com>
//
// Copyright 2013-2014, 2016 Xamarin Inc.
// Copyright 2019 Microsoft Corporation
//
using System;
using Foundation;
using ObjCRuntime;
namespace SafariServices {
// NSInteger -> SSReadingList.h
[NoMac][iOS (7,0)]
[Unavailable (PlatformName.MacCatalyst)][Advice ("This API is not available when using UIKit on macOS.")]
[Native]
[ErrorDomain ("SSReadingListErrorDomain")]
public enum SSReadingListError : long {
@ -22,6 +27,7 @@ namespace SafariServices {
[NoMac]
[iOS (9,0)]
[Deprecated (PlatformName.iOS, 10,0, message: "Use 'SFErrorCode' enum.")]
[Unavailable (PlatformName.MacCatalyst)][Advice ("This API is not available when using UIKit on macOS.")]
[Native]
[ErrorDomain ("SFContentBlockerErrorDomain")]
public enum SFContentBlockerErrorCode : long {
@ -32,6 +38,7 @@ namespace SafariServices {
}
[iOS (10,0)]
[Unavailable (PlatformName.MacCatalyst)][Advice ("This API is not available when using UIKit on macOS.")]
[Native]
[ErrorDomain ("SFErrorDomain")]
public enum SFErrorCode : long
@ -60,6 +67,8 @@ namespace SafariServices {
CanceledLogin = 1,
}
#if !XAMCORE_4_0
[Obsolete ("Enum not used by any API.")]
[NoiOS]
[Mac (10,12,4)]
[Native]
@ -69,4 +78,5 @@ namespace SafariServices {
[Mac (10,13)]
V11_0,
}
#endif
}

Просмотреть файл

@ -6,6 +6,8 @@
// Sebastien Pouliot <sebastien@xamarin.com>
//
// Copyright 2013 Xamarin Inc.
// Copyright 2019 Microsoft Corporation
//
using System;
@ -21,6 +23,7 @@ namespace SafariServices {
delegate void SFExtensionValidationHandler (bool shouldHide, NSString text);
[Mac (10,12)][iOS (10,0)]
[Unavailable (PlatformName.MacCatalyst)][Advice ("This API is not available when using UIKit on macOS.")]
[BaseType (typeof(NSObject))]
interface SFContentBlockerState
{
@ -29,6 +32,7 @@ namespace SafariServices {
}
[iOS (9,0)][Mac (10,12)]
[Unavailable (PlatformName.MacCatalyst)][Advice ("This API is not available when using UIKit on macOS.")]
[BaseType (typeof (NSObject))]
interface SFContentBlockerManager {
[Async]
@ -43,6 +47,7 @@ namespace SafariServices {
#if !MONOMAC
[iOS (7,0)]
[Unavailable (PlatformName.MacCatalyst)][Advice ("This API is not available when using UIKit on macOS.")]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor] // NSGenericException Misuse of SSReadingList interface. Use class method defaultReadingList.
partial interface SSReadingList {
@ -266,6 +271,14 @@ namespace SafariServices {
[Mac (10,13,4)]
[Export ("additionalRequestHeadersForURL:completionHandler:")]
void AdditionalRequestHeaders (NSUrl url, Action<NSDictionary<NSString, NSString>> completionHandler);
[Mac (10,15)]
[Export ("contentBlockerWithIdentifier:blockedResourcesWithURLs:onPage:")]
void ContentBlocker (string contentBlockerIdentifier, NSUrl[] urls, SFSafariPage page);
[Mac (10,15)]
[Export ("page:willNavigateToURL:")]
void WillNavigate (SFSafariPage page, [NullAllowed] NSUrl url);
}
[Mac (10,14,4)]
@ -418,5 +431,23 @@ namespace SafariServices {
// [Export ("enabled")]
// bool Enabled { [Bind ("isEnabled")] get; }
// }
[Mac (10,15)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface SFUniversalLink {
[Export ("initWithWebpageURL:")]
IntPtr Constructor (NSUrl url);
[Export ("webpageURL")]
NSUrl WebpageUrl { get; }
[Export ("applicationURL")]
NSUrl ApplicationUrl { get; }
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }
}
#endif
}

Просмотреть файл

@ -1,8 +0,0 @@
!missing-protocol-member! SFSafariExtensionHandling::contentBlockerWithIdentifier:blockedResourcesWithURLs:onPage: not found
!missing-protocol-member! SFSafariExtensionHandling::page:willNavigateToURL: not found
!missing-selector! SFUniversalLink::applicationURL not bound
!missing-selector! SFUniversalLink::initWithWebpageURL: not bound
!missing-selector! SFUniversalLink::isEnabled not bound
!missing-selector! SFUniversalLink::setEnabled: not bound
!missing-selector! SFUniversalLink::webpageURL not bound
!missing-type! SFUniversalLink not bound