Skip to content

Commit

Permalink
[messages] Update for Xcode 9 beta 1 & 3 (#2332)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentDondain authored Jul 18, 2017
1 parent 89071bc commit 817c13f
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
55 changes: 53 additions & 2 deletions src/messages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ namespace XamCore.Messages {
public enum MSMessagesAppPresentationStyle : nuint
{
Compact,
Expanded
Expanded,
Transcript,
}

[iOS (10,0)]
Expand All @@ -38,6 +39,7 @@ public enum MSStickerSize : nint
[ErrorDomain ("MSMessagesErrorDomain")]
public enum MSMessageErrorCode : nint
{
Unknown = -1,
FileNotFound = 1,
FileUnreadable,
ImproperFileType,
Expand All @@ -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 GetContentSizeThatFits (CGSize size);
}

[iOS (10,0)]
[BaseType (typeof(UIViewController))]
interface MSMessagesAppViewController
interface MSMessagesAppViewController : MSMessagesAppTranscriptPresentation
{
// inlined ctor
[Export ("initWithNibName:bundle:")]
Expand Down Expand Up @@ -130,6 +144,26 @@ interface MSConversation
[Export ("insertAttachment:withAlternateFilename:completionHandler:")]
[Async]
void InsertAttachment (NSUrl url, [NullAllowed] string filename, [NullAllowed] Action<NSError> completionHandler);

[iOS (11,0)]
[Export ("sendMessage:completionHandler:")]
[Async]
void SendMessage (MSMessage message, [NullAllowed] Action<NSError> completionHandler);

[iOS (11,0)]
[Export ("sendSticker:completionHandler:")]
[Async]
void SendSticker (MSSticker sticker, [NullAllowed] Action<NSError> completionHandler);

[iOS (11,0)]
[Export ("sendText:completionHandler:")]
[Async]
void SendText (string text, [NullAllowed] Action<NSError> completionHandler);

[iOS (11,0)]
[Export ("sendAttachment:withAlternateFilename:completionHandler:")]
[Async]
void SendAttachment (NSUrl url, [NullAllowed] string filename, [NullAllowed] Action<NSError> completionHandler);
}

[iOS (10,0)]
Expand All @@ -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; }

Expand Down Expand Up @@ -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
2 changes: 2 additions & 0 deletions tests/introspection/iOS/iOSApiProtocolTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit 817c13f

Please sign in to comment.