Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions src/CarPlay/CPNowPlayingSportsClock.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// Copyright (c) Microsoft Corporation.
// Licensed under MIT License.
//

using System;
using Foundation;
using ObjCRuntime;

#nullable enable

namespace CarPlay {

public partial class CPNowPlayingSportsClock {

/// <summary>This enum is used to select how to initialize a new <see cref="CPNowPlayingSportsClock" /> instance.</summary>
[SupportedOSPlatform ("ios18.4")]
[SupportedOSPlatform ("maccatalyst18.4")]
[SupportedOSPlatform ("macos15.4")]
[SupportedOSPlatform ("tvos18.4")]
public enum CPNowPlayingSportsClockTimeOption {
/// <summary>The <c>time</c> parameter passed to the constructor is elapsed time.</summary>
ElapsedTime,
/// <summary>The <c>time</c> parameter passed to the constructor is remaining time.</summary>
RemainingTime,
}

/// <summary>Create a new <see cref="CPNowPlayingSportsClock" /> instance with the specified <c>time</c> and <c>paused</c> values.</summary>
/// <param name="time">The elapsed or remaining time of the clock.</param>
/// <param name="paused">If the clock is paused or not.</param>
/// <param name="type">Use this option to specify whether the <paramref name="time" /> parameter refers to elapsed time or remaining time.</param>
public CPNowPlayingSportsClock (double time, bool paused, CPNowPlayingSportsClockTimeOption type)
: base (NSObjectFlag.Empty)
{
switch (type) {
case CPNowPlayingSportsClockTimeOption.ElapsedTime:
InitializeHandle (_InitWithElapsedTime (time, paused), "initWithElapsedTime:paused:");
break;
case CPNowPlayingSportsClockTimeOption.RemainingTime:
InitializeHandle (_InitWithRemainingTime (time, paused), "initWithRemainingTime:paused:");
break;
default:
throw new ArgumentException (nameof (type));
}
}
}
}
118 changes: 118 additions & 0 deletions src/carplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,11 @@ interface CPListTemplate : CPBarButtonProviding {
[iOS (15, 0), MacCatalyst (15, 0)]
[Export ("assistantCellConfiguration", ArgumentSemantic.Strong)]
CPAssistantCellConfiguration AssistantCellConfiguration { get; set; }

[NullAllowed]
[iOS (18, 4), MacCatalyst (18, 4)]
[Export ("showsSpinnerWhileEmpty", ArgumentSemantic.Assign)]
bool ShowsSpinnerWhileEmpty { get; set; }
}

/// <summary>Delegate object for <see cref="T:CarPlay.CPListTemplate" /> objects.</summary>
Expand Down Expand Up @@ -2129,6 +2134,10 @@ interface CPNowPlayingTemplate {

[Export ("updateNowPlayingButtons:")]
void UpdateNowPlayingButtons (CPNowPlayingButton [] nowPlayingButtons);

[iOS (18, 4), MacCatalyst (18, 4)]
[Export ("nowPlayingMode", ArgumentSemantic.Strong), NullAllowed]
CPNowPlayingMode NowPlayingMode { get; set; }
}

[NoTV, NoMac, iOS (14, 0)]
Expand Down Expand Up @@ -2445,4 +2454,113 @@ interface CPRouteInformation {
CPTravelEstimates ManeuverTravelEstimates { get; }
}

