session-ios/Signal/src/ViewControllers/ConversationView/ConversationInputToolbar.h

98 lines
2.4 KiB
C
Raw Normal View History

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;
@class OWSLinkPreviewDraft;
@class OWSQuotedReplyModel;
@class SignalAttachment;
2019-10-09 05:46:21 +02:00
@class TSThread;
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;
- (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;
- (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;
- (void)setPlaceholderText:(NSString *)placeholderText;
2018-07-03 06:42:32 +02:00
- (void)clearTextMessageAnimated:(BOOL)isAnimated;
- (void)toggleDefaultKeyboard;
2019-10-21 07:09:46 +02:00
- (void)setAttachmentButtonHidden:(BOOL)isHidden;
- (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 -
@property (nonatomic, nullable) OWSQuotedReplyModel *quotedReply;
@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