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