[NoTV, NoMac, iOS (18, 4), MacCatalyst (18, 4)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CPNowPlayingMode : NSSecureCoding {
[Static]
[Export ("defaultNowPlayingMode")]
CPNowPlayingMode DefaultNowPlayingMode { get; }
}

[NoTV, NoMac, iOS (18, 4), MacCatalyst (18, 4)]
[BaseType (typeof (CPNowPlayingMode))]
interface CPNowPlayingModeSports : NSSecureCoding {
[Export ("initWithLeftTeam:rightTeam:eventStatus:backgroundArtwork:")]
NativeHandle Constructor (CPNowPlayingSportsTeam leftTeam, CPNowPlayingSportsTeam rightTeam, [NullAllowed] CPNowPlayingSportsEventStatus eventStatus, [NullAllowed] UIImage backgroundArtwork);

[Export ("leftTeam", ArgumentSemantic.Strong)]
CPNowPlayingSportsTeam LeftTeam { get; }

[Export ("rightTeam", ArgumentSemantic.Strong)]
CPNowPlayingSportsTeam RightTeam { get; }

[NullAllowed, Export ("eventStatus", ArgumentSemantic.Strong)]
CPNowPlayingSportsEventStatus EventStatus { get; }

[NullAllowed, Export ("backgroundArtwork", ArgumentSemantic.Copy)]
UIImage BackgroundArtwork { get; }
}

[NoTV, NoMac, iOS (18, 4), MacCatalyst (18, 4)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CPNowPlayingSportsTeam : NSSecureCoding {
[Export ("initWithName:logo:teamStandings:eventScore:possessionIndicator:favorite:")]
NativeHandle Constructor (string name, CPNowPlayingSportsTeamLogo logo, [NullAllowed] string teamStandings, string eventScore, [NullAllowed] UIImage possessionIndicator, bool favorite);

[Export ("name")]
string Name { get; }

[Export ("logo", ArgumentSemantic.Copy)]
CPNowPlayingSportsTeamLogo Logo { get; }

[NullAllowed, Export ("teamStandings")]
string TeamStandings { get; }

[Export ("eventScore")]
string EventScore { get; }

[NullAllowed, Export ("possessionIndicator", ArgumentSemantic.Copy)]
UIImage PossessionIndicator { get; }

[Export ("favorite")]
bool Favorite { [Bind ("isFavorite")] get; }
}

[NoTV, NoMac, iOS (18, 4), MacCatalyst (18, 4)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CPNowPlayingSportsEventStatus : NSSecureCoding {
[Export ("initWithEventStatusText:eventStatusImage:eventClock:")]
NativeHandle Constructor ([NullAllowed] string [] eventStatusText, [NullAllowed] UIImage eventStatusImage, [NullAllowed] CPNowPlayingSportsClock eventClock);

[NullAllowed, Export ("eventStatusText", ArgumentSemantic.Copy)]
string [] EventStatusText { get; }

[NullAllowed, Export ("eventClock", ArgumentSemantic.Copy)]
CPNowPlayingSportsClock EventClock { get; }

[NullAllowed, Export ("eventStatusImage", ArgumentSemantic.Copy)]
UIImage EventStatusImage { get; }
}

[NoTV, NoMac, iOS (18, 4), MacCatalyst (18, 4)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CPNowPlayingSportsClock : INSSecureCoding {
[Internal]
[Export ("initWithElapsedTime:paused:")]
NativeHandle _InitWithElapsedTime (double elapsedTime, bool paused);

[Internal]
[Export ("initWithTimeRemaining:paused:")]
NativeHandle _InitWithRemainingTime (double timeRemaining, bool paused);

[Export ("timeValue")]
double TimeValue { get; }

[Export ("paused")]
bool Paused { [Bind ("isPaused")] get; }

[Export ("countsUp")]
bool CountsUp { get; }
}

[NoTV, NoMac, iOS (18, 4), MacCatalyst (18, 4)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface CPNowPlayingSportsTeamLogo : INSSecureCoding {
[Export ("initWithTeamLogo:")]
NativeHandle Constructor (UIImage teamLogo);

[Export ("initWithTeamInitials:")]
NativeHandle Constructor (string teamInitials);

[NullAllowed, Export ("logo", ArgumentSemantic.Copy)]
UIImage Logo { get; }

[NullAllowed, Export ("initials")]
string Initials { get; }
}
}
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ CARPLAY_API_SOURCES = \
CARPLAY_SOURCES = \
CarPlay/CPCompat.cs \
CarPlay/CPNavigationAlert.cs \
CarPlay/CPNowPlayingSportsClock.cs \
CarPlay/CPMessageListItem.cs \

# ClassKit
Expand Down
6 changes: 6 additions & 0 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23290,6 +23290,10 @@ M:CarPlay.CPMessageListItem.#ctor(System.String,System.String,CarPlay.CPMessageL
M:CarPlay.CPMessageListItem.#ctor(System.String,System.String,CarPlay.CPMessageListItemLeadingConfiguration,CarPlay.CPMessageListItemTrailingConfiguration,System.String,System.String)
M:CarPlay.CPNavigationAlert.EncodeTo(Foundation.NSCoder)
M:CarPlay.CPNowPlayingButton.EncodeTo(Foundation.NSCoder)
M:CarPlay.CPNowPlayingMode.EncodeTo(Foundation.NSCoder)
M:CarPlay.CPNowPlayingModeSports.EncodeTo(Foundation.NSCoder)
M:CarPlay.CPNowPlayingSportsEventStatus.EncodeTo(Foundation.NSCoder)
M:CarPlay.CPNowPlayingSportsTeam.EncodeTo(Foundation.NSCoder)
M:CarPlay.CPNowPlayingTemplateObserver_Extensions.AlbumArtistButtonTapped(CarPlay.ICPNowPlayingTemplateObserver,CarPlay.CPNowPlayingTemplate)
M:CarPlay.CPNowPlayingTemplateObserver_Extensions.UpNextButtonTapped(CarPlay.ICPNowPlayingTemplateObserver,CarPlay.CPNowPlayingTemplate)
M:CarPlay.CPPointOfInterest.EncodeTo(Foundation.NSCoder)
Expand Down Expand Up @@ -49318,6 +49322,8 @@ P:CarPlay.CPMessageListItemLeadingConfiguration.Unread
P:CarPlay.CPNowPlayingButton.Enabled
P:CarPlay.CPNowPlayingButton.MaximumImageSize
P:CarPlay.CPNowPlayingButton.Selected
P:CarPlay.CPNowPlayingSportsClock.Paused
P:CarPlay.CPNowPlayingSportsTeam.Favorite
P:CarPlay.CPNowPlayingTemplate.IsAlbumArtistButtonEnabled
P:CarPlay.CPNowPlayingTemplate.IsUpNextButtonEnabled
P:CarPlay.CPPointOfInterestTemplate.PointOfInterestDelegate
Expand Down
36 changes: 0 additions & 36 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-CarPlay.todo

This file was deleted.

Loading