2017-10-10 22:13:54 +02:00
|
|
|
//
|
2019-01-11 15:24:24 +01:00
|
|
|
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
2017-10-10 22:13:54 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
|
2018-06-28 19:28:14 +02:00
|
|
|
@class ConversationStyle;
|
2019-10-11 06:52:56 +02:00
|
|
|
@class LKMention;
|
|
|
|
@class LKMentionCandidateSelectionView;
|
2019-01-17 17:56:52 +01:00
|
|
|
@class OWSLinkPreviewDraft;
|
2018-04-06 22:53:16 +02:00
|
|
|
@class OWSQuotedReplyModel;
|
2017-10-16 17:55:19 +02:00
|
|
|
@class SignalAttachment;
|
2019-10-09 05:46:21 +02:00
|
|
|
@class TSThread;
|
2017-10-16 17:55:19 +02:00
|
|
|
|
2017-10-10 22:13:54 +02:00
|
|
|
@protocol ConversationInputToolbarDelegate <NSObject>
|
|
|
|
|
|
|
|
- (void)sendButtonPressed;
|
|
|
|
|
|
|
|
- (void)attachmentButtonPressed;
|
|
|
|
|
2017-10-19 15:53:35 +02:00
|
|
|
#pragma mark - Voice Memo
|
|
|
|
|
2017-10-10 22:13:54 +02:00
|
|
|
- (void)voiceMemoGestureDidStart;
|
|
|
|
|
2019-02-06 06:36:03 +01:00
|
|
|
- (void)voiceMemoGestureDidLock;
|
|
|
|
|
|
|
|
- (void)voiceMemoGestureDidComplete;
|
2017-10-10 22:13:54 +02:00
|
|
|
|
|
|
|
- (void)voiceMemoGestureDidCancel;
|
|
|
|
|
2019-02-06 06:36:03 +01:00
|
|
|
- (void)voiceMemoGestureDidUpdateCancelWithRatioComplete:(CGFloat)cancelAlpha;
|
2017-10-10 22:13:54 +02:00
|
|
|
|
2019-10-11 06:52:56 +02:00
|
|
|
- (void)handleMentionCandidateSelected:(LKMention *)mentionCandidate from:(LKMentionCandidateSelectionView *)mentionCandidateSelectionView;
|
2019-10-09 05:46:21 +02:00
|
|
|
|
2017-10-10 22:13:54 +02:00
|
|
|
@end
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
|
|
|
|
@class ConversationInputTextView;
|
|
|
|
|
|
|
|
@protocol ConversationInputTextViewDelegate;
|
|
|
|
|
2017-10-24 17:43:42 +02:00
|
|
|
@interface ConversationInputToolbar : UIView
|
2017-10-10 22:13:54 +02:00
|
|
|
|
2018-06-28 19:28:14 +02:00
|
|
|
- (instancetype)initWithConversationStyle:(ConversationStyle *)conversationStyle NS_DESIGNATED_INITIALIZER;
|
2018-06-30 00:49:35 +02:00
|
|
|
- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
|
2018-06-28 19:28:14 +02:00
|
|
|
|
2017-10-10 22:13:54 +02:00
|
|
|
@property (nonatomic, weak) id<ConversationInputToolbarDelegate> inputToolbarDelegate;
|
|
|
|
|
|
|
|
- (void)beginEditingTextMessage;
|
|
|
|
- (void)endEditingTextMessage;
|
2018-01-19 21:00:41 +01:00
|
|
|
- (BOOL)isInputTextViewFirstResponder;
|
2017-10-10 22:13:54 +02:00
|
|
|
|
|
|
|
- (void)setInputTextViewDelegate:(id<ConversationInputTextViewDelegate>)value;
|
|
|
|
|
|
|
|
- (NSString *)messageText;
|
2018-07-03 06:42:32 +02:00
|
|
|
- (void)setMessageText:(NSString *_Nullable)value animated:(BOOL)isAnimated;
|
2019-05-15 03:41:07 +02:00
|
|
|
- (void)setPlaceholderText:(NSString *)placeholderText;
|
2018-07-03 06:42:32 +02:00
|
|
|
- (void)clearTextMessageAnimated:(BOOL)isAnimated;
|
2018-01-08 23:48:26 +01:00
|
|
|
- (void)toggleDefaultKeyboard;
|
2019-10-21 07:09:46 +02:00
|
|
|
- (void)setAttachmentButtonHidden:(BOOL)isHidden;
|
2017-10-19 16:10:05 +02:00
|
|
|
|
2017-10-16 18:29:22 +02:00
|
|
|
- (void)updateFontSizes;
|
|
|
|
|
2019-01-15 22:33:54 +01:00
|
|
|
- (void)updateLayoutWithSafeAreaInsets:(UIEdgeInsets)safeAreaInsets;
|
2019-02-06 06:36:03 +01:00
|
|
|
- (void)ensureTextViewHeight;
|
2019-01-11 15:24:24 +01:00
|
|
|
|
2017-10-10 22:13:54 +02:00
|
|
|
#pragma mark - Voice Memo
|
|
|
|
|
2019-02-06 06:36:03 +01:00
|
|
|
- (void)lockVoiceMemoUI;
|
|
|
|
|
2017-10-10 22:13:54 +02:00
|
|
|
- (void)showVoiceMemoUI;
|
|
|
|
|
|
|
|
- (void)hideVoiceMemoUI:(BOOL)animated;
|
|
|
|
|
|
|
|
- (void)setVoiceMemoUICancelAlpha:(CGFloat)cancelAlpha;
|
|
|
|
|
|
|
|
- (void)cancelVoiceMemoIfNecessary;
|
|
|
|
|
2019-02-06 06:36:03 +01:00
|
|
|
#pragma mark -
|
|
|
|
|
2018-04-09 15:11:56 +02:00
|
|
|
@property (nonatomic, nullable) OWSQuotedReplyModel *quotedReply;
|
2018-02-07 18:44:09 +01:00
|
|
|
|
2019-01-17 17:56:52 +01:00
|
|
|
@property (nonatomic, nullable, readonly) OWSLinkPreviewDraft *linkPreviewDraft;
|
|
|
|
|
2019-09-06 08:30:40 +02:00
|
|
|
- (void)hideInputMethod;
|
|
|
|
|
2019-10-11 06:52:56 +02:00
|
|
|
#pragma mark - Mention Candidate Selection View
|
2019-10-09 05:46:21 +02:00
|
|
|
|
2019-10-11 06:52:56 +02:00
|
|
|
- (void)showMentionCandidateSelectionViewFor:(NSArray<LKMention *> *)mentionCandidates in:(TSThread *)thread;
|
2019-10-09 05:46:21 +02:00
|
|
|
|
2019-10-11 06:52:56 +02:00
|
|
|
- (void)hideMentionCandidateSelectionView;
|
2019-10-09 05:46:21 +02:00
|
|
|
|
2017-10-10 22:13:54 +02:00
|
|
|
@end
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|