| 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_FORMFILLER_CFFL_INTERACTIVEFORMFILLER_H_ | 7 #ifndef FPDFSDK_FORMFILLER_CFFL_INTERACTIVEFORMFILLER_H_ |
| 8 #define FPDFSDK_FORMFILLER_CFFL_INTERACTIVEFORMFILLER_H_ | 8 #define FPDFSDK_FORMFILLER_CFFL_INTERACTIVEFORMFILLER_H_ |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "fpdfsdk/include/cpdfsdk_annot.h" |
| 13 #include "fpdfsdk/include/fsdk_define.h" | 14 #include "fpdfsdk/include/fsdk_define.h" |
| 14 #include "fpdfsdk/pdfwindow/PWL_Edit.h" | 15 #include "fpdfsdk/pdfwindow/PWL_Edit.h" |
| 15 | 16 |
| 16 class CFFL_FormFiller; | 17 class CFFL_FormFiller; |
| 17 class CPDFSDK_Environment; | 18 class CPDFSDK_Environment; |
| 18 class CPDFSDK_Annot; | |
| 19 class CPDFSDK_PageView; | 19 class CPDFSDK_PageView; |
| 20 class CPDFSDK_Widget; | 20 class CPDFSDK_Widget; |
| 21 | 21 |
| 22 class CFFL_InteractiveFormFiller : public IPWL_Filler_Notify { | 22 class CFFL_InteractiveFormFiller : public IPWL_Filler_Notify { |
| 23 public: | 23 public: |
| 24 explicit CFFL_InteractiveFormFiller(CPDFSDK_Environment* pEnv); | 24 explicit CFFL_InteractiveFormFiller(CPDFSDK_Environment* pEnv); |
| 25 ~CFFL_InteractiveFormFiller() override; | 25 ~CFFL_InteractiveFormFiller() override; |
| 26 | 26 |
| 27 FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView, | 27 FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView, |
| 28 CPDFSDK_Annot* pAnnot, | 28 CPDFSDK_Annot* pAnnot, |
| 29 CFX_FloatPoint point); | 29 CFX_FloatPoint point); |
| 30 FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot); | 30 FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot); |
| 31 void OnDraw(CPDFSDK_PageView* pPageView, | 31 void OnDraw(CPDFSDK_PageView* pPageView, |
| 32 CPDFSDK_Annot* pAnnot, | 32 CPDFSDK_Annot* pAnnot, |
| 33 CFX_RenderDevice* pDevice, | 33 CFX_RenderDevice* pDevice, |
| 34 CFX_Matrix* pUser2Device); | 34 CFX_Matrix* pUser2Device); |
| 35 | 35 |
| 36 void OnCreate(CPDFSDK_Annot* pAnnot); | 36 void OnCreate(CPDFSDK_Annot* pAnnot); |
| 37 void OnLoad(CPDFSDK_Annot* pAnnot); | 37 void OnLoad(CPDFSDK_Annot* pAnnot); |
| 38 void OnDelete(CPDFSDK_Annot* pAnnot); | 38 void OnDelete(CPDFSDK_Annot* pAnnot); |
| 39 | 39 |
| 40 void OnMouseEnter(CPDFSDK_PageView* pPageView, | 40 void OnMouseEnter(CPDFSDK_PageView* pPageView, |
| 41 CPDFSDK_Annot* pAnnot, | 41 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 42 uint32_t nFlag); | 42 uint32_t nFlag); |
| 43 void OnMouseExit(CPDFSDK_PageView* pPageView, | 43 void OnMouseExit(CPDFSDK_PageView* pPageView, |
| 44 CPDFSDK_Annot* pAnnot, | 44 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 45 uint32_t nFlag); | 45 uint32_t nFlag); |
| 46 | |
| 47 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, | 46 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, |
| 48 CPDFSDK_Annot* pAnnot, | 47 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 49 uint32_t nFlags, | 48 uint32_t nFlags, |
| 50 const CFX_FloatPoint& point); | 49 const CFX_FloatPoint& point); |
| 51 FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, | 50 FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, |
| 52 CPDFSDK_Annot* pAnnot, | 51 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 53 uint32_t nFlags, | 52 uint32_t nFlags, |
| 54 const CFX_FloatPoint& point); | 53 const CFX_FloatPoint& point); |
| 55 FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, | 54 FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, |
| 56 CPDFSDK_Annot* pAnnot, | 55 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 57 uint32_t nFlags, | 56 uint32_t nFlags, |
| 58 const CFX_FloatPoint& point); | 57 const CFX_FloatPoint& point); |
| 59 FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, | 58 FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, |
| 60 CPDFSDK_Annot* pAnnot, | 59 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 61 uint32_t nFlags, | 60 uint32_t nFlags, |
| 62 const CFX_FloatPoint& point); | 61 const CFX_FloatPoint& point); |
| 63 FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, | 62 FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, |
| 64 CPDFSDK_Annot* pAnnot, | 63 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 65 uint32_t nFlags, | 64 uint32_t nFlags, |
| 66 short zDelta, | 65 short zDelta, |
| 67 const CFX_FloatPoint& point); | 66 const CFX_FloatPoint& point); |
| 68 FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, | 67 FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, |
| 69 CPDFSDK_Annot* pAnnot, | 68 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 70 uint32_t nFlags, | 69 uint32_t nFlags, |
| 71 const CFX_FloatPoint& point); | 70 const CFX_FloatPoint& point); |
| 72 FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, | 71 FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, |
| 73 CPDFSDK_Annot* pAnnot, | 72 CPDFSDK_Annot::ObservedPtr* pAnnot, |
| 74 uint32_t nFlags, | 73 uint32_t nFlags, |
| 75 const CFX_FloatPoint& point); | 74 const CFX_FloatPoint& point); |
| 76 | 75 |
| 77 FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, uint32_t nKeyCode, uint32_t nFlags); | 76 FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, uint32_t nKeyCode, uint32_t nFlags); |
| 78 FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags); | 77 FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags); |
| 79 | 78 |
| 80 FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag); | 79 FX_BOOL OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag); |
| 81 FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag); | 80 FX_BOOL OnKillFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlag); |
| 82 | 81 |
| 83 CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister); | 82 CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister); |
| 84 void RemoveFormFiller(CPDFSDK_Annot* pAnnot); | 83 void RemoveFormFiller(CPDFSDK_Annot* pAnnot); |
| 85 | 84 |
| 86 static FX_BOOL IsVisible(CPDFSDK_Widget* pWidget); | 85 static FX_BOOL IsVisible(CPDFSDK_Widget* pWidget); |
| 87 static FX_BOOL IsReadOnly(CPDFSDK_Widget* pWidget); | 86 static FX_BOOL IsReadOnly(CPDFSDK_Widget* pWidget); |
| 88 static FX_BOOL IsFillingAllowed(CPDFSDK_Widget* pWidget); | 87 static FX_BOOL IsFillingAllowed(CPDFSDK_Widget* pWidget); |
| 89 static FX_BOOL IsValidAnnot(CPDFSDK_PageView* pPageView, | 88 static FX_BOOL IsValidAnnot(CPDFSDK_PageView* pPageView, |
| 90 CPDFSDK_Annot* pAnnot); | 89 CPDFSDK_Annot* pAnnot); |
| 91 | 90 |
| 92 void OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, | 91 void OnKeyStrokeCommit(CPDFSDK_Annot::ObservedPtr* pWidget, |
| 93 CPDFSDK_PageView* pPageView, | 92 CPDFSDK_PageView* pPageView, |
| 94 FX_BOOL& bRC, | 93 FX_BOOL& bRC, |
| 95 FX_BOOL& bExit, | 94 FX_BOOL& bExit, |
| 96 uint32_t nFlag); | 95 uint32_t nFlag); |
| 97 void OnValidate(CPDFSDK_Widget* pWidget, | 96 void OnValidate(CPDFSDK_Annot::ObservedPtr* pWidget, |
| 98 CPDFSDK_PageView* pPageView, | 97 CPDFSDK_PageView* pPageView, |
| 99 FX_BOOL& bRC, | 98 FX_BOOL& bRC, |
| 100 FX_BOOL& bExit, | 99 FX_BOOL& bExit, |
| 101 uint32_t nFlag); | 100 uint32_t nFlag); |
| 102 | 101 |
| 103 void OnCalculate(CPDFSDK_Widget* pWidget, | 102 void OnCalculate(CPDFSDK_Widget* pWidget, |
| 104 CPDFSDK_PageView* pPageView, | 103 CPDFSDK_PageView* pPageView, |
| 105 FX_BOOL& bExit, | 104 FX_BOOL& bExit, |
| 106 uint32_t nFlag); | 105 uint32_t nFlag); |
| 107 void OnFormat(CPDFSDK_Widget* pWidget, | 106 void OnFormat(CPDFSDK_Widget* pWidget, |
| 108 CPDFSDK_PageView* pPageView, | 107 CPDFSDK_PageView* pPageView, |
| 109 FX_BOOL& bExit, | 108 FX_BOOL& bExit, |
| 110 uint32_t nFlag); | 109 uint32_t nFlag); |
| 111 void OnButtonUp(CPDFSDK_Widget* pWidget, | 110 void OnButtonUp(CPDFSDK_Annot::ObservedPtr* pWidget, |
| 112 CPDFSDK_PageView* pPageView, | 111 CPDFSDK_PageView* pPageView, |
| 113 FX_BOOL& bReset, | 112 FX_BOOL& bReset, |
| 114 FX_BOOL& bExit, | 113 FX_BOOL& bExit, |
| 115 uint32_t nFlag); | 114 uint32_t nFlag); |
| 116 #ifdef PDF_ENABLE_XFA | 115 #ifdef PDF_ENABLE_XFA |
| 117 void OnClick(CPDFSDK_Widget* pWidget, | 116 void OnClick(CPDFSDK_Widget* pWidget, |
| 118 CPDFSDK_PageView* pPageView, | 117 CPDFSDK_PageView* pPageView, |
| 119 FX_BOOL& bReset, | 118 FX_BOOL& bReset, |
| 120 FX_BOOL& bExit, | 119 FX_BOOL& bExit, |
| 121 uint32_t nFlag); | 120 uint32_t nFlag); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 174 |
| 176 class CFFL_PrivateData { | 175 class CFFL_PrivateData { |
| 177 public: | 176 public: |
| 178 CPDFSDK_Widget* pWidget; | 177 CPDFSDK_Widget* pWidget; |
| 179 CPDFSDK_PageView* pPageView; | 178 CPDFSDK_PageView* pPageView; |
| 180 int nWidgetAge; | 179 int nWidgetAge; |
| 181 int nValueAge; | 180 int nValueAge; |
| 182 }; | 181 }; |
| 183 | 182 |
| 184 #endif // FPDFSDK_FORMFILLER_CFFL_INTERACTIVEFORMFILLER_H_ | 183 #endif // FPDFSDK_FORMFILLER_CFFL_INTERACTIVEFORMFILLER_H_ |
| OLD | NEW |