From 62a9fd98c443e208a52d522ed68f6a392257b553 Mon Sep 17 00:00:00 2001 From: TJ Lambert <50846373+tj-devel709@users.noreply.github.com> Date: Fri, 23 Jul 2021 14:16:28 -0500 Subject: [PATCH] [SensorKit] Updates for Xcode13 Beta1 No updates for Beta 2 or 3 --- src/sensorkit.cs | 87 +++++++++++++++++++ tests/introspection/iOS/iOSApiProtocolTest.cs | 2 + tests/xtro-sharpie/MacCatalyst-SensorKit.todo | 17 ---- tests/xtro-sharpie/iOS-SensorKit.todo | 17 ---- 4 files changed, 89 insertions(+), 34 deletions(-) delete mode 100644 tests/xtro-sharpie/MacCatalyst-SensorKit.todo delete mode 100644 tests/xtro-sharpie/iOS-SensorKit.todo diff --git a/src/sensorkit.cs b/src/sensorkit.cs index e850df928735..01f8316be466 100644 --- a/src/sensorkit.cs +++ b/src/sensorkit.cs @@ -122,6 +122,32 @@ enum SRWristLocation : long Right, } + [NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)] + [Native] + public enum SRKeyboardMetricsSentimentCategory : long + { + Absolutist, + Down, + Death, + Anxiety, + Anger, + Health, + Positive, + Sad, + LowEnergy, + Confused, + } + + [NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)] + [Native] + public enum SRTextInputSessionType : long + { + Keyboard = 1, + ThirdPartyKeyboard, + Pencil, + Dictation, + } + [NoWatch, NoTV, NoMac] [iOS (14,0)] [MacCatalyst (14,0)] @@ -243,6 +269,14 @@ interface SRApplicationUsage { [Export ("usageTime")] double /* NSTimeInterval */ UsageTime { get; } + + [iOS (15,0), MacCatalyst (15,0)] + [Export ("reportApplicationIdentifier")] + string ReportApplicationIdentifier { get; } + + [iOS (15,0), MacCatalyst (15,0)] + [Export ("textInputSessions", ArgumentSemantic.Copy)] + SRTextInputSession[] TextInputSessions { get; } } [NoWatch, NoTV, NoMac] @@ -376,6 +410,10 @@ interface SRKeyboardMetrics { [Export ("height")] NSMeasurement Height { get; } + [iOS (15,0), MacCatalyst (15,0)] + [Export ("inputModes", ArgumentSemantic.Copy)] + string[] InputModes { get; } + // SRKeyboardMetrics_ScalarMetrics [Export ("totalWords")] @@ -573,6 +611,36 @@ interface SRKeyboardMetrics { [Export ("deleteToDeletes", ArgumentSemantic.Strong)] SRKeyboardProbabilityMetric[] DeleteToDeletes { get; } + + [iOS (15,0), MacCatalyst (15,0)] + [Export ("pathTypingSpeed")] + double PathTypingSpeed { get; } + + [iOS (15,0), MacCatalyst (15,0)] + [Export ("totalPathPauses")] + nint TotalPathPauses { get; } + + [iOS (15,0), MacCatalyst (15,0)] + [Export ("totalPauses")] + nint TotalPauses { get; } + + [iOS (15,0), MacCatalyst (15,0)] + [Export ("totalTypingEpisodes")] + nint TotalTypingEpisodes { get; } + + [iOS (15,0), MacCatalyst (15,0)] + [Export ("typingSpeed")] + double TypingSpeed { get; } + + // SRKeyboardMetrics_SentimentCounts + + [iOS (15,0), MacCatalyst (15,0)] + [Export ("wordCountForSentimentCategory:")] + nint WordCount (SRKeyboardMetricsSentimentCategory category); + + [iOS (15,0), MacCatalyst (15,0)] + [Export ("emojiCountForSentimentCategory:")] + nint EmojiCount (SRKeyboardMetricsSentimentCategory category); } [NoWatch, NoTV, NoMac] @@ -708,6 +776,14 @@ enum SRSensor { [Field ("SRSensorKeyboardMetrics")] KeyboardMetrics, + + [iOS (15,0), MacCatalyst (15,0)] + [Field ("SRSensorSiriSpeechMetrics")] + SiriSpeechMetrics, + + [iOS (15,0), MacCatalyst (15,0)] + [Field ("SRSensorTelephonySpeechMetrics")] + TelephonySpeechMetrics, } [NoWatch, NoTV, NoMac] @@ -821,4 +897,15 @@ interface NSString_SRDeletionRecord { [Export ("sr_sensorForDeletionRecordsFromSensor")] NSString _GetSensorForDeletionRecordsFromSensor (); } + + [NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)] + [BaseType (typeof (NSObject))] + interface SRTextInputSession /* privately conforms to NSCoding and NSSecureCoding */ + { + [Export ("duration")] + double Duration { get; } + + [Export ("sessionType")] + SRTextInputSessionType SessionType { get; } + } } diff --git a/tests/introspection/iOS/iOSApiProtocolTest.cs b/tests/introspection/iOS/iOSApiProtocolTest.cs index facb90a3c2fe..445f9913676e 100644 --- a/tests/introspection/iOS/iOSApiProtocolTest.cs +++ b/tests/introspection/iOS/iOSApiProtocolTest.cs @@ -440,6 +440,7 @@ protected override bool Skip (Type type, string protocolName) case "ARDepthData": case "ARSkeletonDefinition": // device only case "NSMergePolicy": + case "SRTextInputSession": // conformance not in headers return true; } break; @@ -678,6 +679,7 @@ protected override bool Skip (Type type, string protocolName) case "ARDepthData": case "ARSkeletonDefinition": // device only case "NSMergePolicy": + case "SRTextInputSession": // conformance not in headers return true; } break; diff --git a/tests/xtro-sharpie/MacCatalyst-SensorKit.todo b/tests/xtro-sharpie/MacCatalyst-SensorKit.todo deleted file mode 100644 index 78da43759e0e..000000000000 --- a/tests/xtro-sharpie/MacCatalyst-SensorKit.todo +++ /dev/null @@ -1,17 +0,0 @@ -!missing-enum! SRKeyboardMetricsSentimentCategory not bound -!missing-enum! SRTextInputSessionType not bound -!missing-field! SRSensorSiriSpeechMetrics not bound -!missing-field! SRSensorTelephonySpeechMetrics not bound -!missing-selector! SRApplicationUsage::reportApplicationIdentifier not bound -!missing-selector! SRApplicationUsage::textInputSessions not bound -!missing-selector! SRKeyboardMetrics::emojiCountForSentimentCategory: not bound -!missing-selector! SRKeyboardMetrics::inputModes not bound -!missing-selector! SRKeyboardMetrics::pathTypingSpeed not bound -!missing-selector! SRKeyboardMetrics::totalPathPauses not bound -!missing-selector! SRKeyboardMetrics::totalPauses not bound -!missing-selector! SRKeyboardMetrics::totalTypingEpisodes not bound -!missing-selector! SRKeyboardMetrics::typingSpeed not bound -!missing-selector! SRKeyboardMetrics::wordCountForSentimentCategory: not bound -!missing-selector! SRTextInputSession::duration not bound -!missing-selector! SRTextInputSession::sessionType not bound -!missing-type! SRTextInputSession not bound diff --git a/tests/xtro-sharpie/iOS-SensorKit.todo b/tests/xtro-sharpie/iOS-SensorKit.todo deleted file mode 100644 index 78da43759e0e..000000000000 --- a/tests/xtro-sharpie/iOS-SensorKit.todo +++ /dev/null @@ -1,17 +0,0 @@ -!missing-enum! SRKeyboardMetricsSentimentCategory not bound -!missing-enum! SRTextInputSessionType not bound -!missing-field! SRSensorSiriSpeechMetrics not bound -!missing-field! SRSensorTelephonySpeechMetrics not bound -!missing-selector! SRApplicationUsage::reportApplicationIdentifier not bound -!missing-selector! SRApplicationUsage::textInputSessions not bound -!missing-selector! SRKeyboardMetrics::emojiCountForSentimentCategory: not bound -!missing-selector! SRKeyboardMetrics::inputModes not bound -!missing-selector! SRKeyboardMetrics::pathTypingSpeed not bound -!missing-selector! SRKeyboardMetrics::totalPathPauses not bound -!missing-selector! SRKeyboardMetrics::totalPauses not bound -!missing-selector! SRKeyboardMetrics::totalTypingEpisodes not bound -!missing-selector! SRKeyboardMetrics::typingSpeed not bound -!missing-selector! SRKeyboardMetrics::wordCountForSentimentCategory: not bound -!missing-selector! SRTextInputSession::duration not bound -!missing-selector! SRTextInputSession::sessionType not bound -!missing-type! SRTextInputSession not bound