FX_BOOL _SendPostSaveToXFADoc(CPDFXFA_Document* pDocument) { if (!pDocument) return FALSE; if (pDocument->GetDocType() != DOCTYPE_DYNAMIC_XFA && pDocument->GetDocType() != DOCTYPE_STATIC_XFA) return TRUE; IXFA_DocView* pXFADocView = pDocument->GetXFADocView(); if (NULL == pXFADocView) return FALSE; IXFA_WidgetHandler* pWidgetHander = pXFADocView->GetWidgetHandler(); CXFA_WidgetAcc* pWidgetAcc = NULL; IXFA_WidgetAccIterator* pWidgetAccIterator = pXFADocView->CreateWidgetAccIterator(); pWidgetAcc = pWidgetAccIterator->MoveToNext(); while (pWidgetAcc) { CXFA_EventParam preParam; preParam.m_eType = XFA_EVENT_PostSave; pWidgetHander->ProcessEvent(pWidgetAcc, &preParam); pWidgetAcc = pWidgetAccIterator->MoveToNext(); } pWidgetAccIterator->Release(); pXFADocView->UpdateDocView(); pDocument->_ClearChangeMark(); return TRUE; }
void CScript_EventPseudoModel::Script_EventPseudoModel_Emit( CFXJSE_Arguments* pArguments) { IXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { return; } CXFA_EventParam* pEventParam = pScriptContext->GetEventParam(); if (!pEventParam) { return; } IXFA_Notify* pNotify = m_pDocument->GetParser()->GetNotify(); if (!pNotify) { return; } IXFA_WidgetHandler* pWidgetHandler = pNotify->GetWidgetHandler(); if (!pWidgetHandler) { return; } pWidgetHandler->ProcessEvent(pEventParam->m_pTarget, pEventParam); }
FX_BOOL _SendPreSaveToXFADoc(CPDFXFA_Document* pDocument, CFX_PtrArray& fileList) { if (pDocument->GetDocType() != DOCTYPE_DYNAMIC_XFA && pDocument->GetDocType() != DOCTYPE_STATIC_XFA) return TRUE; IXFA_DocView* pXFADocView = pDocument->GetXFADocView(); if (NULL == pXFADocView) return TRUE; IXFA_WidgetHandler* pWidgetHander = pXFADocView->GetWidgetHandler(); CXFA_WidgetAcc* pWidgetAcc = NULL; IXFA_WidgetAccIterator* pWidgetAccIterator = pXFADocView->CreateWidgetAccIterator(); pWidgetAcc = pWidgetAccIterator->MoveToNext(); while (pWidgetAcc) { CXFA_EventParam preParam; preParam.m_eType = XFA_EVENT_PreSave; pWidgetHander->ProcessEvent(pWidgetAcc, &preParam); pWidgetAcc = pWidgetAccIterator->MoveToNext(); } pWidgetAccIterator->Release(); pXFADocView->UpdateDocView(); return _SaveXFADocumentData(pDocument, fileList); }