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.
		
		
		
		
		
			
		
			
				
	
	
		
			102 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			Objective-C
		
	
			
		
		
	
	
			102 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			Objective-C
		
	
| //
 | |
| //  Copyright (c) 2019 Open Whisper Systems. All rights reserved.
 | |
| //
 | |
| 
 | |
| NS_ASSUME_NONNULL_BEGIN
 | |
| 
 | |
| @class ContactShareViewModel;
 | |
| @class ConversationStyle;
 | |
| 
 | |
| @protocol ConversationViewItem;
 | |
| 
 | |
| @class OWSContact;
 | |
| @class OWSLinkPreview;
 | |
| @class OWSQuotedReplyModel;
 | |
| @class TSAttachmentPointer;
 | |
| @class TSAttachmentStream;
 | |
| @class TSOutgoingMessage;
 | |
| 
 | |
| typedef NS_ENUM(NSUInteger, OWSMessageGestureLocation) {
 | |
|     // Message text, etc.
 | |
|     OWSMessageGestureLocation_Default,
 | |
|     OWSMessageGestureLocation_OversizeText,
 | |
|     OWSMessageGestureLocation_Media,
 | |
|     OWSMessageGestureLocation_QuotedReply,
 | |
|     OWSMessageGestureLocation_LinkPreview,
 | |
| };
 | |
| 
 | |
| @protocol OWSMessageBubbleViewDelegate
 | |
| 
 | |
| - (void)didTapImageViewItem:(id<ConversationViewItem>)viewItem
 | |
|            attachmentStream:(TSAttachmentStream *)attachmentStream
 | |
|                   imageView:(UIView *)imageView;
 | |
| 
 | |
| - (void)didTapVideoViewItem:(id<ConversationViewItem>)viewItem
 | |
|            attachmentStream:(TSAttachmentStream *)attachmentStream
 | |
|                   imageView:(UIView *)imageView;
 | |
| 
 | |
| - (void)didTapAudioViewItem:(id<ConversationViewItem>)viewItem attachmentStream:(TSAttachmentStream *)attachmentStream;
 | |
| - (void)didPanAudioViewItemToCurrentTime:(NSTimeInterval)currentTime;
 | |
| 
 | |
| - (void)didTapTruncatedTextMessage:(id<ConversationViewItem>)conversationItem;
 | |
| 
 | |
| - (void)didTapFailedIncomingAttachment:(id<ConversationViewItem>)viewItem;
 | |
| 
 | |
| - (void)didTapConversationItem:(id<ConversationViewItem>)viewItem quotedReply:(OWSQuotedReplyModel *)quotedReply;
 | |
| - (void)didTapConversationItem:(id<ConversationViewItem>)viewItem
 | |
|                                  quotedReply:(OWSQuotedReplyModel *)quotedReply
 | |
|     failedThumbnailDownloadAttachmentPointer:(TSAttachmentPointer *)attachmentPointer;
 | |
| 
 | |
| - (void)didTapConversationItem:(id<ConversationViewItem>)viewItem linkPreview:(OWSLinkPreview *)linkPreview;
 | |
| 
 | |
| @property (nonatomic, readonly, nullable) NSString *lastSearchedText;
 | |
| 
 | |
| @end
 | |
| 
 | |
| #pragma mark -
 | |
| 
 | |
| @interface OWSMessageBubbleView : UIView
 | |
| 
 | |
| @property (nonatomic, nullable) id<ConversationViewItem> viewItem;
 | |
| 
 | |
| @property (nonatomic) ConversationStyle *conversationStyle;
 | |
| 
 | |
| @property (nonatomic) NSCache *cellMediaCache;
 | |
| 
 | |
| @property (nonatomic, nullable, readonly) UIView *bodyMediaView;
 | |
| 
 | |
| @property (nonatomic, weak) id<OWSMessageBubbleViewDelegate> delegate;
 | |
| 
 | |
| - (instancetype)init NS_UNAVAILABLE;
 | |
| 
 | |
| - (instancetype)initWithFrame:(CGRect)frame NS_DESIGNATED_INITIALIZER;
 | |
| 
 | |
| - (instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
 | |
| 
 | |
| - (void)configureViews;
 | |
| 
 | |
| - (void)loadContent;
 | |
| - (void)unloadContent;
 | |
| 
 | |
| - (CGSize)measureSize;
 | |
| 
 | |
| - (void)prepareForReuse;
 | |
| 
 | |
| + (NSDictionary *)senderNamePrimaryAttributes;
 | |
| + (NSDictionary *)senderNameSecondaryAttributes;
 | |
| 
 | |
| #pragma mark - Gestures
 | |
| 
 | |
| - (OWSMessageGestureLocation)gestureLocationForLocation:(CGPoint)locationInMessageBubble;
 | |
| 
 | |
| // This only needs to be called when we use the cell _outside_ the context
 | |
| // of a conversation view message cell.
 | |
| - (void)addTapGestureHandler;
 | |
| 
 | |
| - (void)handleTapGesture:(UITapGestureRecognizer *)sender;
 | |
| - (void)handlePanGesture:(UIPanGestureRecognizer *)sender;
 | |
| 
 | |
| @end
 | |
| 
 | |
| NS_ASSUME_NONNULL_END
 |