本文整理汇总了C++中CJS_Runtime::GetReaderApp方法的典型用法代码示例。如果您正苦于以下问题:C++ CJS_Runtime::GetReaderApp方法的具体用法?C++ CJS_Runtime::GetReaderApp怎么用?C++ CJS_Runtime::GetReaderApp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CJS_Runtime
的用法示例。
在下文中一共展示了CJS_Runtime::GetReaderApp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mailDoc
FX_BOOL Document::mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
FX_BOOL bUI = TRUE;
CFX_WideString cTo = L"";
CFX_WideString cCc = L"";
CFX_WideString cBcc = L"";
CFX_WideString cSubject = L"";
CFX_WideString cMsg = L"";
if (params.size() >= 1)
bUI = params[0].ToBool();
if (params.size() >= 2)
cTo = params[1].ToCFXWideString();
if (params.size() >= 3)
cCc = params[2].ToCFXWideString();
if (params.size() >= 4)
cBcc = params[3].ToCFXWideString();
if (params.size() >= 5)
cSubject = params[4].ToCFXWideString();
if (params.size() >= 6)
cMsg = params[5].ToCFXWideString();
v8::Isolate* isolate = GetIsolate(cc);
if(params.size() >= 1 && params[0].GetType() == VT_object)
{
JSObject pObj = params[0].ToV8Object();
v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"bUI");
bUI = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToInt();
pValue = JS_GetObjectElement(isolate,pObj, L"cTo");
cTo = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWideString();
pValue = JS_GetObjectElement(isolate,pObj, L"cCc");
cCc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWideString();
pValue = JS_GetObjectElement(isolate,pObj, L"cBcc");
cBcc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWideString();
pValue = JS_GetObjectElement(isolate,pObj, L"cSubject");
cSubject = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWideString();
pValue = JS_GetObjectElement(isolate,pObj, L"cMsg");
cMsg = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWideString();
}
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
ASSERT(pRuntime != NULL);
pRuntime->BeginBlock();
CPDFDoc_Environment* pEnv = pRuntime->GetReaderApp();
pEnv->JS_docmailForm(NULL, 0, bUI, cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), cMsg.c_str());
pRuntime->EndBlock();
return TRUE;
}