From caecc16d2d84b966e78f0626c25a80e0a52fb2ab Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Mon, 17 Jul 2017 17:26:21 -0400 Subject: [PATCH 1/2] [messages] Update for Xcode 9 beta 1 & 3 --- src/messages.cs | 55 ++++++++++++++++++- tests/introspection/iOS/iOSApiProtocolTest.cs | 2 + 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/messages.cs b/src/messages.cs index 1f2c10b9bf1f..9efee4cc48a8 100644 --- a/src/messages.cs +++ b/src/messages.cs @@ -22,7 +22,8 @@ namespace XamCore.Messages { public enum MSMessagesAppPresentationStyle : nuint { Compact, - Expanded + Expanded, + Transcript, } [iOS (10,0)] @@ -38,6 +39,7 @@ public enum MSStickerSize : nint [ErrorDomain ("MSMessagesErrorDomain")] public enum MSMessageErrorCode : nint { + Unknown = -1, FileNotFound = 1, FileUnreadable, ImproperFileType, @@ -46,11 +48,23 @@ public enum MSMessageErrorCode : nint StickerFileImproperFileSize, StickerFileImproperFileFormat, UrlExceedsMaxSize, + SendWithoutRecentInteraction, + SendWhileNotVisible, + } + + [iOS (11,0)] + [Protocol] + interface MSMessagesAppTranscriptPresentation + { + [iOS (11,0)] + [Abstract] + [Export ("contentSizeThatFits:")] + CGSize ContentSizeThatFits (CGSize size); } [iOS (10,0)] [BaseType (typeof(UIViewController))] - interface MSMessagesAppViewController + interface MSMessagesAppViewController : MSMessagesAppTranscriptPresentation { // inlined ctor [Export ("initWithNibName:bundle:")] @@ -130,6 +144,26 @@ interface MSConversation [Export ("insertAttachment:withAlternateFilename:completionHandler:")] [Async] void InsertAttachment (NSUrl url, [NullAllowed] string filename, [NullAllowed] Action completionHandler); + + [iOS (11,0)] + [Export ("sendMessage:completionHandler:")] + [Async] + void SendMessage (MSMessage message, [NullAllowed] Action completionHandler); + + [iOS (11,0)] + [Export ("sendSticker:completionHandler:")] + [Async] + void SendSticker (MSSticker sticker, [NullAllowed] Action completionHandler); + + [iOS (11,0)] + [Export ("sendText:completionHandler:")] + [Async] + void SendText (string text, [NullAllowed] Action completionHandler); + + [iOS (11,0)] + [Export ("sendAttachment:withAlternateFilename:completionHandler:")] + [Async] + void SendAttachment (NSUrl url, [NullAllowed] string filename, [NullAllowed] Action completionHandler); } [iOS (10,0)] @@ -144,6 +178,10 @@ interface MSMessage : NSCopying, NSSecureCoding [NullAllowed, Export ("session")] MSSession Session { get; } + [iOS (11,0)] + [Export ("pending")] + bool Pending { [Bind ("isPending")] get; } + [Export ("senderParticipantIdentifier")] NSUuid SenderParticipantIdentifier { get; } @@ -309,5 +347,18 @@ interface MSStickerBrowserViewController : MSStickerBrowserViewDataSource [Export ("stickerSize")] MSStickerSize StickerSize { get; } } + + [iOS (11,0)] + [BaseType (typeof(MSMessageLayout))] + [DisableDefaultCtor] + interface MSMessageLiveLayout + { + [Export ("initWithAlternateLayout:")] + [DesignatedInitializer] + IntPtr Constructor (MSMessageTemplateLayout alternateLayout); + + [Export ("alternateLayout")] + MSMessageTemplateLayout AlternateLayout { get; } + } } #endif // !MONOMAC diff --git a/tests/introspection/iOS/iOSApiProtocolTest.cs b/tests/introspection/iOS/iOSApiProtocolTest.cs index 4e8c5b3ae4e6..66cd77bf040d 100644 --- a/tests/introspection/iOS/iOSApiProtocolTest.cs +++ b/tests/introspection/iOS/iOSApiProtocolTest.cs @@ -204,6 +204,7 @@ protected override bool Skip (Type type, string protocolName) case "HMMutableLocationEvent": case "HMTimeEvent": case "ILMessageFilterExtensionContext": // Conformance not in headers + case "MSMessageLiveLayout": return true; #if __WATCHOS__ case "CLKComplicationTemplate": @@ -336,6 +337,7 @@ protected override bool Skip (Type type, string protocolName) case "NSManagedObjectModel": case "NSPropertyDescription": case "NSRelationshipDescription": + case "MSMessageLiveLayout": return true; #if __WATCHOS__ case "CLKComplicationTemplate": From 056299013002188824ed0d6c59c34aa9d66fd8ad Mon Sep 17 00:00:00 2001 From: Vincent Dondain Date: Tue, 18 Jul 2017 14:08:11 -0400 Subject: [PATCH 2/2] [messages] Fixes based on comments --- src/messages.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/messages.cs b/src/messages.cs index 9efee4cc48a8..ea2058432c63 100644 --- a/src/messages.cs +++ b/src/messages.cs @@ -59,7 +59,7 @@ interface MSMessagesAppTranscriptPresentation [iOS (11,0)] [Abstract] [Export ("contentSizeThatFits:")] - CGSize ContentSizeThatFits (CGSize size); + CGSize GetContentSizeThatFits (CGSize size); } [iOS (10,0)]