WhiteConversionInfo.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // PptProgress.h
  3. // WhiteSDK
  4. //
  5. // Created by yleaf on 2019/6/25.
  6. //
  7. #import "WhiteObject.h"
  8. #import "WhiteScene.h"
  9. #import "WhitePptPage.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. /** 服务器端文档转换状态。*/
  12. typedef NS_ENUM(NSInteger, ServerConversionStatus) {
  13. /** 文档转换服务排队中。*/
  14. ServerConversionStatusWaiting,
  15. /** 文档正在转换。 */
  16. ServerConversionStatusConverting,
  17. /** 未查询到文档转换服务,请检查 `taskId`,与转换类型(动态,静态)是否正确。 */
  18. ServerConversionStatusNotFound,
  19. /** 文档转换完成。 */
  20. ServerConversionStatusFinished,
  21. /** 文档转换失败,错误原因详见服务器 `reason` 字段。 */
  22. ServerConversionStatusFail
  23. };
  24. /** PPT 转换类型。*/
  25. typedef NS_ENUM(NSInteger, ConvertType) {
  26. /** 未知,初始状态。 */
  27. ConvertTypeUnknown = -1,
  28. /** 静态 ppt,即每一页 PPT 都会被转换为图片。 */
  29. ConvertTypeStatic,
  30. /** 动态 PPT,即每一页 PPT 会被转化为动态版本。 */
  31. ConvertTypeDynamic
  32. };
  33. /** 服务器中文档转换的进度信息。*/
  34. @interface WhiteConversionInfo : WhiteObject
  35. @property (nonatomic, assign, readonly) ServerConversionStatus convertStatus;
  36. @property (nonatomic, copy, readonly) NSString *reason;
  37. @property (nonatomic, assign, readonly) NSInteger totalPageSize;
  38. @property (nonatomic, assign, readonly) NSInteger convertedPageSize;
  39. @property (nonatomic, assign, readonly) CGFloat convertedPercentage;
  40. /** 转换成功时,资源文件所用前缀。*/
  41. @property (nonatomic, copy, readonly, nullable) NSString *prefix;
  42. /** 转换结果。*/
  43. @property (nonatomic, copy, readonly, nullable) NSArray<WhitePptPage *> *convertedFileList;
  44. @end
  45. /** 将服务器转换好的数据,转化为 SDK 可用的格式,直接将 scenes 插入 sdk 即可。*/
  46. @interface ConvertedFiles : NSObject
  47. @property (nonatomic, copy) NSString *taskId;
  48. @property (nonatomic, assign) ConvertType type;
  49. @property (nonatomic, assign) CGFloat width;
  50. @property (nonatomic, assign) CGFloat height;
  51. @property (nonatomic, copy) NSArray<NSString *> *slideURLs;
  52. /** 白板可接受,能够直接使用场景数据。*/
  53. @property (nonatomic, copy) NSArray<WhiteScene *> *scenes;
  54. @end
  55. NS_ASSUME_NONNULL_END