From 2f8773dee0f0dae7bc6c8a9ff639a9482d980ca8 Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Tue, 29 Aug 2023 14:01:58 -0400 Subject: [PATCH 1/3] [EventKit] Add support for Xcode 15 beta 7 --- src/EventKit/EKEnums.cs | 1 + src/eventkit.cs | 20 +++++++++++++++++++ .../MacCatalyst-EventKit.todo | 2 -- .../common-EventKit.ignore | 2 ++ .../iOS-EventKit.ignore | 3 --- .../api-annotations-dotnet/iOS-EventKit.todo | 5 ----- .../macOS-EventKit.todo | 5 ----- tests/xtro-sharpie/common-EventKit.ignore | 1 + tests/xtro-sharpie/iOS-EventKit.ignore | 1 - tests/xtro-sharpie/iOS-EventKit.todo | 5 ----- tests/xtro-sharpie/macOS-EventKit.todo | 5 ----- tests/xtro-sharpie/watchOS-EventKit.ignore | 1 - tests/xtro-sharpie/watchOS-EventKit.todo | 5 ----- 13 files changed, 24 insertions(+), 32 deletions(-) delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-EventKit.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/iOS-EventKit.todo delete mode 100644 tests/xtro-sharpie/api-annotations-dotnet/macOS-EventKit.todo delete mode 100644 tests/xtro-sharpie/iOS-EventKit.todo delete mode 100644 tests/xtro-sharpie/macOS-EventKit.todo delete mode 100644 tests/xtro-sharpie/watchOS-EventKit.ignore delete mode 100644 tests/xtro-sharpie/watchOS-EventKit.todo diff --git a/src/EventKit/EKEnums.cs b/src/EventKit/EKEnums.cs index 4ac03bd1d665..ebbf90678c8c 100644 --- a/src/EventKit/EKEnums.cs +++ b/src/EventKit/EKEnums.cs @@ -190,6 +190,7 @@ public enum EKAuthorizationStatus : long { Restricted, Denied, Authorized, + WriteOnly, } [Native] diff --git a/src/eventkit.cs b/src/eventkit.cs index 3618b2721b53..c05ca633be71 100644 --- a/src/eventkit.cs +++ b/src/eventkit.cs @@ -672,16 +672,36 @@ interface EKEventStore { EKSource [] DelegateSources { get; } [MacCatalyst (13, 1)] + [Deprecated(PlatformName.iOS, 17, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] + [Deprecated(PlatformName.MacOSX, 14, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] + [Deprecated(PlatformName.WatchOS, 10, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] + [Deprecated(PlatformName.MacCatalyst, 17, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] [Export ("requestAccessToEntityType:completion:")] [Async] void RequestAccess (EKEntityType entityType, Action completionHandler); + [Watch(10, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17,0)] + [Export("requestFullAccessToEventsWithCompletion:")] + [Async] + void RequestFullAccessToEventsWithCompletion(EKEventStoreRequestAccessCompletionHandler completion); + + [Watch(10, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Export("requestWriteOnlyAccessToEventsWithCompletion:")] + [Async] + void RequestWriteOnlyAccessToEventsWithCompletion(EKEventStoreRequestAccessCompletionHandler completion); + + [Watch(10, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] + [Export("requestFullAccessToRemindersWithCompletion:")] + [Async] + void RequestFullAccessToRemindersWithCompletion(EKEventStoreRequestAccessCompletionHandler completion); + [MacCatalyst (13, 1)] [Static] [Export ("authorizationStatusForEntityType:")] EKAuthorizationStatus GetAuthorizationStatus (EKEntityType entityType); } + delegate void EKEventStoreRequestAccessCompletionHandler(bool didRequestAccess, NSError error); delegate void EKEventSearchCallback (EKEvent theEvent, ref bool stop); [BaseType (typeof (EKCalendarItem))] diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-EventKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-EventKit.todo deleted file mode 100644 index 0a68ddde7e58..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-EventKit.todo +++ /dev/null @@ -1,2 +0,0 @@ -!missing-selector! EKEventStore::initWithSources: not bound -!missing-selector! EKSource::isDelegate not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/common-EventKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/common-EventKit.ignore index c307fed79a52..71563e436c3c 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/common-EventKit.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/common-EventKit.ignore @@ -1,2 +1,4 @@ ## extra value so the enum is easier to create !extra-enum-value! Managed value 0 for EKWeekday.NotSet not found in native headers +## `Last` value can change overtime - which would be a breaking change for us +!missing-enum-value! EKErrorCode native value EKErrorLast = 37 not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-EventKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/iOS-EventKit.ignore index 5e616188615c..f6a5ffc2ac08 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-EventKit.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/iOS-EventKit.ignore @@ -1,5 +1,2 @@ ## only available on OSX (NA or unused in iOS) !missing-enum! EKAlarmType not bound - -## `Last` value can change overtime - which would be a breaking change for us -!missing-enum-value! EKErrorCode native value EKErrorLast = 37 not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-EventKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/iOS-EventKit.todo deleted file mode 100644 index d6f2b90fb855..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-EventKit.todo +++ /dev/null @@ -1,5 +0,0 @@ -!deprecated-attribute-missing! EKEventStore::requestAccessToEntityType:completion: missing a [Deprecated] attribute -!missing-enum-value! EKAuthorizationStatus native value EKAuthorizationStatusWriteOnly = 4 not bound -!missing-selector! EKEventStore::requestFullAccessToEventsWithCompletion: not bound -!missing-selector! EKEventStore::requestFullAccessToRemindersWithCompletion: not bound -!missing-selector! EKEventStore::requestWriteOnlyAccessToEventsWithCompletion: not bound diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-EventKit.todo b/tests/xtro-sharpie/api-annotations-dotnet/macOS-EventKit.todo deleted file mode 100644 index dd7e7062c9b1..000000000000 --- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-EventKit.todo +++ /dev/null @@ -1,5 +0,0 @@ -!missing-enum-value! EKErrorCode native value EKErrorLast = 37 not bound -!missing-enum-value! EKAuthorizationStatus native value EKAuthorizationStatusWriteOnly = 4 not bound -!missing-selector! EKEventStore::requestFullAccessToEventsWithCompletion: not bound -!missing-selector! EKEventStore::requestFullAccessToRemindersWithCompletion: not bound -!missing-selector! EKEventStore::requestWriteOnlyAccessToEventsWithCompletion: not bound diff --git a/tests/xtro-sharpie/common-EventKit.ignore b/tests/xtro-sharpie/common-EventKit.ignore index 4b5300244841..71563e436c3c 100644 --- a/tests/xtro-sharpie/common-EventKit.ignore +++ b/tests/xtro-sharpie/common-EventKit.ignore @@ -1,3 +1,4 @@ ## extra value so the enum is easier to create !extra-enum-value! Managed value 0 for EKWeekday.NotSet not found in native headers ## `Last` value can change overtime - which would be a breaking change for us +!missing-enum-value! EKErrorCode native value EKErrorLast = 37 not bound diff --git a/tests/xtro-sharpie/iOS-EventKit.ignore b/tests/xtro-sharpie/iOS-EventKit.ignore index 892eca3b1877..f6a5ffc2ac08 100644 --- a/tests/xtro-sharpie/iOS-EventKit.ignore +++ b/tests/xtro-sharpie/iOS-EventKit.ignore @@ -1,3 +1,2 @@ ## only available on OSX (NA or unused in iOS) !missing-enum! EKAlarmType not bound -!missing-enum-value! EKErrorCode native value EKErrorLast = 37 not bound diff --git a/tests/xtro-sharpie/iOS-EventKit.todo b/tests/xtro-sharpie/iOS-EventKit.todo deleted file mode 100644 index d6f2b90fb855..000000000000 --- a/tests/xtro-sharpie/iOS-EventKit.todo +++ /dev/null @@ -1,5 +0,0 @@ -!deprecated-attribute-missing! EKEventStore::requestAccessToEntityType:completion: missing a [Deprecated] attribute -!missing-enum-value! EKAuthorizationStatus native value EKAuthorizationStatusWriteOnly = 4 not bound -!missing-selector! EKEventStore::requestFullAccessToEventsWithCompletion: not bound -!missing-selector! EKEventStore::requestFullAccessToRemindersWithCompletion: not bound -!missing-selector! EKEventStore::requestWriteOnlyAccessToEventsWithCompletion: not bound diff --git a/tests/xtro-sharpie/macOS-EventKit.todo b/tests/xtro-sharpie/macOS-EventKit.todo deleted file mode 100644 index dd7e7062c9b1..000000000000 --- a/tests/xtro-sharpie/macOS-EventKit.todo +++ /dev/null @@ -1,5 +0,0 @@ -!missing-enum-value! EKErrorCode native value EKErrorLast = 37 not bound -!missing-enum-value! EKAuthorizationStatus native value EKAuthorizationStatusWriteOnly = 4 not bound -!missing-selector! EKEventStore::requestFullAccessToEventsWithCompletion: not bound -!missing-selector! EKEventStore::requestFullAccessToRemindersWithCompletion: not bound -!missing-selector! EKEventStore::requestWriteOnlyAccessToEventsWithCompletion: not bound diff --git a/tests/xtro-sharpie/watchOS-EventKit.ignore b/tests/xtro-sharpie/watchOS-EventKit.ignore deleted file mode 100644 index d685ac387bd7..000000000000 --- a/tests/xtro-sharpie/watchOS-EventKit.ignore +++ /dev/null @@ -1 +0,0 @@ -!missing-enum-value! EKErrorCode native value EKErrorLast = 37 not bound diff --git a/tests/xtro-sharpie/watchOS-EventKit.todo b/tests/xtro-sharpie/watchOS-EventKit.todo deleted file mode 100644 index d6f2b90fb855..000000000000 --- a/tests/xtro-sharpie/watchOS-EventKit.todo +++ /dev/null @@ -1,5 +0,0 @@ -!deprecated-attribute-missing! EKEventStore::requestAccessToEntityType:completion: missing a [Deprecated] attribute -!missing-enum-value! EKAuthorizationStatus native value EKAuthorizationStatusWriteOnly = 4 not bound -!missing-selector! EKEventStore::requestFullAccessToEventsWithCompletion: not bound -!missing-selector! EKEventStore::requestFullAccessToRemindersWithCompletion: not bound -!missing-selector! EKEventStore::requestWriteOnlyAccessToEventsWithCompletion: not bound From ad0e0a8bbabf9b84a368797b56e2a72bc1fbd96c Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Tue, 29 Aug 2023 18:08:15 +0000 Subject: [PATCH 2/3] Auto-format source code --- src/eventkit.cs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/eventkit.cs b/src/eventkit.cs index c05ca633be71..6176c1b6f991 100644 --- a/src/eventkit.cs +++ b/src/eventkit.cs @@ -672,28 +672,28 @@ interface EKEventStore { EKSource [] DelegateSources { get; } [MacCatalyst (13, 1)] - [Deprecated(PlatformName.iOS, 17, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] - [Deprecated(PlatformName.MacOSX, 14, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] - [Deprecated(PlatformName.WatchOS, 10, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] - [Deprecated(PlatformName.MacCatalyst, 17, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] + [Deprecated (PlatformName.iOS, 17, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] + [Deprecated (PlatformName.MacOSX, 14, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] + [Deprecated (PlatformName.WatchOS, 10, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] + [Deprecated (PlatformName.MacCatalyst, 17, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] [Export ("requestAccessToEntityType:completion:")] [Async] void RequestAccess (EKEntityType entityType, Action completionHandler); - [Watch(10, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17,0)] - [Export("requestFullAccessToEventsWithCompletion:")] + [Watch (10, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Export ("requestFullAccessToEventsWithCompletion:")] [Async] - void RequestFullAccessToEventsWithCompletion(EKEventStoreRequestAccessCompletionHandler completion); + void RequestFullAccessToEventsWithCompletion (EKEventStoreRequestAccessCompletionHandler completion); - [Watch(10, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [Export("requestWriteOnlyAccessToEventsWithCompletion:")] + [Watch (10, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Export ("requestWriteOnlyAccessToEventsWithCompletion:")] [Async] - void RequestWriteOnlyAccessToEventsWithCompletion(EKEventStoreRequestAccessCompletionHandler completion); + void RequestWriteOnlyAccessToEventsWithCompletion (EKEventStoreRequestAccessCompletionHandler completion); - [Watch(10, 0), Mac(14, 0), iOS(17, 0), MacCatalyst(17, 0)] - [Export("requestFullAccessToRemindersWithCompletion:")] + [Watch (10, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] + [Export ("requestFullAccessToRemindersWithCompletion:")] [Async] - void RequestFullAccessToRemindersWithCompletion(EKEventStoreRequestAccessCompletionHandler completion); + void RequestFullAccessToRemindersWithCompletion (EKEventStoreRequestAccessCompletionHandler completion); [MacCatalyst (13, 1)] [Static] @@ -701,7 +701,7 @@ interface EKEventStore { EKAuthorizationStatus GetAuthorizationStatus (EKEntityType entityType); } - delegate void EKEventStoreRequestAccessCompletionHandler(bool didRequestAccess, NSError error); + delegate void EKEventStoreRequestAccessCompletionHandler (bool didRequestAccess, NSError error); delegate void EKEventSearchCallback (EKEvent theEvent, ref bool stop); [BaseType (typeof (EKCalendarItem))] From a3c11cce051d7ad65ab7ed95ff9935e10f90992b Mon Sep 17 00:00:00 2001 From: Haritha Mohan Date: Wed, 30 Aug 2023 10:15:34 -0400 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Alex Soto --- src/eventkit.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/eventkit.cs b/src/eventkit.cs index 6176c1b6f991..d812065f0ade 100644 --- a/src/eventkit.cs +++ b/src/eventkit.cs @@ -672,10 +672,10 @@ interface EKEventStore { EKSource [] DelegateSources { get; } [MacCatalyst (13, 1)] - [Deprecated (PlatformName.iOS, 17, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] - [Deprecated (PlatformName.MacOSX, 14, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] - [Deprecated (PlatformName.WatchOS, 10, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] - [Deprecated (PlatformName.MacCatalyst, 17, 0, message: "Use RequestFullAccessToEventsWithCompletion, RequestWriteOnlyAccessToEventsWithCompletion, or RequestFullAccessToRemindersWithCompletion.")] + [Deprecated (PlatformName.iOS, 17, 0, message: "Use RequestFullAccessToEvents, RequestWriteOnlyAccessToEvents, or RequestFullAccessToReminders.")] + [Deprecated (PlatformName.MacOSX, 14, 0, message: "Use RequestFullAccessToEvents, RequestWriteOnlyAccessToEvents, or RequestFullAccessToReminders.")] + [Deprecated (PlatformName.WatchOS, 10, 0, message: "Use RequestFullAccessToEvents, RequestWriteOnlyAccessToEvents, or RequestFullAccessToReminders.")] + [Deprecated (PlatformName.MacCatalyst, 17, 0, message: "Use RequestFullAccessToEvents, RequestWriteOnlyAccessToEvents, or RequestFullAccessToReminders.")] [Export ("requestAccessToEntityType:completion:")] [Async] void RequestAccess (EKEntityType entityType, Action completionHandler); @@ -683,17 +683,17 @@ interface EKEventStore { [Watch (10, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] [Export ("requestFullAccessToEventsWithCompletion:")] [Async] - void RequestFullAccessToEventsWithCompletion (EKEventStoreRequestAccessCompletionHandler completion); + void RequestFullAccessToEvents (EKEventStoreRequestAccessCompletionHandler completion); [Watch (10, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] [Export ("requestWriteOnlyAccessToEventsWithCompletion:")] [Async] - void RequestWriteOnlyAccessToEventsWithCompletion (EKEventStoreRequestAccessCompletionHandler completion); + void RequestWriteOnlyAccessToEvents (EKEventStoreRequestAccessCompletionHandler completion); [Watch (10, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)] [Export ("requestFullAccessToRemindersWithCompletion:")] [Async] - void RequestFullAccessToRemindersWithCompletion (EKEventStoreRequestAccessCompletionHandler completion); + void RequestFullAccessToReminders (EKEventStoreRequestAccessCompletionHandler completion); [MacCatalyst (13, 1)] [Static]