文档模块

头文件

VHDocumentView.h

类名

VHDocumentView

属性

delegate

@property (nonatomic,weak)id <VHDocumentViewDelegate>      delegate;

isLoad

/*
 * 文档播发器准备完成
 */
@property (nonatomic,assign,readonly)BOOL   isLoad;//load完

editEnable

/*
 * 是否可以编辑 作为发起端 默认NO 不可编辑
 */
@property (nonatomic,assign)BOOL    editEnable;

doc_hash

/*
 * 文档hash
 */
@property (nonatomic,strong)NSString*    doc_hash;

totalPage

/*
 * 总页数
 */
@property (nonatomic,assign)int    totalPage;

totalStep

/*
 * 总步数
 */
@property (nonatomic,assign)int    totalStep;

currentPage

/*
 * 当前页
 */
@property (nonatomic,assign)int    currentPage;

currentStep

/*
 * 当前步
 */
@property (nonatomic,assign)int    currentStep;

editGraffitEnable

/*
 * 是否开启涂鸦模式
 */
@property (nonatomic,assign)BOOL    editGraffitEnable;

drawAction

/*
 * 绘制命令类型
 */
@property (nonatomic,assign)VHDrawAction  drawAction;

drawType

/*
 * 绘制类型
 * 注意:设置此参数时  editType 自动设置为 VHEditType_Add 模式
 */
@property (nonatomic,assign)VHDrawType  drawType;

cid

/*
 * 文档View id
 */
@property (nonatomic,copy)NSString * cid;

documentdId

/*
 * 文档 ID 只有 type = VHDocumentViewType_Document时存在
 */
@property (nonatomic,copy)NSString * documentdId;

方法

setDocumentMsg:

/*
 * 接收消息并在涂鸦画板处理
 */
- (void)setDocumentMsg:(id)msg;

setDocumentMsg:

/*
 * 接收消息并在涂鸦画板处理
 */
- (void)setDocumentMsg:(id)msg;

setDocumentMsg:

/*
 * 接收消息并在涂鸦画板处理
 */
- (void)setDocumentMsg:(id)msg;

gotoPage:

/*
 * 跳转至第几页
 */
- (void)gotoPage:(int) page;

gotoPage:step:

/*
 * 跳转至第几页的第几步
 */
- (void)gotoPage:(int) page step:(int)step;

prevPage

/*
 * 上一页
 */
- (void)prevPage;

nextPage

/*
 * 下一页
 */
- (void)nextPage;

prevStep

/*
 * 上一步
 */
- (void)prevStep;

nextStep

/*
 * 下一步
 */
- (void)nextStep;

setColor:

*
 * 设置颜色、大小
 */
- (void)setColor:(UIColor*)color;

setSize:

/*
 * 大小
 */
- (void)setSize:(NSInteger)size;

clear

/*
 * 清空
 */
- (void)clear;

枚举类型

VHDrawAction

typedef NS_ENUM(NSInteger,VHDrawAction) {
    VHDrawAction_Add          = 1 ,   //添加画板元素 设置 VHDrawType 时会自动设置为此选项
    VHDrawAction_Modify       = 2 ,   //选择后修改 画板元素
    VHDrawAction_Delete       = 3 ,   //删除画板元素
};

VHDrawType

typedef NS_ENUM(NSInteger,VHDrawType) {
    VHDrawType_Pen          = 1 ,   //画笔
    VHDrawType_Highlighter  = 2 ,   //荧光笔
    VHDrawType_Rectangle    = 3 ,   //矩形
    VHDrawType_Circle       = 4 ,   //圆
    VHDrawType_Arrow        = 5 ,   //箭头 此版本暂不支持
    VHDrawType_Text         = 6 ,   //文字 此版本暂不支持
    VHDrawType_Image        = 7 ,   //图片 此版本暂不支持
};