diff --git a/src/coremotion.cs b/src/coremotion.cs index e5b36154f5c9..1922c72c2025 100644 --- a/src/coremotion.cs +++ b/src/coremotion.cs @@ -834,6 +834,7 @@ interface CMAbsoluteAltitudeData // Just to please the generator that at this point does not know the hierarchy interface NSUnitPressure : NSUnit { } interface NSUnitTemperature : NSUnit { } + interface NSUnitLength : NSUnit { } [Watch (8,5), NoTV, NoMac, iOS (15,4), MacCatalyst (15,4)] [BaseType (typeof (CMLogItem))] @@ -859,4 +860,118 @@ interface CMRecordedPressureData { NSDate StartDate { get; } } + [NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV] + [Native] + public enum CMWaterSubmersionState : long + { + Unknown = 0, + NotSubmerged, + Submerged, + } + + [NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV] + [Native] + public enum CMWaterSubmersionDepthState : long + { + Unknown = 0, + NotSubmerged = 100, + SubmergedShallow = 200, + SubmergedDeep = 300, + ApproachingMaxDepth = 400, + PastMaxDepth = 500, + SensorDepthError = 600, + } + + [NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV] + [BaseType (typeof (NSObject))] + interface CMWaterSubmersionEvent : NSSecureCoding, NSCopying + { + [Export ("date")] + NSDate Date { get; } + + [Export ("state")] + CMWaterSubmersionState State { get; } + } + + [NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV] + [BaseType (typeof (NSObject))] + interface CMWaterSubmersionMeasurement : NSSecureCoding, NSCopying + { + [Export ("date")] + NSDate Date { get; } + + [NullAllowed, Export ("depth")] + NSMeasurement Depth { get; } + + [NullAllowed, Export ("pressure")] + NSMeasurement Pressure { get; } + + [Export ("surfacePressure")] + NSMeasurement SurfacePressure { get; } + + [Export ("submersionState")] + CMWaterSubmersionDepthState SubmersionState { get; } + } + + [NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV] + [BaseType (typeof (NSObject))] + interface CMWaterTemperature : NSSecureCoding, NSCopying + { + [Export ("date")] + NSDate Date { get; } + + [Export ("temperature")] + NSMeasurement Temperature { get; } + + [Export ("temperatureUncertainty")] + NSMeasurement TemperatureUncertainty { get; } + } + + interface ICMWaterSubmersionManagerDelegate { } + + [NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV] +#if NET + [Protocol, Model] +#else + [Protocol, Model (AutoGeneratedName = true)] +#endif + [BaseType (typeof (NSObject))] + interface CMWaterSubmersionManagerDelegate + { + [Abstract] + [Export ("manager:didUpdateEvent:")] + void DidUpdateEvent (CMWaterSubmersionManager manager, CMWaterSubmersionEvent @event); + + [Abstract] + [Export ("manager:didUpdateMeasurement:")] + void DidUpdateMeasurement (CMWaterSubmersionManager manager, CMWaterSubmersionMeasurement measurement); + + [Abstract] + [Export ("manager:didUpdateTemperature:")] + void DidUpdateTemperature (CMWaterSubmersionManager manager, CMWaterTemperature measurement); + + [Abstract] + [Export ("manager:errorOccurred:")] + void ErrorOccurred (CMWaterSubmersionManager manager, NSError error); + } + + [NoMac, NoiOS, NoMacCatalyst, Watch (9,0), NoTV] + [BaseType (typeof (NSObject))] + interface CMWaterSubmersionManager + { + [Wrap ("WeakDelegate")] + [NullAllowed] + ICMWaterSubmersionManagerDelegate Delegate { get; set; } + + [NullAllowed, Export ("delegate", ArgumentSemantic.Weak)] + NSObject WeakDelegate { get; set; } + + [Static] + [Export ("waterSubmersionAvailable")] + bool IsWaterSubmersionAvailable { get; } + + [Static] + [Export ("authorizationStatus")] + CMAuthorizationStatus AuthorizationStatus { get; } + } } diff --git a/tests/xtro-sharpie/watchOS-CoreMotion.todo b/tests/xtro-sharpie/watchOS-CoreMotion.todo index 3b2cef6f3e91..6305f910cab5 100644 --- a/tests/xtro-sharpie/watchOS-CoreMotion.todo +++ b/tests/xtro-sharpie/watchOS-CoreMotion.todo @@ -1,22 +1 @@ !missing-selector! +CMMovementDisorderManager::version not bound -!missing-enum! CMWaterSubmersionDepthState not bound -!missing-enum! CMWaterSubmersionState not bound -!missing-protocol! CMWaterSubmersionManagerDelegate not bound -!missing-selector! +CMWaterSubmersionManager::authorizationStatus not bound -!missing-selector! +CMWaterSubmersionManager::waterSubmersionAvailable not bound -!missing-selector! CMWaterSubmersionEvent::date not bound -!missing-selector! CMWaterSubmersionEvent::state not bound -!missing-selector! CMWaterSubmersionManager::delegate not bound -!missing-selector! CMWaterSubmersionManager::setDelegate: not bound -!missing-selector! CMWaterSubmersionMeasurement::date not bound -!missing-selector! CMWaterSubmersionMeasurement::depth not bound -!missing-selector! CMWaterSubmersionMeasurement::pressure not bound -!missing-selector! CMWaterSubmersionMeasurement::submersionState not bound -!missing-selector! CMWaterSubmersionMeasurement::surfacePressure not bound -!missing-selector! CMWaterTemperature::date not bound -!missing-selector! CMWaterTemperature::temperature not bound -!missing-selector! CMWaterTemperature::temperatureUncertainty not bound -!missing-type! CMWaterSubmersionEvent not bound -!missing-type! CMWaterSubmersionManager not bound -!missing-type! CMWaterSubmersionMeasurement not bound -!missing-type! CMWaterTemperature not bound