// // Copyright (c) 2017 Open Whisper Systems. All rights reserved. // NS_ASSUME_NONNULL_BEGIN @class ConversationViewCell; @class ConversationViewItem; @class OWSContactOffersInteraction; @class TSAttachmentPointer; @class TSAttachmentStream; @class TSInteraction; @class TSMessage; @class TSOutgoingMessage; @protocol ConversationViewCellDelegate - (void)didTapImageViewItem:(ConversationViewItem *)viewItem attachmentStream:(TSAttachmentStream *)attachmentStream imageView:(UIView *)imageView; - (void)didTapVideoViewItem:(ConversationViewItem *)viewItem attachmentStream:(TSAttachmentStream *)attachmentStream; - (void)didTapAudioViewItem:(ConversationViewItem *)viewItem attachmentStream:(TSAttachmentStream *)attachmentStream; - (void)didTapOversizeTextMessage:(NSString *)displayableText attachmentStream:(TSAttachmentStream *)attachmentStream; - (void)didTapFailedIncomingAttachment:(ConversationViewItem *)viewItem attachmentPointer:(TSAttachmentPointer *)attachmentPointer; - (void)didTapFailedOutgoingMessage:(TSOutgoingMessage *)message; - (void)showMetadataViewForMessage:(TSMessage *)message; #pragma mark - System Cell // TODO: We might want to decompose this method. - (void)didTapSystemMessageWithInteraction:(TSInteraction *)interaction; - (void)didLongPressSystemMessageCell:(ConversationViewCell *)systemMessageCell fromView:(UIView *)fromView; #pragma mark - Offers - (void)tappedUnknownContactBlockOfferMessage:(OWSContactOffersInteraction *)interaction; - (void)tappedAddToContactsOfferMessage:(OWSContactOffersInteraction *)interaction; - (void)tappedAddToProfileWhitelistOfferMessage:(OWSContactOffersInteraction *)interaction; @end #pragma mark - @interface ConversationViewCell : UICollectionViewCell @property (nonatomic, nullable, weak) id delegate; @property (nonatomic, nullable) ConversationViewItem *viewItem; @property (nonatomic) BOOL isCellVisible; // If this is non-null, we should show the message date header. @property (nonatomic, nullable) NSAttributedString *messageDateHeaderText; - (void)loadForDisplay; - (CGSize)cellSizeForViewWidth:(int)viewWidth maxMessageWidth:(int)maxMessageWidth; @end NS_ASSUME_NONNULL_END