Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Intents] Implement Xcode 16.0 beta 1, beta 2 and beta 3 changes. #20881

Merged
merged 1 commit into from
Jul 12, 2024
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
137 changes: 137 additions & 0 deletions src/intents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,10 @@ public enum INMessageType : long {
Link,
[iOS (17, 0), MacCatalyst (17, 0), Watch (10, 0)]
Reaction,
[iOS (18, 0), MacCatalyst (18, 0), Watch (11, 0)]
MediaAnimatedImage,
[iOS (18, 0), MacCatalyst (18, 0), Watch (11, 0)]
ThirdPartyAttachment,
}

/// <summary>Enumerates note content types.</summary>
Expand Down Expand Up @@ -2715,6 +2719,28 @@ enum INCarChargingConnectorType {
Mennekes,
}

[Native]
[iOS (18, 0), MacCatalyst (18, 0), Mac (15, 0), Watch (11, 0), NoTV]
public enum INMessageReactionType : long {
Unknown = 0,
[Deprecated (PlatformName.iOS, 18, 0)]
[Deprecated (PlatformName.MacCatalyst, 18, 0)]
[Deprecated (PlatformName.TvOS, 18, 0)]
[Deprecated (PlatformName.MacOSX, 15, 0)]
[Deprecated (PlatformName.WatchOS, 11, 0)]
EmojiReaction, // introduced and deprecated in the same OS version.
Emoji,
Generic,
}

[Native]
[iOS (18, 0), MacCatalyst (18, 0), Mac (15, 0), Watch (11, 0), NoTV]
public enum INStickerType : long {
Unknown = 0,
Emoji,
Generic,
}

// End of enums

