| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- //
- // DKMessageBubbleView.h
- // MessageDisplayExample
- //
- // Created by HUAJIE-1 on 14-4-24.
- // Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved.
- //
- #import <UIKit/UIKit.h>
- // Views
- //#import "DKMessageTextView.h"
- #import "DKMessageInputView.h"
- //#import "DKBubblePhotoImageView.h"
- //#import "SETextView.h"
- #import "DKAnimatedImageView.h"
- //#import "DKAnimatedImage.h"
- // Macro
- #import "DKMacro.h"
- // Model
- #import "DKMessage.h"
- // Factorys
- //#import "DKMessageAvatarFactory.h"
- #import "DKMessageVoiceFactory.h"
- #define kDKMessageBubbleDisplayMaxLine 200
- #define kDKTextLineSpacing 3.0
- @interface DKMessageBubbleView : UIView
- /**
- * 目标消息Model对象
- */
- @property (nonatomic, strong, readonly) id <DKMessageModel> message;
- /**
- * 自定义显示文本消息控件,子类化的原因有两个,第一个是屏蔽Menu的显示。第二是传递手势到下一层,因为文本需要双击的手势
- */
- //@property (nonatomic, weak, readonly) SETextView *displayTextView;
- /**
- * 用于显示气泡的ImageView控件
- */
- @property (nonatomic, weak, readonly) UIImageView *bubbleImageView;
- /**
- * 专门用于gif表情显示控件
- */
- //@property (nonatomic, weak, readonly) FLAnimatedImageView *emotionImageView;
- /**
- * 用于显示语音的控件,并且支持播放动画
- */
- @property (nonatomic, weak, readonly) UIImageView *animationVoiceImageView;
- /**
- * 用于显示语音未读的控件,小圆点
- */
- @property (nonatomic, weak, readonly) UIImageView *voiceUnreadDotImageView;
- /**
- * 用于显示语音时长的label
- */
- @property (nonatomic, weak, readonly) UILabel *voiceDurationLabel;
- ///**
- // * 用于显示仿微信发送图片的控件
- // */
- //@property (nonatomic, weak, readonly) DKBubblePhotoImageView *bubblePhotoImageView;
- /**
- * 显示语音播放的图片控件
- */
- @property (nonatomic, weak, readonly) UIImageView *videoPlayImageView;
- /**
- * 显示地理位置的文本控件
- */
- //@property (nonatomic, weak, readonly) UILabel *geolocationsLabel;
- /**
- * 设置文本消息的字体
- */
- @property (nonatomic, strong) UIFont *font UI_APPEARANCE_SELECTOR;
- /**
- * 初始化消息内容显示控件的方法
- *
- * @param frame 目标Frame
- * @param message 目标消息Model对象
- *
- * @return 返回DKMessageBubbleView类型的对象
- */
- - (instancetype)initWithFrame:(CGRect)frame
- message:(id <DKMessageModel>)message;
- /**
- * 获取气泡相对于父试图的位置
- *
- * @return 返回气泡的位置
- */
- - (CGRect)bubbleFrame;
- /**
- * 根据消息Model对象配置消息显示内容
- *
- * @param message 目标消息Model对象
- */
- - (void)configureCellWithMessage:(id <DKMessageModel>)message;
- /**
- * 根据消息Model对象计算消息内容的高度
- *
- * @param message 目标消息Model对象
- *
- * @return 返回所需高度
- */
- + (CGFloat)calculateCellHeightWithMessage:(id <DKMessageModel>)message;
- @end
|