From 9312c3b49babe3fb208280dc80285aa8b7a88700 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Mon, 14 Jun 2021 14:07:36 -0400 Subject: [PATCH] [CarPlay] Add support for Xcode13 beta1. --- src/carplay.cs | 157 ++++++++++++++++++++++++++ tests/xtro-sharpie/iOS-CarPlay.ignore | 2 + tests/xtro-sharpie/iOS-CarPlay.todo | 26 ----- 3 files changed, 159 insertions(+), 26 deletions(-) delete mode 100644 tests/xtro-sharpie/iOS-CarPlay.todo diff --git a/src/carplay.cs b/src/carplay.cs index 7ba41f47295f..246838953355 100644 --- a/src/carplay.cs +++ b/src/carplay.cs @@ -164,6 +164,97 @@ public enum CPTextButtonStyle : long Confirm, } + [NoWatch, NoTV, NoMac, iOS (15,0)] + [Native] + public enum CPAssistantCellPosition : long + { + Top = 0, + Bottom, + } + + [NoWatch, NoTV, NoMac, iOS (15,0)] + [Native] + public enum CPAssistantCellVisibility : long + { + Off = 0, + WhileLimitedUIActive, + Always, + } + + + [NoWatch, NoTV, NoMac, iOS (15,0)] + public enum CPJunctionType : byte + { + Intersection = 0, + Roundabout = 1, + } + + [NoWatch, NoTV, NoMac, iOS (15,0)] + public enum CPTrafficSide : byte + { + Right = 0, + Left = 1, + } + + [NoWatch, NoTV, NoMac, iOS (15,0)] + public enum CPManeuverType : byte + { + NoTurn = 0, + LeftTurn = 1, + RightTurn = 2, + StraightAhead = 3, + UTurn = 4, + FollowRoad = 5, + EnterRoundabout = 6, + ExitRoundabout = 7, + OffRamp = 8, + OnRamp = 9, + ArriveEndOfNavigation = 10, + StartRoute = 11, + ArriveAtDestination = 12, + KeepLeft = 13, + KeepRight = 14, + EnterFerry = 15, + ExitFerry = 16, + ChangeFerry = 17, + StartRouteWithUTurn = 18, + UTurnAtRoundabout = 19, + LeftTurnAtEnd = 20, + RightTurnAtEnd = 21, + HighwayOffRampLeft = 22, + HighwayOffRampRight = 23, + ArriveAtDestinationLeft = 24, + ArriveAtDestinationRight = 25, + UTurnWhenPossible = 26, + ArriveEndOfDirections = 27, + RoundaboutExit1 = 28, + RoundaboutExit2 = 29, + RoundaboutExit3 = 30, + RoundaboutExit4 = 31, + RoundaboutExit5 = 32, + RoundaboutExit6 = 33, + RoundaboutExit7 = 34, + RoundaboutExit8 = 35, + RoundaboutExit9 = 36, + RoundaboutExit10 = 37, + RoundaboutExit11 = 38, + RoundaboutExit12 = 39, + RoundaboutExit13 = 40, + RoundaboutExit14 = 41, + RoundaboutExit15 = 42, + RoundaboutExit16 = 43, + RoundaboutExit17 = 44, + RoundaboutExit18 = 45, + RoundaboutExit19 = 46, + SharpLeftTurn = 47, + SharpRightTurn = 48, + SlightLeftTurn = 49, + SlightRightTurn = 50, + ChangeHighway = 51, + ChangeHighwayLeft = 52, + ChangeHighwayRight = 53, + } + [NoWatch, NoTV, NoMac, iOS (12,0)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] @@ -273,6 +364,18 @@ interface CPGridTemplate : CPBarButtonProviding{ [Export ("title")] string Title { get; } + + [iOS (15,0)] + [Export ("updateGridButtons:")] + void UpdateGridButtons (CPGridButton[] gridButtons); + + [iOS (15,0)] + [Export ("updateTitle:")] + void UpdateTitle (string title); + + [iOS (15,0)] + [Field ("CPGridTemplateMaximumItems")] + nuint MaximumItems { get; } } [NoWatch, NoTV, NoMac, iOS (12,0)] @@ -503,6 +606,10 @@ interface CPListItem : CPSelectableListItem, NSSecureCoding { [NullAllowed, iOS (14, 0)] [Export ("handler", ArgumentSemantic.Copy)] new CPSelectableListItemHandler Handler { get; set; } + + [iOS (15, 0)] + [Export ("enabled")] + bool Enabled { [Bind ("isEnabled")] get; set; } } [NoWatch, NoTV, NoMac, iOS (12,0)] @@ -516,6 +623,10 @@ interface CPListSection : NSSecureCoding { [Export ("initWithItems:")] IntPtr Constructor (CPListItem [] items); + [iOS (15,0)] + [Export ("initWithItems:header:headerSubtitle:headerImage:headerButton:sectionIndexTitle:")] + IntPtr Constructor (ICPListTemplateItem[] items, string header, [NullAllowed] string headerSubtitle, [NullAllowed] UIImage headerImage, [NullAllowed] CPButton headerButton, [NullAllowed] string sectionIndexTitle); + [NullAllowed, Export ("header")] string Header { get; } @@ -532,6 +643,25 @@ interface CPListSection : NSSecureCoding { [iOS (14,0)] [Export ("itemAtIndex:")] ICPListTemplateItem GetItem (nuint index); + + [iOS (15, 0)] + [NullAllowed] + [Export ("headerSubtitle")] + string HeaderSubtitle { get; } + + [iOS (15, 0)] + [NullAllowed] + [Export ("headerImage", ArgumentSemantic.Copy)] + UIImage HeaderImage { get; } + + [iOS (15, 0)] + [NullAllowed] + [Export ("headerButton", ArgumentSemantic.Copy)] + CPButton HeaderButton { get; } + + [iOS (15, 0)] + [Field ("CPMaximumListSectionImageSize")] + CGSize MaximumImageSize { get; } } [NoWatch, NoTV, NoMac, iOS (12,0)] @@ -542,6 +672,10 @@ interface CPListTemplate : CPBarButtonProviding { [Export ("initWithTitle:sections:")] IntPtr Constructor ([NullAllowed] string title, CPListSection[] sections); + [iOS (15,0)] + [Export ("initWithTitle:sections:assistantCellVisibility:assistantCellPosition:")] + IntPtr Constructor ([NullAllowed] string title, CPListSection[] sections, CPAssistantCellVisibility visibility, CPAssistantCellPosition position); + [Deprecated (PlatformName.iOS, 14, 0, message: "Use 'CPListItem.Handler' instead.")] [Wrap ("WeakDelegate")] [NullAllowed] @@ -590,6 +724,14 @@ interface CPListTemplate : CPBarButtonProviding { [iOS (14, 0)] [Export ("emptyViewSubtitleVariants", ArgumentSemantic.Copy)] string[] EmptyViewSubtitleVariants { get; set; } + + [iOS (15, 0)] + [Export ("assistantCellVisibility", ArgumentSemantic.Assign)] + CPAssistantCellVisibility AssistantCellVisibility { get; set; } + + [iOS (15, 0)] + [Export ("assistantCellPosition", ArgumentSemantic.Assign)] + CPAssistantCellPosition AssistantCellPosition { get; set; } } interface ICPListTemplateDelegate { } @@ -1450,6 +1592,10 @@ interface CPListImageRowItem : CPSelectableListItem [NullAllowed, Export ("userInfo", ArgumentSemantic.Strong)] new NSObject UserInfo { get; set; } + + [iOS (15, 0)] + [Export ("enabled")] + bool Enabled { [Bind ("isEnabled")] get; set; } } [NoWatch, NoTV, NoMac, iOS (14,0)] @@ -1519,6 +1665,10 @@ interface CPMessageListItem : CPListTemplateItem [NullAllowed, Export ("userInfo", ArgumentSemantic.Strong)] new NSObject UserInfo { get; set; } + + [iOS (15, 0)] + [Export ("enabled")] + bool Enabled { [Bind ("isEnabled")] get; set; } } [NoWatch, NoTV, NoMac, iOS (14,0)] @@ -1806,6 +1956,13 @@ interface CPListTemplateItem [Abstract] [NullAllowed, Export ("userInfo", ArgumentSemantic.Strong)] NSObject UserInfo { get; set; } + +#if XAMCORE_4_0 + [Abstract] +#endif + [iOS (15, 0)] + [Export ("enabled")] + bool Enabled { [Bind ("isEnabled")] get; set; } } interface ICPSelectableListItem { } diff --git a/tests/xtro-sharpie/iOS-CarPlay.ignore b/tests/xtro-sharpie/iOS-CarPlay.ignore index 926ddbd7693a..f29d99d803ce 100644 --- a/tests/xtro-sharpie/iOS-CarPlay.ignore +++ b/tests/xtro-sharpie/iOS-CarPlay.ignore @@ -1,6 +1,8 @@ !incorrect-protocol-member! CPBarButtonProviding::backButton is REQUIRED and should be abstract !incorrect-protocol-member! CPBarButtonProviding::setBackButton: is REQUIRED and should be abstract !incorrect-protocol-member! CPSessionConfigurationDelegate::sessionConfiguration:limitedUserInterfacesChanged: is OPTIONAL and should NOT be abstract +!incorrect-protocol-member! CPListTemplateItem::isEnabled is REQUIRED and should be abstract +!incorrect-protocol-member! CPListTemplateItem::setEnabled: is REQUIRED and should be abstract # introduced iOS 14, deprecated iOS 14 !missing-selector! CPListItem::showsExplicitLabel not bound diff --git a/tests/xtro-sharpie/iOS-CarPlay.todo b/tests/xtro-sharpie/iOS-CarPlay.todo deleted file mode 100644 index ed4599eb1256..000000000000 --- a/tests/xtro-sharpie/iOS-CarPlay.todo +++ /dev/null @@ -1,26 +0,0 @@ -!missing-enum! CPAssistantCellPosition not bound -!missing-enum! CPAssistantCellVisibility not bound -!missing-enum! CPJunctionType not bound -!missing-enum! CPManeuverType not bound -!missing-enum! CPTrafficSide not bound -!missing-field! CPGridTemplateMaximumItems not bound -!missing-field! CPMaximumListSectionImageSize not bound -!missing-protocol-member! CPListTemplateItem::isEnabled not found -!missing-protocol-member! CPListTemplateItem::setEnabled: not found -!missing-selector! CPGridTemplate::updateGridButtons: not bound -!missing-selector! CPGridTemplate::updateTitle: not bound -!missing-selector! CPListImageRowItem::isEnabled not bound -!missing-selector! CPListImageRowItem::setEnabled: not bound -!missing-selector! CPListItem::isEnabled not bound -!missing-selector! CPListItem::setEnabled: not bound -!missing-selector! CPListSection::headerButton not bound -!missing-selector! CPListSection::headerImage not bound -!missing-selector! CPListSection::headerSubtitle not bound -!missing-selector! CPListSection::initWithItems:header:headerSubtitle:headerImage:headerButton:sectionIndexTitle: not bound -!missing-selector! CPListTemplate::assistantCellPosition not bound -!missing-selector! CPListTemplate::assistantCellVisibility not bound -!missing-selector! CPListTemplate::initWithTitle:sections:assistantCellVisibility:assistantCellPosition: not bound -!missing-selector! CPListTemplate::setAssistantCellPosition: not bound -!missing-selector! CPListTemplate::setAssistantCellVisibility: not bound -!missing-selector! CPMessageListItem::isEnabled not bound -!missing-selector! CPMessageListItem::setEnabled: not bound