void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag) { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); if (!m_bNotifying) { CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; if (pWidget->GetAAction(CPDF_AAction::CursorExit).GetDict()) { m_bNotifying = TRUE; pWidget->GetAppearanceAge(); int nValueAge = pWidget->GetValueAge(); pWidget->ClearAppModified(); ASSERT(pPageView); PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); pWidget->OnAAction(CPDF_AAction::CursorExit, fa, pPageView); m_bNotifying = FALSE; if (pWidget->IsAppModified()) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) { pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge()); } } } } if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { pFormFiller->OnMouseExit(pPageView, pAnnot); } }
void CFFL_InteractiveFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag) { ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); if (!m_bNotifying) { CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get()); if (pWidget->GetAAction(CPDF_AAction::kCursorExit).GetDict()) { m_bNotifying = true; uint32_t nValueAge = pWidget->GetValueAge(); pWidget->ClearAppModified(); ASSERT(pPageView); CPDFSDK_FieldAction fa; fa.bModifier = CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(nFlag); fa.bShift = CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(nFlag); pWidget->OnAAction(CPDF_AAction::kCursorExit, &fa, pPageView); m_bNotifying = false; if (!pAnnot->HasObservable()) return; if (pWidget->IsAppModified()) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false)) { pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge()); } } } } if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false)) pFormFiller->OnMouseExit(pPageView, pAnnot->Get()); }
FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag) { if(!pAnnot) return FALSE; ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); if (!m_bNotifying) { CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; if (pWidget->GetAAction(CPDF_AAction::GetFocus)) { m_bNotifying = TRUE; pWidget->GetAppearanceAge(); int nValueAge = pWidget->GetValueAge(); pWidget->ClearAppModified(); CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); ASSERT(pPageView != NULL); PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, TRUE); if(!pFormFiller) return FALSE; pFormFiller->GetActionData(pPageView, CPDF_AAction::GetFocus, fa); pWidget->OnAAction(CPDF_AAction::GetFocus, fa, pPageView); m_bNotifying = FALSE; // if (!IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pAnnot)) return FALSE; if (pWidget->IsAppModified()) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) { pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge()); } } } } if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE)) { if (pFormFiller->OnSetFocus(pAnnot, nFlag)) { return TRUE; } else return FALSE; } return TRUE; }
void CFFL_InteractiveFormFiller::OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, const CFX_Matrix& mtUser2Device) { ASSERT(pPageView); CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot); if (!IsVisible(pWidget)) return; CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false); if (pFormFiller && pFormFiller->IsValid()) { pFormFiller->OnDraw(pPageView, pAnnot, pDevice, mtUser2Device); pAnnot->GetPDFPage(); if (m_pFormFillEnv->GetFocusAnnot() != pAnnot) return; CFX_FloatRect rcFocus = pFormFiller->GetFocusBox(pPageView); if (rcFocus.IsEmpty()) return; CFX_PathData path; path.AppendPoint(CFX_PointF(rcFocus.left, rcFocus.top), FXPT_TYPE::MoveTo, false); path.AppendPoint(CFX_PointF(rcFocus.left, rcFocus.bottom), FXPT_TYPE::LineTo, false); path.AppendPoint(CFX_PointF(rcFocus.right, rcFocus.bottom), FXPT_TYPE::LineTo, false); path.AppendPoint(CFX_PointF(rcFocus.right, rcFocus.top), FXPT_TYPE::LineTo, false); path.AppendPoint(CFX_PointF(rcFocus.left, rcFocus.top), FXPT_TYPE::LineTo, false); CFX_GraphStateData gsd; gsd.m_DashArray = {1.0f}; gsd.m_DashPhase = 0; gsd.m_LineWidth = 1.0f; pDevice->DrawPath(&path, &mtUser2Device, &gsd, 0, ArgbEncode(255, 0, 0, 0), FXFILL_ALTERNATE); return; } pFormFiller = GetFormFiller(pAnnot, false); if (pFormFiller) { pFormFiller->OnDrawDeactive(pPageView, pAnnot, pDevice, mtUser2Device); } else { pWidget->DrawAppearance(pDevice, mtUser2Device, CPDF_Annot::Normal, nullptr); } if (!IsReadOnly(pWidget) && IsFillingAllowed(pWidget)) pWidget->DrawShadow(pDevice, pPageView); }
void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, /*const CRect& rcWindow,*/ FX_DWORD dwFlags) { ASSERT(pPageView != NULL); CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; if (IsVisible(pWidget)) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { if (pFormFiller->IsValid()) { pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); pAnnot->GetPDFPage(); CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument(); if (pDocument->GetFocusAnnot() == pAnnot) { CPDF_Rect rcFocus = pFormFiller->GetFocusBox(pPageView); if (!rcFocus.IsEmpty()) { CFX_PathData path; path.SetPointCount(5); path.SetPoint(0, rcFocus.left, rcFocus.top, FXPT_MOVETO); path.SetPoint(1, rcFocus.left, rcFocus.bottom, FXPT_LINETO); path.SetPoint(2, rcFocus.right, rcFocus.bottom, FXPT_LINETO); path.SetPoint(3, rcFocus.right, rcFocus.top, FXPT_LINETO); path.SetPoint(4, rcFocus.left, rcFocus.top, FXPT_LINETO); CFX_GraphStateData gsd; gsd.SetDashCount(1); gsd.m_DashArray[0] = 1.0f; gsd.m_DashPhase = 0; gsd.m_LineWidth = 1.0f; pDevice->DrawPath(&path, pUser2Device, &gsd, 0, ArgbEncode(255, 0, 0, 0), FXFILL_ALTERNATE); } } return; } } if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) pFormFiller->OnDrawDeactive(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); else pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL); if (!IsReadOnly(pWidget) && IsFillingAllowed(pWidget)) pWidget->DrawShadow(pDevice, pPageView); } }
void CFFL_IFormFiller::OnPostOpen(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bReset, FX_BOOL& bExit, FX_UINT nFlag) { if (!m_bNotifying) { if (pWidget->HasXFAAAction(PDFSDK_XFA_PostOpen)) { m_bNotifying = TRUE; int nAge = pWidget->GetAppearanceAge(); int nValueAge = pWidget->GetValueAge(); PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); pWidget->OnXFAAAction(PDFSDK_XFA_PostOpen, fa, pPageView); m_bNotifying = FALSE; if (!IsValidAnnot(pPageView, pWidget)) { bExit = TRUE; return; } if (nAge != pWidget->GetAppearanceAge()) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) { pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge()); } bReset = TRUE; } } } }
void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag) { if (!m_bNotifying) { if (pWidget->GetAAction(CPDF_AAction::Validate).GetDict()) { m_bNotifying = TRUE; pWidget->ClearAppModified(); ASSERT(pPageView); PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); fa.bKeyDown = TRUE; fa.bRC = TRUE; CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE); pFormFiller->GetActionData(pPageView, CPDF_AAction::Validate, fa); pFormFiller->SaveState(pPageView); PDFSDK_FieldAction faOld = fa; pWidget->OnAAction(CPDF_AAction::Validate, fa, pPageView); bRC = fa.bRC; m_bNotifying = FALSE; } } }
FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { return pFormFiller->GetViewBBox(pPageView, pAnnot); } else { ASSERT(pPageView != NULL); ASSERT(pAnnot != NULL); CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); ASSERT(pPDFAnnot != NULL); CPDF_Rect rcAnnot; pPDFAnnot->GetRect(rcAnnot); // CRect rcWin; // pPageView->DocToWindow(rcAnnot, rcWin); CPDF_Rect rcWin = CPWL_Utils::InflateRect(rcAnnot,1); // rcWin.InflateRect(1, 1); return rcWin.GetOutterRect(); } }
FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument(); switch (pWidget->GetFieldType()) { case FIELDTYPE_PUSHBUTTON: case FIELDTYPE_CHECKBOX: case FIELDTYPE_RADIOBUTTON: if (GetViewBBox(pPageView, pAnnot).Contains((int)point.x, (int)point.y)) pDocument->SetFocusAnnot(pAnnot); break; default: pDocument->SetFocusAnnot(pAnnot); break; } FX_BOOL bRet = FALSE; if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { bRet = pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point); } if (pDocument->GetFocusAnnot() == pAnnot) { FX_BOOL bExit = FALSE; FX_BOOL bReset = FALSE; OnButtonUp(pWidget, pPageView, bReset, bExit, nFlags); if (bExit) return TRUE; } return bRet; }
bool CFFL_InteractiveFormFiller::OnPostOpen(CPDFSDK_Annot::ObservedPtr* pAnnot, CPDFSDK_PageView* pPageView, uint32_t nFlag) { if (m_bNotifying) return false; CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get()); if (!pWidget->HasXFAAAction(PDFSDK_XFA_PostOpen)) return false; m_bNotifying = true; uint32_t nAge = pWidget->GetAppearanceAge(); uint32_t nValueAge = pWidget->GetValueAge(); CPDFSDK_FieldAction fa; fa.bModifier = CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(nFlag); fa.bShift = CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(nFlag); pWidget->OnXFAAAction(PDFSDK_XFA_PostOpen, &fa, pPageView); m_bNotifying = false; if (!pAnnot->HasObservable() || !IsValidAnnot(pPageView, pWidget)) return true; if (nAge == pWidget->GetAppearanceAge()) return false; if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false)) pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge()); return true; }
FX_BOOL CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) { if (!pAnnot) return FALSE; ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { pFormFiller->KillFocusForAnnot(pAnnot, nFlag); if (!m_bNotifying) { CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; if (pWidget->GetAAction(CPDF_AAction::LoseFocus)) { m_bNotifying = TRUE; pWidget->ClearAppModified(); CPDFSDK_PageView* pPageView = pWidget->GetPageView(); ASSERT(pPageView != NULL); PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa); pWidget->OnAAction(CPDF_AAction::LoseFocus, fa, pPageView); m_bNotifying = FALSE; } } } return TRUE; }
bool CFFL_InteractiveFormFiller::OnValidate(CPDFSDK_Annot::ObservedPtr* pAnnot, CPDFSDK_PageView* pPageView, uint32_t nFlag) { if (m_bNotifying) return true; CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get()); if (!pWidget->GetAAction(CPDF_AAction::kValidate).GetDict()) return true; ASSERT(pPageView); m_bNotifying = true; pWidget->ClearAppModified(); CPDFSDK_FieldAction fa; fa.bModifier = CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(nFlag); fa.bShift = CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(nFlag); fa.bKeyDown = true; fa.bRC = true; CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, false); pFormFiller->GetActionData(pPageView, CPDF_AAction::kValidate, fa); pFormFiller->SaveState(pPageView); pWidget->OnAAction(CPDF_AAction::kValidate, &fa, pPageView); if (!pAnnot->HasObservable()) return true; m_bNotifying = false; return fa.bRC; }
bool CFFL_InteractiveFormFiller::OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag) { if (!pAnnot->HasObservable()) return false; ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false); if (!pFormFiller) return true; pFormFiller->KillFocusForAnnot(pAnnot->Get(), nFlag); if (!pAnnot->HasObservable()) return false; if (m_bNotifying) return true; CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot->Get()); if (!pWidget->GetAAction(CPDF_AAction::kLoseFocus).GetDict()) return true; m_bNotifying = true; pWidget->ClearAppModified(); CPDFSDK_PageView* pPageView = pWidget->GetPageView(); ASSERT(pPageView); CPDFSDK_FieldAction fa; fa.bModifier = CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(nFlag); fa.bShift = CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(nFlag); pFormFiller->GetActionData(pPageView, CPDF_AAction::kLoseFocus, fa); pWidget->OnAAction(CPDF_AAction::kLoseFocus, &fa, pPageView); m_bNotifying = false; return pAnnot->HasObservable(); }
void CFFL_IFormFiller::OnDelete(CPDFSDK_Annot* pAnnot) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { pFormFiller->OnDelete(pAnnot); } UnRegisterFormFiller(pAnnot); }
void CFFL_IFormFiller::OnLoad(CPDFSDK_Annot* pAnnot) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { pFormFiller->OnLoad(pAnnot); } }
bool CFFL_InteractiveFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, uint32_t nKeyCode, uint32_t nFlags) { ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false); return pFormFiller && pFormFiller->OnKeyDown(pAnnot, nKeyCode, nFlags); }
void CFFL_InteractiveFormFiller::ReplaceSelection(CPDFSDK_Annot* pAnnot, const WideString& text) { ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false); if (!pFormFiller) return; pFormFiller->ReplaceSelection(pAnnot, text); }
bool CFFL_InteractiveFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, const CFX_PointF& point) { ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false); return pFormFiller && pFormFiller->OnRButtonUp(pPageView, pAnnot->Get(), nFlags, point); }
FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); if (!m_bNotifying) { CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; if (Annot_HitTest(pPageView, pAnnot, point) && pWidget->GetAAction(CPDF_AAction::ButtonDown)) { m_bNotifying = TRUE; pWidget->GetAppearanceAge(); int nValueAge = pWidget->GetValueAge(); pWidget->ClearAppModified(); ASSERT(pPageView != NULL); PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlags); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlags); pWidget->OnAAction(CPDF_AAction::ButtonDown, fa, pPageView); m_bNotifying = FALSE; if (!IsValidAnnot(pPageView, pAnnot)) return TRUE; if (pWidget->IsAppModified()) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) { pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge()); } } } } if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { return pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point); } return FALSE; }
void CFFL_IFormFiller::OnSelected(CPDFSDK_Annot* pAnnot) { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { pFormFiller->OnSelected(pAnnot); } }
bool CFFL_InteractiveFormFiller::OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) { ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); if (nChar == FWL_VKEY_Tab) return true; CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false); return pFormFiller && pFormFiller->OnChar(pAnnot, nChar, nFlags); }
FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) { if (!pAnnot) return FALSE; ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); if (!m_bNotifying) { CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; if (pWidget->GetAAction(CPDF_AAction::GetFocus).GetDict()) { m_bNotifying = TRUE; pWidget->GetAppearanceAge(); int nValueAge = pWidget->GetValueAge(); pWidget->ClearAppModified(); CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); ASSERT(pPageView); PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, TRUE); if (!pFormFiller) return FALSE; pFormFiller->GetActionData(pPageView, CPDF_AAction::GetFocus, fa); pWidget->OnAAction(CPDF_AAction::GetFocus, fa, pPageView); m_bNotifying = FALSE; if (pWidget->IsAppModified()) { if (CFFL_FormFiller* pFiller = GetFormFiller(pWidget, FALSE)) { pFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge()); } } } } if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE)) pFormFiller->SetFocusForAnnot(pAnnot, nFlag); return TRUE; }
FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) return pFormFiller->GetViewBBox(pPageView, pAnnot); ASSERT(pPageView); CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); CFX_FloatRect rcWin = CPWL_Utils::InflateRect(pPDFAnnot->GetRect(), 1); return rcWin.GetOuterRect(); }
FX_BOOL CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags) { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { return pFormFiller->OnKeyDown(pAnnot, nKeyCode, nFlags); } return FALSE; }
FX_BOOL CFFL_IFormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) { ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); if (nChar == FWL_VKEY_Tab) return TRUE; if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) return pFormFiller->OnChar(pAnnot, nChar, nFlags); return FALSE; }
FX_BOOL CFFL_IFormFiller::OnRButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { return pFormFiller->OnRButtonDblClk(pPageView, pAnnot, nFlags, point); } return FALSE; }
void CFFL_IFormFiller::OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, 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 (!bEditOrList) pFormFiller->OnKeyStroke(bExit); }
FX_BOOL CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CFX_FloatPoint& point) { ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { return pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point); } return FALSE; }
void CFFL_IFormFiller::OnKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_INT32 nKeyCode, CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit) { ASSERT(pPrivateData != NULL); CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; ASSERT(pData->pWidget != NULL); CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE); ASSERT(pFormFiller != NULL); pFormFiller->OnKeyStroke(bKeyDown); }
FX_BOOL CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); //change cursor if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE)) { return pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point); } return FALSE; }