CNliveChatImageMessage.h 2.53 KB
//
//  CNliveChatImageMessage.h
//  CNLiveChatManager
//
//  Created by cnliveJunBo on 17/7/11.
//  Copyright © 2017年 cnlive. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "CNLiveChatMessageBase.h"

/*!
 图片消息类
 @discussion 图片消息类
 */
@interface CNliveChatImageMessage : CNLiveChatMessageBase

/*!
 图片消息的URL地址
 
 @discussion 发送方此字段为图片的本地路径。
 */
@property(nonatomic, copy) NSString *imageUrl;

/**
 * 上传时任务Id,可用来查询上传进度
 */
@property(nonatomic,assign) uint32_t taskId;

/**
 * 消息所属用户的Id
 */
@property(nonatomic, copy) NSString *selfIdentifier;

/**
 *  图片压缩等级,详见 CNLive_IMAGE_COMPRESS_TYPE(仅对jpg格式有效)
 */
@property(nonatomic,assign) CNLive_IMAGE_COMPRESS_TYPE level;

/**
 *  图片格式,详见 CNLive_IMAGE_FORMAT
 */
@property(nonatomic,assign) CNLive_IMAGE_FORMAT format;

/**
 *  查询上传进度
 */
- (uint32_t) getUploadingProgress;

/*!
 返回时,图片消息的原始图片信息
 */
@property(nonatomic, copy) NSString *originalImage;

/**
 *  图片ID,内部标识,可用于外部缓存key
 */
@property(nonatomic,retain) NSString * originUuid;

/**
 *  图片大小
 */
@property(nonatomic,assign) int originSize;
/**
 *  图片宽度
 */
@property(nonatomic,assign) int originWidth;
/**
 *  图片高度
 */
@property(nonatomic,assign) int originHeight;

/*!
 图片消息的缩略图
 */
@property(nonatomic, copy) NSString *thumbnailImage;

/**
 *  图片ID,内部标识,可用于外部缓存key
 */
@property(nonatomic,retain) NSString * thumbUuid;

/**
 *  图片大小
 */
@property(nonatomic,assign) int thumbSize;
/**
 *  图片宽度
 */
@property(nonatomic,assign) int thumbWidth;
/**
 *  图片高度
 */
@property(nonatomic,assign) int thumbHeight;

/**
 *  获取原图图片
 *
 *  @param path 图片保存路径
 *  @param succ 成功回调,返回图片数据
 *  @param fail 失败回调,返回错误码和错误描述
 */
- (void)getOriginImage:(NSString*)path succ:(CNLiveIMSucc)succ fail:(CNLiveIMFail)fail;

/**
 *  获取缩略图图片
 *
 *  @param path 图片保存路径
 *  @param succ 成功回调,返回图片数据
 *  @param fail 失败回调,返回错误码和错误描述
 */
- (void)getThumbImage:(NSString*)path succ:(CNLiveIMSucc)succ fail:(CNLiveIMFail)fail;

/*!
 初始化图片消息
 
 @param imageURI    图片的本地路径
 @return            图片消息对象
 */
+ (instancetype)messageWithImageURI:(NSString *)imageURI;

@end