本文整理汇总了C++中CFFL_FormFiller::SetActionData方法的典型用法代码示例。如果您正苦于以下问题:C++ CFFL_FormFiller::SetActionData方法的具体用法?C++ CFFL_FormFiller::SetActionData怎么用?C++ CFFL_FormFiller::SetActionData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFFL_FormFiller
的用法示例。
在下文中一共展示了CFFL_FormFiller::SetActionData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pObserved
std::pair<bool, bool> CFFL_InteractiveFormFiller::OnBeforeKeyStroke(
const CPWL_Wnd::PrivateData* pAttached,
WideString& strChange,
const WideString& strChangeEx,
int nSelStart,
int nSelEnd,
bool bKeyDown,
uint32_t nFlag) {
// Copy the private data since the window owning it may not survive.
CFFL_PrivateData privateData =
*static_cast<const CFFL_PrivateData*>(pAttached);
ASSERT(privateData.pWidget);
CFFL_FormFiller* pFormFiller = GetFormFiller(privateData.pWidget, false);
#ifdef PDF_ENABLE_XFA
if (pFormFiller->IsFieldFull(privateData.pPageView)) {
CPDFSDK_Annot::ObservedPtr pObserved(privateData.pWidget);
if (OnFull(&pObserved, privateData.pPageView, nFlag) || !pObserved)
return {true, true};
}
#endif // PDF_ENABLE_XFA
if (m_bNotifying ||
!privateData.pWidget->GetAAction(CPDF_AAction::kKeyStroke).GetDict()) {
return {true, false};
}
AutoRestorer<bool> restorer(&m_bNotifying);
m_bNotifying = true;
uint32_t nAge = privateData.pWidget->GetAppearanceAge();
uint32_t nValueAge = privateData.pWidget->GetValueAge();
CPDFSDK_FormFillEnvironment* pFormFillEnv =
privateData.pPageView->GetFormFillEnv();
CPDFSDK_FieldAction fa;
fa.bModifier = CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(nFlag);
fa.bShift = CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(nFlag);
fa.sChange = strChange;
fa.sChangeEx = strChangeEx;
fa.bKeyDown = bKeyDown;
fa.bWillCommit = false;
fa.bRC = true;
fa.nSelStart = nSelStart;
fa.nSelEnd = nSelEnd;
pFormFiller->GetActionData(privateData.pPageView, CPDF_AAction::kKeyStroke,
fa);
pFormFiller->SaveState(privateData.pPageView);
CPDFSDK_Annot::ObservedPtr pObserved(privateData.pWidget);
bool action_status = privateData.pWidget->OnAAction(
CPDF_AAction::kKeyStroke, &fa, privateData.pPageView);
if (!pObserved || !IsValidAnnot(privateData.pPageView, privateData.pWidget))
return {true, true};
if (!action_status)
return {true, false};
bool bExit = false;
if (nAge != privateData.pWidget->GetAppearanceAge()) {
CPWL_Wnd* pWnd = pFormFiller->ResetPDFWindow(
privateData.pPageView, nValueAge == privateData.pWidget->GetValueAge());
if (!pWnd)
return {true, true};
privateData =
*static_cast<const CFFL_PrivateData*>(pWnd->GetAttachedData());
bExit = true;
}
if (fa.bRC) {
pFormFiller->SetActionData(privateData.pPageView, CPDF_AAction::kKeyStroke,
fa);
} else {
pFormFiller->RestoreState(privateData.pPageView);
}
if (pFormFillEnv->GetFocusAnnot() == privateData.pWidget)
return {false, bExit};
pFormFiller->CommitData(privateData.pPageView, nFlag);
return {false, true};
}
示例2: OnBeforeKeyStroke
void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode,
CFX_WideString & strChange, const CFX_WideString& strChangeEx,
int nSelStart, int nSelEnd,
FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag)
{
ASSERT(pPrivateData != NULL);
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
ASSERT(pData->pWidget != NULL);
CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
ASSERT(pFormFiller != NULL);
if (!m_bNotifying)
{
if (pData->pWidget->GetAAction(CPDF_AAction::KeyStroke))
{
m_bNotifying = TRUE;
int nAge = pData->pWidget->GetAppearanceAge();
int nValueAge = pData->pWidget->GetValueAge();
ASSERT(pData->pPageView != NULL);
CPDFSDK_Document* pDocument = pData->pPageView->GetSDKDocument();
PDFSDK_FieldAction fa;
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
fa.sChange = strChange;
fa.sChangeEx = strChangeEx;
fa.bKeyDown = bKeyDown;
fa.bWillCommit = FALSE;
fa.bRC = TRUE;
fa.nSelStart = nSelStart;
fa.nSelEnd = nSelEnd;
pFormFiller->GetActionData(pData->pPageView, CPDF_AAction::KeyStroke, fa);
pFormFiller->SaveState(pData->pPageView);
if (pData->pWidget->OnAAction(CPDF_AAction::KeyStroke, fa, pData->pPageView))
{
if (!IsValidAnnot(pData->pPageView, pData->pWidget))
{
bExit = TRUE;
m_bNotifying = FALSE;
return;
}
if (nAge != pData->pWidget->GetAppearanceAge())
{
CPWL_Wnd* pWnd = pFormFiller->ResetPDFWindow(pData->pPageView, nValueAge == pData->pWidget->GetValueAge());
pData = (CFFL_PrivateData*)pWnd->GetAttachedData();
bExit = TRUE;
}
if (fa.bRC)
{
pFormFiller->SetActionData(pData->pPageView, CPDF_AAction::KeyStroke, fa);
bRC = FALSE;
}
else
{
pFormFiller->RestoreState(pData->pPageView);
bRC = FALSE;
}
if (pDocument->GetFocusAnnot() != pData->pWidget)
{
pFormFiller->CommitData(pData->pPageView,nFlag);
bExit = TRUE;
}
}
else
{
if (!IsValidAnnot(pData->pPageView, pData->pWidget))
{
bExit = TRUE;
m_bNotifying = FALSE;
return;
}
}
m_bNotifying = FALSE;
}
}
}
示例3: OnBeforeKeyStroke
void CFFL_IFormFiller::OnBeforeKeyStroke(void* pPrivateData,
CFX_WideString& strChange,
const CFX_WideString& strChangeEx,
int nSelStart,
int nSelEnd,
FX_BOOL bKeyDown,
FX_BOOL& bRC,
FX_BOOL& bExit,
uint32_t nFlag) {
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
ASSERT(pData->pWidget);
CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
#ifdef PDF_ENABLE_XFA
if (pFormFiller->IsFieldFull(pData->pPageView)) {
FX_BOOL bFullExit = FALSE;
FX_BOOL bFullReset = FALSE;
OnFull(pData->pWidget, pData->pPageView, bFullReset, bFullExit, nFlag);
if (bFullReset || bFullExit) {
bExit = TRUE;
return;
}
}
#endif // PDF_ENABLE_XFA
if (!m_bNotifying) {
if (pData->pWidget->GetAAction(CPDF_AAction::KeyStroke).GetDict()) {
m_bNotifying = TRUE;
int nAge = pData->pWidget->GetAppearanceAge();
int nValueAge = pData->pWidget->GetValueAge();
CPDFSDK_Document* pDocument = pData->pPageView->GetSDKDocument();
PDFSDK_FieldAction fa;
fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
fa.sChange = strChange;
fa.sChangeEx = strChangeEx;
fa.bKeyDown = bKeyDown;
fa.bWillCommit = FALSE;
fa.bRC = TRUE;
fa.nSelStart = nSelStart;
fa.nSelEnd = nSelEnd;
pFormFiller->GetActionData(pData->pPageView, CPDF_AAction::KeyStroke, fa);
pFormFiller->SaveState(pData->pPageView);
if (pData->pWidget->OnAAction(CPDF_AAction::KeyStroke, fa,
pData->pPageView)) {
if (!IsValidAnnot(pData->pPageView, pData->pWidget)) {
bExit = TRUE;
m_bNotifying = FALSE;
return;
}
if (nAge != pData->pWidget->GetAppearanceAge()) {
CPWL_Wnd* pWnd = pFormFiller->ResetPDFWindow(
pData->pPageView, nValueAge == pData->pWidget->GetValueAge());
pData = (CFFL_PrivateData*)pWnd->GetAttachedData();
bExit = TRUE;
}
if (fa.bRC) {
pFormFiller->SetActionData(pData->pPageView, CPDF_AAction::KeyStroke,
fa);
bRC = FALSE;
} else {
pFormFiller->RestoreState(pData->pPageView);
bRC = FALSE;
}
if (pDocument->GetFocusAnnot() != pData->pWidget) {
pFormFiller->CommitData(pData->pPageView, nFlag);
bExit = TRUE;
}
} else {
if (!IsValidAnnot(pData->pPageView, pData->pWidget)) {
bExit = TRUE;
m_bNotifying = FALSE;
return;
}
}
m_bNotifying = FALSE;
}
}
}