NIM 跨平台 C++ SDK
载入中...
搜索中...
未找到
nim_doc_trans_def.h 文件参考

文档转换 接口相关的常量函数等定义头文件 更多...

#include "public_defines.h"

浏览源代码.

类型定义

typedef void(* nim_doctrans_opt_cb_func) (int32_t code, const char *json_extension, const void *user_data)
 

枚举

enum  NIMDocTranscodingFileType { kNIMDocTranscodingFileTypePPT = 1 , kNIMDocTranscodingFileTypePPTX = 2 , kNIMDocTranscodingFileTypePDF = 3 }
 
enum  NIMDocTranscodingImageType { kNIMDocTranscodingImageTypeJPG = 10 , kNIMDocTranscodingImageTypePNG = 11 }
 
enum  NIMDocTranscodingQuality { kNIMDocTranscodingQualityHigh = 1 , kNIMDocTranscodingQualityMedium = 2 , kNIMDocTranscodingQualityLow = 3 }
 
enum  NIMDocContinueUploadState { kNIMDocContinueUploadNone = 0 , kNIMDocContinueUploading = 1 , kNIMDocContinueUploadFailed = 2 , kNIMDocContinueUploadCompleted = 3 }
 
enum  NIMDocTranscodingState {
  kNIMDocTranscodingStatePreparing = 1 , kNIMDocTranscodingStateOngoing = 2 , kNIMDocTranscodingStateTimeout = 3 , kNIMDocTranscodingStateCompleted = 4 ,
  kNIMDocTranscodingStateFailed = 5
}
 
enum  NIMDocTranscodingFailFlag {
  kNIMDocTransFailFlagSuccess = 0 , kNIMDocTransFailFlagNotExist = 2 , kNIMDocTransFailFlagFileTypeErr = 3 , kNIMDocTransFailFlagRequstErr = 4 ,
  kNIMDocTransFailFlagLinkErr = 5 , kNIMDocTransFailFlagServerErr = 6 , kNIMDocTransFailFlagPicErr = 7 , kNIMDocTransFailFlagQualityErr = 8 ,
  kNIMDocTransFailFlagPageLimit = 9 , kNIMDocTransFailFlagNosErr = 10 , kNIMDocTransFailFlagDocParseErr = 11 , kNIMDocTransFailFlagUnknown = 100
}
 

变量

json extension params for doc trans info

for example pic_info: "pic_info":[{"height":1080,"quality":1,"size":77599,"width":1439},{"height":720,"quality":2,"size":46287,"width":959},{"height":480,"quality":3,"size":27577,"width":639}] for example one info: {"ext":"ext_test","id":"8c17c252...","name":"name_test","page_num":0,"pic_type":11,"size":568351,"source_type":2,"state":2,"url_prefix":"http://......"} {"ext":"ext","id":"7b004b82...","name":"name","page_num":1,"pic_info":[...],"pic_type":11,"size":106496,"source_type":1,"state":4,"url_prefix":"http..."} for example infolist: {"count":3,"infos":[{"ext":"ext_test" ...},{"ext":"ext_test" ...},{"ext":"ext_test" ...}]}

static const char * kNIMDocTransCount = "count"
 int32 计数
 
static const char * kNIMDocTransInfos = "infos"
 key 分页获取时文档信息列表的key
 
static const char * kNIMDocTransId = "id"
 string 标识ID
 
static const char * kNIMDocTransName = "name"
 string 转码文档名称
 
static const char * kNIMDocTransSourceType = "source_type"
 int32 转码源文档的文件类型NIMDocTranscodingFileType
 
static const char * kNIMDocTransSize = "size"
 int64 文件大小
 
static const char * kNIMDocTransPicType = "pic_type"
 int32 转码目标图片的文件类型NIMDocTranscodingImageType
 
static const char * kNIMDocTransState = "state"
 int32 转码过程状态NIMDocTranscodingState
 
static const char * kNIMDocTransUrlPrefix = "url_prefix"
 string 转码后的下载地址前缀
 
static const char * kNIMDocTransPageNum = "page_num"
 int32 转码文档总页数
 
static const char * kNIMDocTransExt = "ext"
 string 发起文档转码时的附带信息
 
static const char * kNIMDocTransFlag = "flag"
 int32 错误原因NIMDocTranscodingFailFlag,kNIMDocTranscodingStateFailed时有效
 
static const char * kNIMDocTransPicInfo = "pic_info"
 key 图片信息的key;用于描述各个分辨率的信息
 
static const char * kNIMDocTransQuality = "quality"
 int32 转码图像清晰度
 
static const char * kNIMDocTransWidth = "width"
 int32 图片宽度
 
static const char * kNIMDocTransHeight = "height"
 int32 图片宽度
 
static const char * kNIMDocTransFilePath = "file_path"
 string 上传文件的路径
 
static const char * kNIMDocTransUploadStatus = "upload_status"
 int32 文件续传状态NIMDocContinueUploadState
 

详细描述

文档转换 接口相关的常量函数等定义头文件

作者
gq
日期
2016/12/12

类型定义说明

◆ nim_doctrans_opt_cb_func

