MMRichImageModel.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // MMRichImageModel.h
  3. // RichTextEditDemo
  4. //
  5. // Created by aron on 2017/7/19.
  6. // Copyright © 2017年 aron. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <UIKit/UIKit.h>
  10. #import "MMFileUploadUtil.h"
  11. #import "MMBaseRichContentModel.h"
  12. #import <YYModel.h>
  13. @protocol MMRichImageUploadDelegate <NSObject>
  14. // 上传进度回调
  15. - (void)uploadProgress:(float)progress;
  16. // 上传失败回调
  17. - (void)uploadFail;
  18. // 上传完成回调
  19. - (void)uploadDone;;
  20. @end
  21. @interface MMRichImageModel : MMBaseRichContentModel <UploadItemProtocal, UploadItemCallBackProtocal, YYModel>
  22. @property (nonatomic, strong) UIImage* image;///<图片
  23. @property (nonatomic, copy) NSString* localImageName;///<本地保存的名称
  24. @property (nonatomic, copy) NSString* remoteImageUrlString;///<上传完成之后的远程路径
  25. @property (nonatomic, assign) CGFloat imageContentHeight;///<Frame
  26. @property (nonatomic, assign, readonly) CGRect imageFrame;
  27. // 上传处理
  28. @property (nonatomic, assign) float uploadProgress;
  29. @property (nonatomic, assign) BOOL isFailed;
  30. @property (nonatomic, assign) BOOL isDone;
  31. @property (nonatomic, weak) id<MMRichImageUploadDelegate> uploadDelegate;///<上传回调
  32. /**
  33. 显示图片的属性文字
  34. */
  35. - (NSAttributedString*)attrStringWithContainerWidth:(NSInteger)containerWidth;
  36. @end