本文整理汇总了C++中CFX_WideString::FromLocal方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_WideString::FromLocal方法的具体用法?C++ CFX_WideString::FromLocal怎么用?C++ CFX_WideString::FromLocal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_WideString
的用法示例。
在下文中一共展示了CFX_WideString::FromLocal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnBeforeNotifySubmit
bool CPDFXFA_DocEnvironment::OnBeforeNotifySubmit() {
if (m_pContext->GetDocType() != DOCTYPE_DYNAMIC_XFA &&
m_pContext->GetDocType() != DOCTYPE_STATIC_XFA) {
return true;
}
if (!m_pContext->GetXFADocView())
return true;
CXFA_FFWidgetHandler* pWidgetHandler =
m_pContext->GetXFADocView()->GetWidgetHandler();
if (!pWidgetHandler)
return true;
std::unique_ptr<CXFA_WidgetAccIterator> pWidgetAccIterator(
m_pContext->GetXFADocView()->CreateWidgetAccIterator());
if (pWidgetAccIterator) {
CXFA_EventParam Param;
Param.m_eType = XFA_EVENT_PreSubmit;
while (CXFA_WidgetAcc* pWidgetAcc = pWidgetAccIterator->MoveToNext())
pWidgetHandler->ProcessEvent(pWidgetAcc, &Param);
}
pWidgetAccIterator.reset(
m_pContext->GetXFADocView()->CreateWidgetAccIterator());
if (!pWidgetAccIterator)
return true;
CXFA_WidgetAcc* pWidgetAcc = pWidgetAccIterator->MoveToNext();
pWidgetAcc = pWidgetAccIterator->MoveToNext();
while (pWidgetAcc) {
int fRet = pWidgetAcc->ProcessValidate(-1);
if (fRet == XFA_EVENTERROR_Error) {
CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pContext->GetFormFillEnv();
if (!pFormFillEnv)
return false;
CFX_WideString ws;
ws.FromLocal(IDS_XFA_Validate_Input);
CFX_ByteString bs = ws.UTF16LE_Encode();
int len = bs.GetLength();
pFormFillEnv->Alert((FPDF_WIDESTRING)bs.GetBuffer(len),
(FPDF_WIDESTRING)L"", 0, 1);
bs.ReleaseBuffer(len);
return false;
}
pWidgetAcc = pWidgetAccIterator->MoveToNext();
}
m_pContext->GetXFADocView()->UpdateDocView();
return true;
}
示例2: GetTitle
void CPDFXFA_DocEnvironment::GetTitle(CXFA_FFDoc* hDoc,
CFX_WideString& wsTitle) {
if (hDoc != m_pContext->GetXFADoc() || !m_pContext->GetPDFDoc())
return;
CPDF_Dictionary* pInfoDict = m_pContext->GetPDFDoc()->GetInfo();
if (!pInfoDict)
return;
CFX_ByteString csTitle = pInfoDict->GetStringFor("Title");
wsTitle = wsTitle.FromLocal(csTitle.GetBuffer(csTitle.GetLength()));
csTitle.ReleaseBuffer(csTitle.GetLength());
}
示例3: SubmitDataInternal
bool CPDFXFA_DocEnvironment::SubmitDataInternal(CXFA_FFDoc* hDoc,
CXFA_Submit submit) {
CPDFSDK_FormFillEnvironment* pFormFillEnv = m_pContext->GetFormFillEnv();
if (!pFormFillEnv)
return false;
CFX_WideStringC csURLC;
submit.GetSubmitTarget(csURLC);
CFX_WideString csURL(csURLC);
if (csURL.IsEmpty()) {
CFX_WideString ws;
ws.FromLocal("Submit cancelled.");
CFX_ByteString bs = ws.UTF16LE_Encode();
int len = bs.GetLength();
pFormFillEnv->Alert((FPDF_WIDESTRING)bs.GetBuffer(len),
(FPDF_WIDESTRING)L"", 0, 4);
bs.ReleaseBuffer(len);
return false;
}
FPDF_FILEHANDLER* pFileHandler = nullptr;
int fileFlag = -1;
switch (submit.GetSubmitFormat()) {
case XFA_ATTRIBUTEENUM_Xdp: {
CFX_WideStringC csContentC;
submit.GetSubmitXDPContent(csContentC);
CFX_WideString csContent;
csContent = csContentC;
csContent.TrimLeft();
csContent.TrimRight();
CFX_WideString space;
space.FromLocal(" ");
csContent = space + csContent + space;
FPDF_DWORD flag = 0;
if (submit.IsSubmitEmbedPDF())
flag |= FXFA_PDF;
ToXFAContentFlags(csContent, flag);
pFileHandler = pFormFillEnv->OpenFile(FXFA_SAVEAS_XDP, nullptr, "wb");
fileFlag = FXFA_SAVEAS_XDP;
ExportSubmitFile(pFileHandler, FXFA_SAVEAS_XDP, 0, flag);
break;
}
case XFA_ATTRIBUTEENUM_Xml:
pFileHandler = pFormFillEnv->OpenFile(FXFA_SAVEAS_XML, nullptr, "wb");
fileFlag = FXFA_SAVEAS_XML;
ExportSubmitFile(pFileHandler, FXFA_SAVEAS_XML, 0, FXFA_XFA_ALL);
break;
case XFA_ATTRIBUTEENUM_Pdf:
break;
case XFA_ATTRIBUTEENUM_Urlencoded:
pFileHandler = pFormFillEnv->OpenFile(FXFA_SAVEAS_XML, nullptr, "wb");
fileFlag = FXFA_SAVEAS_XML;
ExportSubmitFile(pFileHandler, FXFA_SAVEAS_XML, 0, FXFA_XFA_ALL);
break;
default:
return false;
}
if (!pFileHandler)
return false;
if (csURL.Left(7).CompareNoCase(L"mailto:") == 0) {
CFX_WideString csToAddress;
CFX_WideString csCCAddress;
CFX_WideString csBCCAddress;
CFX_WideString csSubject;
CFX_WideString csMsg;
if (!MailToInfo(csURL, csToAddress, csCCAddress, csBCCAddress, csSubject,
csMsg)) {
return false;
}
CFX_ByteString bsTo = CFX_WideString(csToAddress).UTF16LE_Encode();
CFX_ByteString bsCC = CFX_WideString(csCCAddress).UTF16LE_Encode();
CFX_ByteString bsBcc = CFX_WideString(csBCCAddress).UTF16LE_Encode();
CFX_ByteString bsSubject = CFX_WideString(csSubject).UTF16LE_Encode();
CFX_ByteString bsMsg = CFX_WideString(csMsg).UTF16LE_Encode();
FPDF_WIDESTRING pTo = (FPDF_WIDESTRING)bsTo.GetBuffer(bsTo.GetLength());
FPDF_WIDESTRING pCC = (FPDF_WIDESTRING)bsCC.GetBuffer(bsCC.GetLength());
FPDF_WIDESTRING pBcc = (FPDF_WIDESTRING)bsBcc.GetBuffer(bsBcc.GetLength());
FPDF_WIDESTRING pSubject =
(FPDF_WIDESTRING)bsSubject.GetBuffer(bsSubject.GetLength());
FPDF_WIDESTRING pMsg = (FPDF_WIDESTRING)bsMsg.GetBuffer(bsMsg.GetLength());
pFormFillEnv->EmailTo(pFileHandler, pTo, pSubject, pCC, pBcc, pMsg);
bsTo.ReleaseBuffer();
bsCC.ReleaseBuffer();
bsBcc.ReleaseBuffer();
bsSubject.ReleaseBuffer();
bsMsg.ReleaseBuffer();
} else {
// HTTP or FTP
CFX_WideString ws;
CFX_ByteString bs = csURL.UTF16LE_Encode();
int len = bs.GetLength();
pFormFillEnv->UploadTo(pFileHandler, fileFlag,
(FPDF_WIDESTRING)bs.GetBuffer(len));
bs.ReleaseBuffer(len);
}
return true;
}