[Mac (11, 0)]
Expand Down Expand Up @@ -4562,15 +4588,57 @@ interface INMessage : NSCopying, NSSecureCoding {
[DesignatedInitializer]
NativeHandle Constructor (string identifier, [NullAllowed] string conversationIdentifier, [NullAllowed] string content, [NullAllowed] NSDate dateSent, [NullAllowed] INPerson sender, [NullAllowed] INPerson [] recipients, [NullAllowed] INSpeakableString groupName, INMessageType messageType, [NullAllowed] string serviceName);

[Deprecated (PlatformName.iOS, 18, 0, message: "Use a constructor that takes a reaction and an aggregateRections instead.")]
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use a constructor that takes a reaction and an aggregateRections instead.")]
[Deprecated (PlatformName.WatchOS, 11, 0, message: "Use a constructor that takes a reaction and an aggregateRections instead.")]
[MacCatalyst (13, 1)]
[Export ("initWithIdentifier:conversationIdentifier:content:dateSent:sender:recipients:groupName:messageType:")]
[DesignatedInitializer]
NativeHandle Constructor (string identifier, [NullAllowed] string conversationIdentifier, [NullAllowed] string content, [NullAllowed] NSDate dateSent, [NullAllowed] INPerson sender, [NullAllowed] INPerson [] recipients, [NullAllowed] INSpeakableString groupName, INMessageType messageType);

[Deprecated (PlatformName.iOS, 18, 0, message: "Use a constructor that takes a reaction and an aggregateRections instead.")]
[Deprecated (PlatformName.MacCatalyst, 18, 0, message: "Use a constructor that takes a reaction and an aggregateRections instead.")]
[Deprecated (PlatformName.WatchOS, 11, 0, message: "Use a constructor that takes a reaction and an aggregateRections instead.")]
[MacCatalyst (13, 1)]
[Export ("initWithIdentifier:conversationIdentifier:content:dateSent:sender:recipients:messageType:")]
NativeHandle Constructor (string identifier, [NullAllowed] string conversationIdentifier, [NullAllowed] string content, [NullAllowed] NSDate dateSent, [NullAllowed] INPerson sender, [NullAllowed] INPerson [] recipients, INMessageType messageType);

[iOS (18, 0), MacCatalyst (18, 0), Watch (11, 0), NoMac]
[Export ("initWithIdentifier:conversationIdentifier:content:dateSent:sender:recipients:groupName:serviceName:messageType:referencedMessage:reaction:aggregatedReactions:")]
NativeHandle Constructor (
string identifier,
[NullAllowed] string conversationIdentifier,
[NullAllowed] string content,
[NullAllowed] NSDate dateSent,
[NullAllowed] INPerson sender,
[NullAllowed] INPerson [] recipients,
[NullAllowed] INSpeakableString groupName,
[NullAllowed] string serviceName,
INMessageType messageType,
[NullAllowed] INMessage referencedMessage,
[NullAllowed] INMessageReaction reaction,
[NullAllowed] INAggregatedMessageReaction [] aggregatedReactions
);

[DesignatedInitializer]
[iOS (18, 0), MacCatalyst (18, 0), Watch (11, 0), NoMac]
[Export ("initWithIdentifier:conversationIdentifier:content:dateSent:sender:recipients:groupName:serviceName:messageType:referencedMessage:sticker:reaction:aggregatedReactions:")]
NativeHandle Constructor (
string identifier,
[NullAllowed] string conversationIdentifier,
[NullAllowed] string content,
[NullAllowed] NSDate dateSent,
[NullAllowed] INPerson sender,
[NullAllowed] INPerson [] recipients,
[NullAllowed] INSpeakableString groupName,
[NullAllowed] string serviceName,
INMessageType messageType,
[NullAllowed] INMessage referencedMessage,
[NullAllowed] INSticker sticker,
[NullAllowed] INMessageReaction reaction,
[NullAllowed] INAggregatedMessageReaction [] aggregatedReactions
);

[Export ("initWithIdentifier:content:dateSent:sender:recipients:")]
NativeHandle Constructor (string identifier, [NullAllowed] string content, [NullAllowed] NSDate dateSent, [NullAllowed] INPerson sender, [NullAllowed] INPerson [] recipients);

Expand Down Expand Up @@ -4640,6 +4708,21 @@ interface INMessage : NSCopying, NSSecureCoding {
[Export ("linkMetadata", ArgumentSemantic.Copy)]
INMessageLinkMetadata LinkMetadata { get; }

[NullAllowed]
[Watch (11, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
[Export ("sticker", ArgumentSemantic.Copy)]
INSticker Sticker { get; set; }

[NullAllowed]
[Watch (11, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
[Export ("aggregatedReactions", ArgumentSemantic.Copy)]
INAggregatedMessageReaction [] AggregatedReactions { get; set; }

[NullAllowed]
[Watch (11, 0), NoMac, iOS (18, 0), MacCatalyst (18, 0)]
[Export ("reaction", ArgumentSemantic.Copy)]
INMessageReaction Reaction { get; set; }

}

#if NET
Expand Down Expand Up @@ -15768,4 +15851,58 @@ interface INUnsendMessagesIntentHandling {
void ConfirmUnsendMessages (INUnsendMessagesIntent intent, Action<INUnsendMessagesIntentResponse> completion);
}

[Watch (11, 0), iOS (18, 0), NoTV, MacCatalyst (18, 0), NoMac]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface INAggregatedMessageReaction : NSCopying, NSSecureCoding {
[Export ("initWithReactionType:emoji:senders:reactionCount:")]
[DesignatedInitializer]
NativeHandle Constructor (INMessageReactionType reactionType, [NullAllowed] string emoji, [NullAllowed] INPerson [] senders, [NullAllowed] NSNumber reactionCount);

[Export ("reactionType", ArgumentSemantic.Assign)]
INMessageReactionType ReactionType { get; }

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

[Export ("senders", ArgumentSemantic.Copy), NullAllowed]
INPerson [] Senders { get; }

// No documentation in what kind of number this is :/
[Export ("reactionCount", ArgumentSemantic.Copy), NullAllowed]
NSNumber ReactionCount { get; }
}

[Watch (11, 0), iOS (18, 0), NoTV, MacCatalyst (18, 0), NoMac]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface INMessageReaction : NSCopying, NSSecureCoding {
[DesignatedInitializer]
[Export ("initWithReactionType:reactionDescription:emoji:")]
NativeHandle Constructor (INMessageReactionType reactionType, [NullAllowed] string reactionDescription, [NullAllowed] string emoji);

[Export ("reactionType", ArgumentSemantic.Assign)]
INMessageReactionType ReactionType { get; }

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

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

[Watch (11, 0), iOS (18, 0), NoTV, MacCatalyst (18, 0), NoMac]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface INSticker : NSCopying, NSSecureCoding {
[Export ("initWithType:emoji:")]
[DesignatedInitializer]
NativeHandle Constructor (INStickerType type, [NullAllowed] string emoji);

[Export ("type", ArgumentSemantic.Assign)]
INStickerType Type { get; }

[Export ("emoji", ArgumentSemantic.Copy), NullAllowed]
string Emoji { get; }
}
}
1 change: 1 addition & 0 deletions tests/cecil-tests/ApiAvailabilityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ bool SkipSupportedAndObsoleteAtTheSameTime (ICustomAttributeProvider api, AppleP
switch (fullname) {
case "GameKit.GKScore.ReportLeaderboardScores(GameKit.GKLeaderboardScore[], GameKit.GKChallenge[], System.Action`1<Foundation.NSError>)":
case "GameKit.GKScore.ReportLeaderboardScoresAsync(GameKit.GKLeaderboardScore[], GameKit.GKChallenge[])":
case "Intents.INMessageReactionType Intents.INMessageReactionType::EmojiReaction":
return true;
}

Expand Down
17 changes: 17 additions & 0 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12263,6 +12263,10 @@ F:Intents.INMessageAttributeOptions.Played
F:Intents.INMessageAttributeOptions.Read
F:Intents.INMessageAttributeOptions.Unflagged
F:Intents.INMessageAttributeOptions.Unread
F:Intents.INMessageReactionType.Emoji
F:Intents.INMessageReactionType.EmojiReaction
F:Intents.INMessageReactionType.Generic
F:Intents.INMessageReactionType.Unknown
F:Intents.INMessageType.ActivitySnippet
F:Intents.INMessageType.Animoji
F:Intents.INMessageType.Audio
Expand All @@ -12271,6 +12275,7 @@ F:Intents.INMessageType.File
F:Intents.INMessageType.Handwriting
F:Intents.INMessageType.Link
F:Intents.INMessageType.MediaAddressCard
F:Intents.INMessageType.MediaAnimatedImage
F:Intents.INMessageType.MediaAudio
F:Intents.INMessageType.MediaCalendar
F:Intents.INMessageType.MediaImage
Expand All @@ -12289,6 +12294,7 @@ F:Intents.INMessageType.TapbackLiked
F:Intents.INMessageType.TapbackLoved
F:Intents.INMessageType.TapbackQuestioned
F:Intents.INMessageType.Text
F:Intents.INMessageType.ThirdPartyAttachment
F:Intents.INMessageType.Unspecified
F:Intents.INNotebookItemType.Note
F:Intents.INNotebookItemType.Task
Expand Down Expand Up @@ -12761,6 +12767,9 @@ F:Intents.INStartWorkoutIntentResponseCode.HandleInApp
F:Intents.INStartWorkoutIntentResponseCode.Ready
F:Intents.INStartWorkoutIntentResponseCode.Success
F:Intents.INStartWorkoutIntentResponseCode.Unspecified
F:Intents.INStickerType.Emoji
F:Intents.INStickerType.Generic
F:Intents.INStickerType.Unknown
F:Intents.INTaskPriority.Flagged
F:Intents.INTaskPriority.NotFlagged
F:Intents.INTaskPriority.Unknown
Expand Down Expand Up @@ -37658,6 +37667,8 @@ M:Intents.INAddTasksTemporalEventTriggerResolutionResult.GetConfirmationRequired
M:Intents.INAddTasksTemporalEventTriggerResolutionResult.GetDisambiguation(Intents.INTemporalEventTrigger[])
M:Intents.INAddTasksTemporalEventTriggerResolutionResult.GetSuccess(Intents.INTemporalEventTrigger)
M:Intents.INAddTasksTemporalEventTriggerResolutionResult.GetUnsupported(System.IntPtr)
M:Intents.INAggregatedMessageReaction.Copy(Foundation.NSZone)
M:Intents.INAggregatedMessageReaction.EncodeTo(Foundation.NSCoder)
M:Intents.INAirline.Copy(Foundation.NSZone)
M:Intents.INAirline.EncodeTo(Foundation.NSCoder)
M:Intents.INAirport.Copy(Foundation.NSZone)
Expand Down Expand Up @@ -37885,6 +37896,8 @@ M:Intents.INMessageAttributeResolutionResult.GetSuccess(Intents.INMessageAttribu
M:Intents.INMessageAttributeResolutionResult.GetUnsupported(System.IntPtr)
M:Intents.INMessageLinkMetadata.Copy(Foundation.NSZone)
M:Intents.INMessageLinkMetadata.EncodeTo(Foundation.NSCoder)
M:Intents.INMessageReaction.Copy(Foundation.NSZone)
M:Intents.INMessageReaction.EncodeTo(Foundation.NSCoder)
M:Intents.INNote.Copy(Foundation.NSZone)
M:Intents.INNote.EncodeTo(Foundation.NSCoder)
M:Intents.INNotebookItemTypeResolutionResult.GetConfirmationRequired(Foundation.NSObject,System.IntPtr)
Expand Down Expand Up @@ -38256,6 +38269,8 @@ M:Intents.INStartWorkoutIntentHandling_Extensions.ResolveIsOpenEnded(Intents.IIN
M:Intents.INStartWorkoutIntentHandling_Extensions.ResolveWorkoutGoalUnitType(Intents.IINStartWorkoutIntentHandling,Intents.INStartWorkoutIntent,System.Action{Intents.INWorkoutGoalUnitTypeResolutionResult})
M:Intents.INStartWorkoutIntentHandling_Extensions.ResolveWorkoutLocationType(Intents.IINStartWorkoutIntentHandling,Intents.INStartWorkoutIntent,System.Action{Intents.INWorkoutLocationTypeResolutionResult})
M:Intents.INStartWorkoutIntentHandling_Extensions.ResolveWorkoutName(Intents.IINStartWorkoutIntentHandling,Intents.INStartWorkoutIntent,System.Action{Intents.INSpeakableStringResolutionResult})
M:Intents.INSticker.Copy(Foundation.NSZone)
M:Intents.INSticker.EncodeTo(Foundation.NSCoder)
M:Intents.INStringResolutionResult.GetConfirmationRequired(Foundation.NSObject,System.IntPtr)
M:Intents.INStringResolutionResult.GetUnsupported(System.IntPtr)
M:Intents.INTask.Copy(Foundation.NSZone)
Expand Down Expand Up @@ -80002,6 +80017,7 @@ T:Intents.INMediaItemType
T:Intents.INMediaReference
T:Intents.INMediaSortOrder
T:Intents.INMediaUserContextSubscriptionStatus
T:Intents.INMessageReactionType
T:Intents.INOutgoingMessageType
T:Intents.INPerson.INPersonType
T:Intents.INPlaybackQueueLocation
Expand All @@ -80026,6 +80042,7 @@ T:Intents.INStartCallCallCapabilityUnsupportedReason
T:Intents.INStartCallCallRecordToCallBackUnsupportedReason
T:Intents.INStartCallContactUnsupportedReason
T:Intents.INStartCallIntentResponseCode
T:Intents.INStickerType
T:Intents.INTaskPriority
T:Intents.INTaskType
T:Intents.INTemporalEventTriggerTypeOptions
Expand Down
27 changes: 0 additions & 27 deletions tests/xtro-sharpie/api-annotations-dotnet/iOS-Intents.todo
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
!extra-designated-initializer! INMessage::initWithIdentifier:conversationIdentifier:content:dateSent:sender:recipients:groupName:messageType: is incorrectly decorated with an [DesignatedInitializer] attribute
!missing-enum! INMessageReactionType not bound
!missing-enum! INStickerType not bound
!missing-enum-value! INMessageType native value INMessageTypeMediaAnimatedImage = 27 not bound
!missing-enum-value! INMessageType native value INMessageTypeThirdPartyAttachment = 28 not bound
!missing-field! INCarChargingConnectorTypeNACSAC not bound
!missing-field! INCarChargingConnectorTypeNACSDC not bound
!missing-selector! INAggregatedMessageReaction::emoji not bound
!missing-selector! INAggregatedMessageReaction::initWithReactionType:emoji:senders:reactionCount: not bound
!missing-selector! INAggregatedMessageReaction::reactionCount not bound
!missing-selector! INAggregatedMessageReaction::reactionType not bound
!missing-selector! INAggregatedMessageReaction::senders not bound
!missing-selector! INMessage::aggregatedReactions not bound
!missing-selector! INMessage::initWithIdentifier:conversationIdentifier:content:dateSent:sender:recipients:groupName:serviceName:messageType:referencedMessage:reaction:aggregatedReactions: not bound
!missing-selector! INMessage::initWithIdentifier:conversationIdentifier:content:dateSent:sender:recipients:groupName:serviceName:messageType:referencedMessage:sticker:reaction:aggregatedReactions: not bound
!missing-selector! INMessage::reaction not bound
!missing-selector! INMessage::setAggregatedReactions: not bound
!missing-selector! INMessage::setReaction: not bound
!missing-selector! INMessage::setSticker: not bound
!missing-selector! INMessage::sticker not bound
!missing-selector! INMessageReaction::emoji not bound
!missing-selector! INMessageReaction::initWithReactionType:reactionDescription:emoji: not bound
!missing-selector! INMessageReaction::reactionDescription not bound
!missing-selector! INMessageReaction::reactionType not bound
!missing-selector! INSticker::emoji not bound
!missing-selector! INSticker::initWithType:emoji: not bound
!missing-selector! INSticker::type not bound
!missing-type! INAggregatedMessageReaction not bound
!missing-type! INMessageReaction not bound
!missing-type! INSticker not bound
2 changes: 0 additions & 2 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-Intents.todo
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
!deprecated-attribute-missing! INCallRecord::initWithIdentifier:dateCreated:caller:callRecordType:callCapability:callDuration:unseen:numberOfCalls: missing a [Deprecated] attribute
!missing-enum! INMessageReactionType not bound
!missing-enum! INStickerType not bound
!missing-selector! INMessageReaction::emoji not bound
!missing-selector! INMessageReaction::initWithReactionType:reactionDescription:emoji: not bound
!missing-selector! INMessageReaction::reactionDescription not bound
Expand Down
27 changes: 0 additions & 27 deletions tests/xtro-sharpie/iOS-Intents.todo
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
!extra-designated-initializer! INMessage::initWithIdentifier:conversationIdentifier:content:dateSent:sender:recipients:groupName:messageType: is incorrectly decorated with an [DesignatedInitializer] attribute
!missing-enum! INMessageReactionType not bound
!missing-enum! INStickerType not bound
!missing-enum-value! INMessageType native value INMessageTypeMediaAnimatedImage = 27 not bound
!missing-enum-value! INMessageType native value INMessageTypeThirdPartyAttachment = 28 not bound
!missing-field! INCarChargingConnectorTypeNACSAC not bound
!missing-field! INCarChargingConnectorTypeNACSDC not bound
!missing-selector! INAggregatedMessageReaction::emoji not bound
!missing-selector! INAggregatedMessageReaction::initWithReactionType:emoji:senders:reactionCount: not bound
!missing-selector! INAggregatedMessageReaction::reactionCount not bound
!missing-selector! INAggregatedMessageReaction::reactionType not bound
!missing-selector! INAggregatedMessageReaction::senders not bound
!missing-selector! INMessage::aggregatedReactions not bound
!missing-selector! INMessage::initWithIdentifier:conversationIdentifier:content:dateSent:sender:recipients:groupName:serviceName:messageType:referencedMessage:reaction:aggregatedReactions: not bound
!missing-selector! INMessage::initWithIdentifier:conversationIdentifier:content:dateSent:sender:recipients:groupName:serviceName:messageType:referencedMessage:sticker:reaction:aggregatedReactions: not bound
!missing-selector! INMessage::reaction not bound
!missing-selector! INMessage::setAggregatedReactions: not bound
!missing-selector! INMessage::setReaction: not bound
!missing-selector! INMessage::setSticker: not bound
!missing-selector! INMessage::sticker not bound
!missing-selector! INMessageReaction::emoji not bound
!missing-selector! INMessageReaction::initWithReactionType:reactionDescription:emoji: not bound
!missing-selector! INMessageReaction::reactionDescription not bound
!missing-selector! INMessageReaction::reactionType not bound
!missing-selector! INSticker::emoji not bound
!missing-selector! INSticker::initWithType:emoji: not bound
!missing-selector! INSticker::type not bound
!missing-type! INAggregatedMessageReaction not bound
!missing-type! INMessageReaction not bound
!missing-type! INSticker not bound
2 changes: 0 additions & 2 deletions tests/xtro-sharpie/macOS-Intents.todo
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
!deprecated-attribute-missing! INCallRecord::initWithIdentifier:dateCreated:caller:callRecordType:callCapability:callDuration:unseen:numberOfCalls: missing a [Deprecated] attribute
!deprecated-attribute-wrong! INSendMessageIntent::initWithRecipients:content:speakableGroupName:conversationIdentifier:serviceName:sender: has 12.0 not 11.0 on [Deprecated] attribute
!missing-enum! INMessageReactionType not bound
!missing-enum! INStickerType not bound
!missing-selector! INMessageReaction::emoji not bound
!missing-selector! INMessageReaction::initWithReactionType:reactionDescription:emoji: not bound
!missing-selector! INMessageReaction::reactionDescription not bound
Expand Down
Loading