| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- //
- // DKMessage.h
- // chatandvideotestframework
- //
- // Created by Dongke on 15/11/18.
- // Copyright © 2015年 dongke. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import <UIKit/UIKit.h>
- #import "DKMessageModel.h"
- @interface DKMessage : NSObject<DKMessageModel,NSCoding,NSCopying>
- @property (nonatomic, copy) NSString *text;
- @property (nonatomic, strong) UIImage *photo;
- @property (nonatomic, copy) NSString *thumbnailUrl;
- @property (nonatomic, copy) NSString *originPhotoUrl;
- @property (nonatomic, strong) UIImage *videoConverPhoto;
- @property (nonatomic, copy) NSString *videoPath;
- @property (nonatomic, copy) NSString *videoUrl;
- @property (nonatomic, copy) NSString *voicePath;
- @property (nonatomic, copy) NSString *voiceUrl;
- @property (nonatomic, copy) NSString *voiceDuration;
- @property (nonatomic, copy) NSString *emotionPath;
- @property (nonatomic, strong) UIImage *localPositionPhoto;
- @property (nonatomic, copy) NSString *geolocations;
- @property (nonatomic, strong) CLLocation *location;
- @property (nonatomic, strong) UIImage *avatar;
- @property (nonatomic, copy) NSString *avatarUrl;
- @property (nonatomic, copy) NSString *sender;
- @property (nonatomic, strong) NSDate *timestamp;
- @property (nonatomic, assign) BOOL shouldShowUserName;
- @property (nonatomic, assign) BOOL sended;
- @property (nonatomic, assign) DKBubbleMessageMediaType messageMediaType;
- @property (nonatomic, assign) DKBubbleMessageType bubbleMessageType;
- @property (nonatomic) BOOL isRead;
- /**
- * 初始化文本消息
- *
- * @param text 发送的目标文本
- * @param sender 发送者的名称
- * @param date 发送的时间
- *
- * @return 返回Message model 对象
- */
- - (instancetype)initWithText:(NSString *)text
- sender:(NSString *)sender
- timestamp:(NSDate *)timestamp;
- /**
- * 初始化图片类型的消息
- *
- * @param photo 目标图片
- * @param thumbnailUrl 目标图片在服务器的缩略图地址
- * @param originPhotoUrl 目标图片在服务器的原图地址
- * @param sender 发送者
- * @param date 发送时间
- *
- * @return 返回Message model 对象
- */
- - (instancetype)initWithPhoto:(UIImage *)photo
- thumbnailUrl:(NSString *)thumbnailUrl
- originPhotoUrl:(NSString *)originPhotoUrl
- sender:(NSString *)sender
- timestamp:(NSDate *)timestamp;
- /**
- * 初始化视频类型的消息
- *
- * @param videoConverPhoto 目标视频的封面图
- * @param videoPath 目标视频的本地路径,如果是下载过,或者是从本地发送的时候,会存在
- * @param videoUrl 目标视频在服务器上的地址
- * @param sender 发送者
- * @param date 发送时间
- *
- * @return 返回Message model 对象
- */
- - (instancetype)initWithVideoConverPhoto:(UIImage *)videoConverPhoto
- videoPath:(NSString *)videoPath
- videoUrl:(NSString *)videoUrl
- sender:(NSString *)sender
- timestamp:(NSDate *)timestamp;
- /**
- * 初始化语音类型的消息
- *
- * @param voicePath 目标语音的本地路径
- * @param voiceUrl 目标语音在服务器的地址
- * @param voiceDuration 目标语音的时长
- * @param sender 发送者
- * @param date 发送时间
- *
- * @return 返回Message model 对象
- */
- - (instancetype)initWithVoicePath:(NSString *)voicePath
- voiceUrl:(NSString *)voiceUrl
- voiceDuration:(NSString *)voiceDuration
- sender:(NSString *)sender
- timestamp:(NSDate *)timestamp;
- /**
- * 初始化语音类型的消息。增加已读未读标记
- *
- * @param voicePath 目标语音的本地路径
- * @param voiceUrl 目标语音在服务器的地址
- * @param voiceDuration 目标语音的时长
- * @param sender 发送者
- * @param date 发送时间
- * @param isRead 已读未读标记
- *
- * @return 返回Message model 对象
- */
- - (instancetype)initWithVoicePath:(NSString *)voicePath
- voiceUrl:(NSString *)voiceUrl
- voiceDuration:(NSString *)voiceDuration
- sender:(NSString *)sender
- timestamp:(NSDate *)timestamp
- isRead:(BOOL)isRead;
- /**
- * 初始化gif表情类型的消息
- *
- * @param emotionPath 表情的路径
- * @param sender 发送者
- * @param timestamp 发送时间
- *
- * @return 返回Message model 对象
- */
- - (instancetype)initWithEmotionPath:(NSString *)emotionPath
- sender:(NSString *)sender
- timestamp:(NSDate *)timestamp;
- /**
- * 初始化地理位置的消息
- *
- * @param localPositionPhoto 地理位置默认显示的图
- * @param geolocations 地理位置的信息
- * @param location 地理位置的经纬度
- * @param sender 发送者
- * @param timestamp 发送时间
- *
- * @return 返回Message model 对象
- */
- - (instancetype)initWithLocalPositionPhoto:(UIImage *)localPositionPhoto
- geolocations:(NSString *)geolocations
- location:(CLLocation *)location
- sender:(NSString *)sender
- timestamp:(NSDate *)timestamp;
- @end
|