| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_IFORMFILLER_H_ | 7 #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_IFORMFILLER_H_ |
| 8 #define FPDFSDK_INCLUDE_FORMFILLER_FFL_IFORMFILLER_H_ | 8 #define FPDFSDK_INCLUDE_FORMFILLER_FFL_IFORMFILLER_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 virtual void OnMouseEnter(CPDFSDK_PageView *p
PageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag); | 34 virtual void OnMouseEnter(CPDFSDK_PageView *p
PageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag); |
| 35 virtual void OnMouseExit(CPDFSDK_PageView *pP
ageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag); | 35 virtual void OnMouseExit(CPDFSDK_PageView *pP
ageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlag); |
| 36 | 36 |
| 37 virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *
pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); | 37 virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *
pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); |
| 38 virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pP
ageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); | 38 virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pP
ageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); |
| 39 virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView
*pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); | 39 virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView
*pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); |
| 40 virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pP
ageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); | 40 virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pP
ageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); |
| 41 virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView *p
PageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point&
point); | 41 virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView *p
PageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, short zDelta, const CPDF_Point&
point); |
| 42 virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *
pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); | 42 virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *
pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); |
| 43 virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pP
ageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); | 43 virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pP
ageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); |
| 44 virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView
*pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); | |
| 45 | 44 |
| 46 virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot,
FX_UINT nKeyCode, FX_UINT nFlags); | 45 virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot,
FX_UINT nKeyCode, FX_UINT nFlags); |
| 47 virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX
_UINT nChar, FX_UINT nFlags); | 46 virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX
_UINT nChar, FX_UINT nFlags); |
| 48 | 47 |
| 49 virtual void OnDeSelected(CPDFSDK_Annot* pAnn
ot); | |
| 50 virtual void OnSelected(CPDFSDK_Annot* pAnnot
); | |
| 51 | |
| 52 virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot
,FX_UINT nFlag); | 48 virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot
,FX_UINT nFlag); |
| 53 virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnno
t, FX_UINT nFlag); | 49 virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnno
t, FX_UINT nFlag); |
| 54 | 50 |
| 55 virtual void QueryWherePopup(void* pPrivateDa
ta, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, int32_t & nRet, FX_FLOAT & fPopupRet)
; | 51 virtual void QueryWherePopup(void* pPrivateDa
ta, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, int32_t & nRet, FX_FLOAT & fPopupRet)
; |
| 56 virtual void OnBeforeKeyStroke(FX_BOOL bEditO
rList, void* pPrivateData, int32_t nKeyCode, | 52 virtual void OnBeforeKeyStroke(FX_BOOL bEditO
rList, void* pPrivateData, int32_t nKeyCode, |
| 57
CFX_WideString & strChange, const CFX_WideString& strChangeEx, | 53
CFX_WideString & strChange, const CFX_WideString& strChangeEx, |
| 58
int nSelStart, int nSelEnd, | 54
int nSelStart, int nSelEnd, |
| 59
FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag); | 55
FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag); |
| 60 virtual void OnAfterKeyStroke(FX_BOOL bEditOr
List, void* pPrivateData, FX_BOOL & bExit, FX_DWORD nFlag) ; | 56 virtual void OnAfterKeyStroke(FX_BOOL bEditOr
List, void* pPrivateData, FX_BOOL & bExit, FX_DWORD nFlag) ; |
| 61 | 57 |
| 62 virtual void OnSetWindowRect(void* pPrivateDa
ta, const CPDF_Rect & rcWindow); | |
| 63 virtual void OnKeyStroke(FX_BOOL bEditOrList,
void* pPrivateData, int32_t nKeyCode, CFX_WideString & strChange, | |
| 64 const CF
X_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit); | |
| 65 | |
| 66 virtual void BeforeUndo(CPDFSDK_Document* pDo
cument); | |
| 67 virtual void BeforeRedo(CPDFSDK_Document* pDo
cument); | |
| 68 virtual void AfterUndo(CPDFSDK_Document* pDoc
ument); | |
| 69 virtual void AfterRedo(CPDFSDK_Document* pDoc
ument); | |
| 70 | |
| 71 virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocum
ent); | |
| 72 virtual FX_BOOL CanCut(CPDFSDK_Document* pDocume
nt); | |
| 73 virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocu
ment); | |
| 74 | |
| 75 virtual void DoCopy(CPDFSDK_Document* pDocume
nt); | |
| 76 virtual void DoCut(CPDFSDK_Document* pDocumen
t); | |
| 77 virtual void DoPaste(CPDFSDK_Document* pDocum
ent); | |
| 78 | |
| 79 CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAn
not, FX_BOOL bRegister); | 58 CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAn
not, FX_BOOL bRegister); |
| 80 void RemoveFormFiller(CPDFSDK
_Annot* pAnnot); | 59 void RemoveFormFiller(CPDFSDK
_Annot* pAnnot); |
| 81 | 60 |
| 82 static FX_BOOL IsVisible(CPDFSDK_Widget* pWidge
t); | 61 static FX_BOOL IsVisible(CPDFSDK_Widget* pWidge
t); |
| 83 static FX_BOOL IsReadOnly(CPDFSDK_Widget* pWidg
et); | 62 static FX_BOOL IsReadOnly(CPDFSDK_Widget* pWidg
et); |
| 84 static FX_BOOL IsFillingAllowed(CPDFSDK_Widget*
pWidget); | 63 static FX_BOOL IsFillingAllowed(CPDFSDK_Widget*
pWidget); |
| 85 static FX_BOOL IsValidAnnot(CPDFSDK_PageView* p
PageView, CPDFSDK_Annot* pAnnot); | 64 static FX_BOOL IsValidAnnot(CPDFSDK_PageView* p
PageView, CPDFSDK_Annot* pAnnot); |
| 86 | 65 |
| 87 void OnKeyStrokeCommit(CPDFSD
K_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX
_DWORD nFlag); | 66 void OnKeyStrokeCommit(CPDFSD
K_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX
_DWORD nFlag); |
| 88 void OnValidate(CPDFSDK_Widge
t* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD
nFlag); | 67 void OnValidate(CPDFSDK_Widge
t* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD
nFlag); |
| 89 | 68 |
| 90 void OnCalculate(CPDFSDK_Widg
et* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag); | 69 void OnCalculate(CPDFSDK_Widg
et* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag); |
| 91 void OnFormat(CPDFSDK_Widget*
pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag); | 70 void OnFormat(CPDFSDK_Widget*
pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bExit, FX_DWORD nFlag); |
| 92 void OnButtonUp(CPDFSDK_Widge
t* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bReset, FX_BOOL& bExit,FX_UINT
nFlag); | 71 void OnButtonUp(CPDFSDK_Widge
t* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bReset, FX_BOOL& bExit,FX_UINT
nFlag); |
| 93 | 72 |
| 94 private: | 73 private: |
| 95 using CFFL_Widget2Filler = std::map<CPDFSDK_Annot*, CFFL_FormFiller*>; | 74 using CFFL_Widget2Filler = std::map<CPDFSDK_Annot*, CFFL_FormFiller*>; |
| 96 | 75 |
| 97 void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot); | 76 void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot); |
| 98 void SetFocusAnnotTab(CPDFSDK_Annot* pWidget, FX_BOOL bSameField, | |
| 99 FX_BOOL bNext); | |
| 100 | 77 |
| 101 CPDFDoc_Environment* m_pApp; | 78 CPDFDoc_Environment* m_pApp; |
| 102 CFFL_Widget2Filler m_Maps; | 79 CFFL_Widget2Filler m_Maps; |
| 103 FX_BOOL m_bNotifying; | 80 FX_BOOL m_bNotifying; |
| 104 }; | 81 }; |
| 105 | 82 |
| 106 class CFFL_PrivateData | 83 class CFFL_PrivateData |
| 107 { | 84 { |
| 108 public: | 85 public: |
| 109 CPDFSDK_Widget* pWidget; | 86 CPDFSDK_Widget* pWidget; |
| 110 CPDFSDK_PageView* pPageView; | 87 CPDFSDK_PageView* pPageView; |
| 111 int nWidgetAge; | 88 int nWidgetAge; |
| 112 int nValueAge; | 89 int nValueAge; |
| 113 }; | 90 }; |
| 114 | 91 |
| 115 #endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_IFORMFILLER_H_ | 92 #endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_IFORMFILLER_H_ |
| 116 | 93 |
| OLD | NEW |