mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
2.2 KiB
C
64 lines
2.2 KiB
C
8 years ago
|
//
|
||
|
// 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 <NSObject>
|
||
|
|
||
|
- (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<ConversationViewCellDelegate> 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
|