| 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> |
| 11 | 11 |
| 12 #include "FormFiller.h" | 12 #include "FormFiller.h" |
| 13 | 13 |
| 14 class CFFL_FormFiller; | 14 class CFFL_FormFiller; |
| 15 class CFFL_PrivateData; | 15 class CFFL_PrivateData; |
| 16 | 16 |
| 17 class CFFL_IFormFiller : public IPWL_Filler_Notify { | 17 class CFFL_IFormFiller : public IPWL_Filler_Notify { |
| 18 public: | 18 public: |
| 19 CFFL_IFormFiller(CPDFDoc_Environment* pApp); | 19 explicit CFFL_IFormFiller(CPDFDoc_Environment* pApp); |
| 20 virtual ~CFFL_IFormFiller(); | 20 ~CFFL_IFormFiller() override; |
| 21 | 21 |
| 22 virtual FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView, | 22 virtual FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView, |
| 23 CPDFSDK_Annot* pAnnot, | 23 CPDFSDK_Annot* pAnnot, |
| 24 CPDF_Point point); | 24 CPDF_Point point); |
| 25 virtual FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, | 25 virtual FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, |
| 26 CPDFSDK_Annot* pAnnot); | 26 CPDFSDK_Annot* pAnnot); |
| 27 virtual void OnDraw(CPDFSDK_PageView* pPageView, | 27 virtual void OnDraw(CPDFSDK_PageView* pPageView, |
| 28 /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, | 28 CPDFSDK_Annot* pAnnot, |
| 29 CFX_RenderDevice* pDevice, | 29 CFX_RenderDevice* pDevice, |
| 30 CPDF_Matrix* pUser2Device, | 30 CPDF_Matrix* pUser2Device, |
| 31 /*const CRect& rcWindow,*/ FX_DWORD dwFlags); | 31 FX_DWORD dwFlags); |
| 32 | 32 |
| 33 virtual void OnCreate(CPDFSDK_Annot* pAnnot); | 33 virtual void OnCreate(CPDFSDK_Annot* pAnnot); |
| 34 virtual void OnLoad(CPDFSDK_Annot* pAnnot); | 34 virtual void OnLoad(CPDFSDK_Annot* pAnnot); |
| 35 virtual void OnDelete(CPDFSDK_Annot* pAnnot); | 35 virtual void OnDelete(CPDFSDK_Annot* pAnnot); |
| 36 | 36 |
| 37 virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, | 37 virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, |
| 38 CPDFSDK_Annot* pAnnot, | 38 CPDFSDK_Annot* pAnnot, |
| 39 FX_UINT nFlag); | 39 FX_UINT nFlag); |
| 40 virtual void OnMouseExit(CPDFSDK_PageView* pPageView, | 40 virtual void OnMouseExit(CPDFSDK_PageView* pPageView, |
| 41 CPDFSDK_Annot* pAnnot, | 41 CPDFSDK_Annot* pAnnot, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 72 const CPDF_Point& point); | 72 const CPDF_Point& point); |
| 73 | 73 |
| 74 virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, | 74 virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, |
| 75 FX_UINT nKeyCode, | 75 FX_UINT nKeyCode, |
| 76 FX_UINT nFlags); | 76 FX_UINT nFlags); |
| 77 virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags); | 77 virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags); |
| 78 | 78 |
| 79 virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); | 79 virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); |
| 80 virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); | 80 virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); |
| 81 | 81 |
| 82 virtual void QueryWherePopup(void* pPrivateData, | |
| 83 FX_FLOAT fPopupMin, | |
| 84 FX_FLOAT fPopupMax, | |
| 85 int32_t& nRet, | |
| 86 FX_FLOAT& fPopupRet); | |
| 87 virtual void OnBeforeKeyStroke(FX_BOOL bEditOrList, | |
| 88 void* pPrivateData, | |
| 89 int32_t nKeyCode, | |
| 90 CFX_WideString& strChange, | |
| 91 const CFX_WideString& strChangeEx, | |
| 92 int nSelStart, | |
| 93 int nSelEnd, | |
| 94 FX_BOOL bKeyDown, | |
| 95 FX_BOOL& bRC, | |
| 96 FX_BOOL& bExit, | |
| 97 FX_DWORD nFlag); | |
| 98 virtual void OnAfterKeyStroke(FX_BOOL bEditOrList, | |
| 99 void* pPrivateData, | |
| 100 FX_BOOL& bExit, | |
| 101 FX_DWORD nFlag); | |
| 102 | |
| 103 virtual void OnPopupPreOpen(void* pPrivateData, | 82 virtual void OnPopupPreOpen(void* pPrivateData, |
| 104 FX_BOOL& bExit, | 83 FX_BOOL& bExit, |
| 105 FX_DWORD nFlag); | 84 FX_DWORD nFlag); |
| 106 virtual void OnPopupPostOpen(void* pPrivateData, | 85 virtual void OnPopupPostOpen(void* pPrivateData, |
| 107 FX_BOOL& bExit, | 86 FX_BOOL& bExit, |
| 108 FX_DWORD nFlag); | 87 FX_DWORD nFlag); |
| 109 | 88 |
| 110 CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister); | 89 CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister); |
| 111 void RemoveFormFiller(CPDFSDK_Annot* pAnnot); | 90 void RemoveFormFiller(CPDFSDK_Annot* pAnnot); |
| 112 | 91 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 FX_UINT nFlag); | 136 FX_UINT nFlag); |
| 158 void OnPostOpen(CPDFSDK_Widget* pWidget, | 137 void OnPostOpen(CPDFSDK_Widget* pWidget, |
| 159 CPDFSDK_PageView* pPageView, | 138 CPDFSDK_PageView* pPageView, |
| 160 FX_BOOL& bReset, | 139 FX_BOOL& bReset, |
| 161 FX_BOOL& bExit, | 140 FX_BOOL& bExit, |
| 162 FX_UINT nFlag); | 141 FX_UINT nFlag); |
| 163 | 142 |
| 164 private: | 143 private: |
| 165 using CFFL_Widget2Filler = std::map<CPDFSDK_Annot*, CFFL_FormFiller*>; | 144 using CFFL_Widget2Filler = std::map<CPDFSDK_Annot*, CFFL_FormFiller*>; |
| 166 | 145 |
| 146 // IPWL_Filler_Notify: |
| 147 void QueryWherePopup(void* pPrivateData, |
| 148 FX_FLOAT fPopupMin, |
| 149 FX_FLOAT fPopupMax, |
| 150 int32_t& nRet, |
| 151 FX_FLOAT& fPopupRet) override; |
| 152 void OnBeforeKeyStroke(FX_BOOL bEditOrList, |
| 153 void* pPrivateData, |
| 154 int32_t nKeyCode, |
| 155 CFX_WideString& strChange, |
| 156 const CFX_WideString& strChangeEx, |
| 157 int nSelStart, |
| 158 int nSelEnd, |
| 159 FX_BOOL bKeyDown, |
| 160 FX_BOOL& bRC, |
| 161 FX_BOOL& bExit, |
| 162 FX_DWORD nFlag) override; |
| 163 void OnAfterKeyStroke(FX_BOOL bEditOrList, |
| 164 void* pPrivateData, |
| 165 FX_BOOL& bExit, |
| 166 FX_DWORD nFlag) override; |
| 167 |
| 167 void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot); | 168 void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot); |
| 168 void SetFocusAnnotTab(CPDFSDK_Annot* pWidget, | 169 void SetFocusAnnotTab(CPDFSDK_Annot* pWidget, |
| 169 FX_BOOL bSameField, | 170 FX_BOOL bSameField, |
| 170 FX_BOOL bNext); | 171 FX_BOOL bNext); |
| 171 | 172 |
| 172 CPDFDoc_Environment* m_pApp; | 173 CPDFDoc_Environment* m_pApp; |
| 173 CFFL_Widget2Filler m_Maps; | 174 CFFL_Widget2Filler m_Maps; |
| 174 FX_BOOL m_bNotifying; | 175 FX_BOOL m_bNotifying; |
| 175 }; | 176 }; |
| 176 | 177 |
| 177 class CFFL_PrivateData { | 178 class CFFL_PrivateData { |
| 178 public: | 179 public: |
| 179 CPDFSDK_Widget* pWidget; | 180 CPDFSDK_Widget* pWidget; |
| 180 CPDFSDK_PageView* pPageView; | 181 CPDFSDK_PageView* pPageView; |
| 181 int nWidgetAge; | 182 int nWidgetAge; |
| 182 int nValueAge; | 183 int nValueAge; |
| 183 }; | 184 }; |
| 184 | 185 |
| 185 #endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_IFORMFILLER_H_ | 186 #endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_IFORMFILLER_H_ |
| OLD | NEW |