| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- //
- // DKMessageInputView.h
- // MessageDisplayExample
- //
- // Created by on 14-4-24.
- // Copyright (c) 2014年 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved.
- //
- #import <UIKit/UIKit.h>
- typedef NS_ENUM(NSInteger, DKMessageInputViewStyle) {
-
- DKMessageInputViewStyleFlat
- };
- typedef NS_ENUM(NSUInteger, DKInputViewType) {
- DKInputViewTypeNormal = 0,
- DKInputViewTypeText,
- DKInputViewTypeEmotion,
- DKInputViewTypeShareMenu,
- };
- @protocol DKMessageInputViewDelegate <NSObject>
- @optional
- /**
- * 在发送文本和语音之间发送改变时,会触发这个回调函数
- *
- * @param changed 是否改为发送语音状态
- */
- - (void)didChangeSendVoiceAction:(BOOL)changed;
- /**
- * 发送文本消息,包括系统的表情
- *
- * @param text 目标文本消息
- */
- - (void)didSendTextAction:(NSString *)text;
- /**
- * 点击+号按钮Action
- */
- - (void)didSelectedMultipleMediaAction;
- /**
- * 按下錄音按鈕 "準備" 錄音
- */
- - (void)prepareRecordingVoiceActionWithCompletion:(BOOL (^)(void))completion;
- /**
- * 开始录音
- */
- - (void)didStartRecordingVoiceAction;
- /**
- * 手指向上滑动取消录音
- */
- - (void)didCancelRecordingVoiceAction;
- /**
- * 松开手指完成录音
- */
- - (void)didFinishRecordingVoiceAction;
- /**
- * 当手指离开按钮的范围内时,主要为了通知外部的HUD
- */
- - (void)didDragOutsideAction;
- /**
- * 当手指再次进入按钮的范围内时,主要也是为了通知外部的HUD
- */
- - (void)didDragInsideAction;
- /**
- * 发送第三方表情
- *
- * @param facePath 目标表情的本地路径
- */
- - (void)didSendFaceAction:(BOOL)sendFace;
- -(void)saveLog;
- @end
- @interface DKMessageInputView : UIImageView
- @property (nonatomic, weak) id <DKMessageInputViewDelegate> delegate;
- /**
- * 当前输入工具条的样式
- */
- @property (nonatomic, assign) DKMessageInputViewStyle messageInputViewStyle; // default is DKMessageInputViewStyleFlat
- /**
- * 是否允许发送语音
- */
- @property (nonatomic, assign) BOOL allowsSendVoice; // default is YES
- /**
- * 是否允许发送多媒体
- */
- @property (nonatomic, assign) BOOL allowsSendMultiMedia; // default is YES
- /**
- * 是否支持发送表情
- */
- @property (nonatomic, assign) BOOL allowsSendFace; // default is YES
- /**
- * 是否支持位置
- */
- @property (nonatomic, assign) BOOL allowsPosition; // default is YES
- /**
- * 切换文本和语音的按钮
- */
- @property (nonatomic, weak, readonly) UIButton *voiceChangeButton;
- /**
- * camera按钮
- */
- @property (nonatomic, weak, readonly) UIButton *cameraButton;
- /**
- * photo按钮
- */
- @property (nonatomic, weak, readonly) UIButton *photoButton;
- /**
- * 语音录制按钮
- */
- @property (nonatomic, weak, readonly) UIButton *holdDownButton;
- /**
- * 键盘按钮
- */
- @property (nonatomic, weak, readonly) UIButton *keyboardButton;
- /**
- * 位置按钮
- */
- @property (nonatomic, weak, readonly) UIButton *positionButton;
- // 按钮对象消息
- @property (nonatomic, strong)UIButton *saveButton;
- @property (nonatomic, strong)UIButton *switchButton;
- @property (nonatomic, strong)UIButton *voiceButton;
- #pragma mark - Message input view
- + (CGFloat)textViewLineHeight;
- /**
- * 获取最大行数
- *
- * @return 返回最大行数
- */
- + (CGFloat)maxLines;
- /**
- * 获取根据最大行数和每行高度计算出来的最大显示高度
- *
- * @return 返回最大显示高度
- */
- + (CGFloat)maDKeight;
- @end
|