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.
		
		
		
		
		
			
		
			
	
	
		
			82 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C
		
	
		
		
			
		
	
	
			82 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C
		
	
| 
											8 years ago
										 | //
 | ||
| 
											8 years ago
										 | //  Copyright (c) 2018 Open Whisper Systems. All rights reserved.
 | ||
| 
											8 years ago
										 | //
 | ||
|  | 
 | ||
|  | NS_ASSUME_NONNULL_BEGIN | ||
|  | 
 | ||
| 
											7 years ago
										 | @class ConversationStyle; | ||
| 
											8 years ago
										 | @class ConversationViewCell; | ||
|  | @class OWSContactOffersInteraction; | ||
| 
											7 years ago
										 | @class OWSContactsManager; | ||
| 
											8 years ago
										 | @class TSAttachmentStream; | ||
| 
											7 years ago
										 | @class TSCall; | ||
|  | @class TSErrorMessage; | ||
| 
											8 years ago
										 | @class TSInteraction; | ||
| 
											7 years ago
										 | @class TSInvalidIdentityKeyErrorMessage; | ||
| 
											8 years ago
										 | @class TSMessage; | ||
|  | @class TSOutgoingMessage; | ||
| 
											8 years ago
										 | @class TSQuotedMessage; | ||
| 
											8 years ago
										 | 
 | ||
| 
											7 years ago
										 | @protocol ConversationViewItem; | ||
|  | 
 | ||
| 
											8 years ago
										 | @protocol ConversationViewCellDelegate <NSObject> | ||
|  | 
 | ||
| 
											7 years ago
										 | - (void)conversationCell:(ConversationViewCell *)cell | ||
| 
											7 years ago
										 |             shouldAllowReply:(BOOL)shouldAllowReply | ||
| 
											7 years ago
										 |     didLongpressTextViewItem:(id<ConversationViewItem>)viewItem; | ||
|  | - (void)conversationCell:(ConversationViewCell *)cell | ||
| 
											7 years ago
										 |              shouldAllowReply:(BOOL)shouldAllowReply | ||
| 
											7 years ago
										 |     didLongpressMediaViewItem:(id<ConversationViewItem>)viewItem; | ||
|  | - (void)conversationCell:(ConversationViewCell *)cell | ||
| 
											7 years ago
										 |              shouldAllowReply:(BOOL)shouldAllowReply | ||
| 
											7 years ago
										 |     didLongpressQuoteViewItem:(id<ConversationViewItem>)viewItem; | ||
| 
											7 years ago
										 | - (void)conversationCell:(ConversationViewCell *)cell | ||
| 
											7 years ago
										 |     didLongpressSystemMessageViewItem:(id<ConversationViewItem>)viewItem; | ||
| 
											7 years ago
										 | 
 | ||
| 
											8 years ago
										 | #pragma mark - System Cell
 | ||
|  | 
 | ||
| 
											7 years ago
										 | - (void)tappedCorruptedMessage:(TSErrorMessage *)message; | ||
|  | - (void)resendGroupUpdateForErrorMessage:(TSErrorMessage *)message; | ||
|  | - (void)showConversationSettings; | ||
| 
											8 years ago
										 | 
 | ||
| 
											8 years ago
										 | #pragma mark - Caching
 | ||
|  | 
 | ||
|  | - (NSCache *)cellMediaCache; | ||
|  | 
 | ||
| 
											8 years ago
										 | #pragma mark - Messages
 | ||
|  | 
 | ||
|  | - (void)didTapFailedOutgoingMessage:(TSOutgoingMessage *)message; | ||
|  | 
 | ||
| 
											8 years ago
										 | @end | ||
|  | 
 | ||
|  | #pragma mark -
 | ||
|  | 
 | ||
| 
											8 years ago
										 | // TODO: Consider making this a protocol.
 | ||
| 
											8 years ago
										 | @interface ConversationViewCell : UICollectionViewCell | ||
|  | 
 | ||
|  | @property (nonatomic, nullable, weak) id<ConversationViewCellDelegate> delegate; | ||
|  | 
 | ||
| 
											7 years ago
										 | @property (nonatomic, nullable) id<ConversationViewItem> viewItem; | ||
| 
											8 years ago
										 | 
 | ||
| 
											8 years ago
										 | // Cells are prefetched but expensive cells (e.g. media) should only load
 | ||
|  | // when visible and unload when no longer visible.  Non-visible cells can
 | ||
|  | // cache their contents on their ConversationViewItem, but that cache may
 | ||
|  | // be evacuated before the cell becomes visible again.
 | ||
| 
											8 years ago
										 | //
 | ||
|  | // ConversationViewController also uses this property to evacuate the cell's
 | ||
|  | // meda views when:
 | ||
|  | //
 | ||
|  | // * App enters background.
 | ||
|  | // * Users enters another view (e.g. conversation settings view, call screen, etc.).
 | ||
| 
											8 years ago
										 | @property (nonatomic) BOOL isCellVisible; | ||
|  | 
 | ||
| 
											7 years ago
										 | @property (nonatomic, nullable) ConversationStyle *conversationStyle; | ||
| 
											8 years ago
										 | 
 | ||
| 
											7 years ago
										 | - (void)loadForDisplay; | ||
| 
											8 years ago
										 | 
 | ||
| 
											7 years ago
										 | - (CGSize)cellSize; | ||
| 
											8 years ago
										 | 
 | ||
|  | @end | ||
|  | 
 | ||
|  | NS_ASSUME_NONNULL_END |