void(* nim_doctrans_opt_cb_func)(int32_t code, const char *json_extension, const void *user_data)

nim callback function for doc trans result

参数
[out]code200为成功,其他为失败
[out]json_extensionjson扩展数据,如果查询成功返回文档信息
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
返回
void 无返回值

枚举类型说明

◆ NIMDocContinueUploadState

续传过程状态

枚举值
kNIMDocContinueUploadNone 

没有进行过上传

kNIMDocContinueUploading 

文件续传中

kNIMDocContinueUploadFailed 

文件续传失败

kNIMDocContinueUploadCompleted 

文件续传完成

◆ NIMDocTranscodingFailFlag

转码失败原因

枚举值
kNIMDocTransFailFlagSuccess 

正常

kNIMDocTransFailFlagNotExist 

找不到文件

kNIMDocTransFailFlagFileTypeErr 

文件类型错误

kNIMDocTransFailFlagRequstErr 

转码请求出现异常

kNIMDocTransFailFlagLinkErr 

转码服务器连接错误

kNIMDocTransFailFlagServerErr 

转码服务器内部错误

kNIMDocTransFailFlagPicErr 

文档转码图片出错

kNIMDocTransFailFlagQualityErr 

图片质量处理错误

kNIMDocTransFailFlagPageLimit 

页数超限

kNIMDocTransFailFlagNosErr 

nos回调错误

kNIMDocTransFailFlagDocParseErr 

文档解析出错

kNIMDocTransFailFlagUnknown 

表示未知错误

◆ NIMDocTranscodingFileType

转码源文件格式

枚举值
kNIMDocTranscodingFileTypePPT 

ppt

kNIMDocTranscodingFileTypePPTX 

pptx

kNIMDocTranscodingFileTypePDF 

pdf

◆ NIMDocTranscodingImageType

转码目标图像文件类型

枚举值
kNIMDocTranscodingImageTypeJPG 

转码为 jpg 图片

kNIMDocTranscodingImageTypePNG 

转码为 png 图片

◆ NIMDocTranscodingQuality

转码图像清晰度

枚举值
kNIMDocTranscodingQualityHigh 

高清转码质量

kNIMDocTranscodingQualityMedium 

中等转码质量

kNIMDocTranscodingQualityLow 

低清转码质量

◆ NIMDocTranscodingState

转码过程状态

枚举值
kNIMDocTranscodingStatePreparing 

转码准备中

kNIMDocTranscodingStateOngoing 

转码进行中

kNIMDocTranscodingStateTimeout 

转码超时

kNIMDocTranscodingStateCompleted 

转码完成

kNIMDocTranscodingStateFailed 

转码失败

变量说明

◆ kNIMDocTransCount

const char* kNIMDocTransCount = "count"
static

int32 计数

◆ kNIMDocTransExt

const char* kNIMDocTransExt = "ext"
static

string 发起文档转码时的附带信息

◆ kNIMDocTransFilePath

const char* kNIMDocTransFilePath = "file_path"
static

string 上传文件的路径

◆ kNIMDocTransFlag

const char* kNIMDocTransFlag = "flag"
static

int32 错误原因NIMDocTranscodingFailFlag,kNIMDocTranscodingStateFailed时有效

◆ kNIMDocTransHeight

const char* kNIMDocTransHeight = "height"
static

int32 图片宽度

◆ kNIMDocTransId

const char* kNIMDocTransId = "id"
static

string 标识ID

◆ kNIMDocTransInfos

const char* kNIMDocTransInfos = "infos"
static

key 分页获取时文档信息列表的key

◆ kNIMDocTransName

const char* kNIMDocTransName = "name"
static

string 转码文档名称

◆ kNIMDocTransPageNum

const char* kNIMDocTransPageNum = "page_num"
static

int32 转码文档总页数

◆ kNIMDocTransPicInfo

const char* kNIMDocTransPicInfo = "pic_info"
static

key 图片信息的key;用于描述各个分辨率的信息

◆ kNIMDocTransPicType

const char* kNIMDocTransPicType = "pic_type"
static

int32 转码目标图片的文件类型NIMDocTranscodingImageType

◆ kNIMDocTransQuality

const char* kNIMDocTransQuality = "quality"
static

int32 转码图像清晰度

◆ kNIMDocTransSize

const char* kNIMDocTransSize = "size"
static

int64 文件大小

◆ kNIMDocTransSourceType

const char* kNIMDocTransSourceType = "source_type"
static

int32 转码源文档的文件类型NIMDocTranscodingFileType

◆ kNIMDocTransState

const char* kNIMDocTransState = "state"
static

int32 转码过程状态NIMDocTranscodingState

◆ kNIMDocTransUploadStatus

const char* kNIMDocTransUploadStatus = "upload_status"
static

int32 文件续传状态NIMDocContinueUploadState

◆ kNIMDocTransUrlPrefix

const char* kNIMDocTransUrlPrefix = "url_prefix"
static

string 转码后的下载地址前缀

◆ kNIMDocTransWidth

const char* kNIMDocTransWidth = "width"
static

int32 图片宽度