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 virtual FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView, | 27 virtual FX_BOOL Annot_HitTest(CPDFSDK_PageView* pPageView, |
28 CPDFSDK_Annot* pAnnot, | 28 CPDFSDK_Annot* pAnnot, |
29 CFX_FloatPoint point); | 29 CFX_FloatPoint point); |
30 virtual FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, | 30 virtual FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, |
31 CPDFSDK_Annot* pAnnot); | 31 CPDFSDK_Annot* pAnnot); |
32 virtual void OnDraw(CPDFSDK_PageView* pPageView, | 32 virtual void OnDraw(CPDFSDK_PageView* pPageView, |
33 CPDFSDK_Annot* pAnnot, | 33 CPDFSDK_Annot* pAnnot, |
34 CFX_RenderDevice* pDevice, | 34 CFX_RenderDevice* pDevice, |
35 CFX_Matrix* pUser2Device); | 35 CFX_Matrix* pUser2Device); |
36 | |
37 virtual void OnCreate(CPDFSDK_Annot* pAnnot); | 36 virtual void OnCreate(CPDFSDK_Annot* pAnnot); |
38 virtual void OnLoad(CPDFSDK_Annot* pAnnot); | 37 virtual void OnLoad(CPDFSDK_Annot* pAnnot); |
39 virtual void OnDelete(CPDFSDK_Annot* pAnnot); | 38 virtual void OnDelete(CPDFSDK_Annot* pAnnot); |
40 | 39 |
41 virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, | 40 virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, |
42 CPDFSDK_Annot* pAnnot, | 41 CPDFSDK_Annot::ObservedPtr& pAnnot, |
43 uint32_t nFlag); | 42 uint32_t nFlag); |
44 virtual void OnMouseExit(CPDFSDK_PageView* pPageView, | 43 virtual void OnMouseExit(CPDFSDK_PageView* pPageView, |
45 CPDFSDK_Annot* pAnnot, | 44 CPDFSDK_Annot::ObservedPtr& pAnnot, |
46 uint32_t nFlag); | 45 uint32_t nFlag); |
47 | |
48 virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, | 46 virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, |
49 CPDFSDK_Annot* pAnnot, | 47 CPDFSDK_Annot::ObservedPtr& pAnnot, |
50 uint32_t nFlags, | 48 uint32_t nFlags, |
51 const CFX_FloatPoint& point); | 49 const CFX_FloatPoint& point); |
52 virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, | 50 virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, |
53 CPDFSDK_Annot* pAnnot, | 51 CPDFSDK_Annot::ObservedPtr& pAnnot, |
54 uint32_t nFlags, | 52 uint32_t nFlags, |
55 const CFX_FloatPoint& point); | 53 const CFX_FloatPoint& point); |
56 virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, | 54 virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, |
57 CPDFSDK_Annot* pAnnot, | 55 CPDFSDK_Annot::ObservedPtr& pAnnot, |
58 uint32_t nFlags, | 56 uint32_t nFlags, |
59 const CFX_FloatPoint& point); | 57 const CFX_FloatPoint& point); |
60 virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, | 58 virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, |
61 CPDFSDK_Annot* pAnnot, | 59 CPDFSDK_Annot::ObservedPtr& pAnnot, |
62 uint32_t nFlags, | 60 uint32_t nFlags, |
63 const CFX_FloatPoint& point); | 61 const CFX_FloatPoint& point); |
64 virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, | 62 virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, |
65 CPDFSDK_Annot* pAnnot, | 63 CPDFSDK_Annot::ObservedPtr& pAnnot, |
66 uint32_t nFlags, | 64 uint32_t nFlags, |
67 short zDelta, | 65 short zDelta, |
68 const CFX_FloatPoint& point); | 66 const CFX_FloatPoint& point); |
69 virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, | 67 virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, |
70 CPDFSDK_Annot* pAnnot, | 68 CPDFSDK_Annot::ObservedPtr& pAnnot, |
71 uint32_t nFlags, | 69 uint32_t nFlags, |
72 const CFX_FloatPoint& point); | 70 const CFX_FloatPoint& point); |
73 virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, | 71 virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, |
74 CPDFSDK_Annot* pAnnot, | 72 CPDFSDK_Annot::ObservedPtr& pAnnot, |
75 uint32_t nFlags, | 73 uint32_t nFlags, |
76 const CFX_FloatPoint& point); | 74 const CFX_FloatPoint& point); |
77 | 75 |
78 virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, | 76 virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, |
79 uint32_t nKeyCode, | 77 uint32_t nKeyCode, |
80 uint32_t nFlags); | 78 uint32_t nFlags); |
81 virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, | 79 virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, |
82 uint32_t nChar, | 80 uint32_t nChar, |
83 uint32_t nFlags); | 81 uint32_t nFlags); |
84 | 82 |
85 virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag); | 83 virtual FX_BOOL OnSetFocus(CPDFSDK_Annot::ObservedPtr& pAnnot, |
86 virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, uint32_t nFlag); | 84 uint32_t nFlag); |
| 85 virtual FX_BOOL OnKillFocus(CPDFSDK_Annot::ObservedPtr& pAnnot, |
| 86 uint32_t nFlag); |
87 | 87 |
88 CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister); | 88 CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister); |
89 void RemoveFormFiller(CPDFSDK_Annot* pAnnot); | 89 void RemoveFormFiller(CPDFSDK_Annot* pAnnot); |
90 | 90 |
91 static FX_BOOL IsVisible(CPDFSDK_Widget* pWidget); | 91 static FX_BOOL IsVisible(CPDFSDK_Widget* pWidget); |
92 static FX_BOOL IsReadOnly(CPDFSDK_Widget* pWidget); | 92 static FX_BOOL IsReadOnly(CPDFSDK_Widget* pWidget); |
93 static FX_BOOL IsFillingAllowed(CPDFSDK_Widget* pWidget); | 93 static FX_BOOL IsFillingAllowed(CPDFSDK_Widget* pWidget); |
94 static FX_BOOL IsValidAnnot(CPDFSDK_PageView* pPageView, | 94 static FX_BOOL IsValidAnnot(CPDFSDK_PageView* pPageView, |
95 CPDFSDK_Annot* pAnnot); | 95 CPDFSDK_Annot* pAnnot); |
96 | 96 |
97 void OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, | 97 void OnKeyStrokeCommit(CPDFSDK_Annot::ObservedPtr& pWidget, |
98 CPDFSDK_PageView* pPageView, | 98 CPDFSDK_PageView* pPageView, |
99 FX_BOOL& bRC, | 99 FX_BOOL& bRC, |
100 FX_BOOL& bExit, | 100 FX_BOOL& bExit, |
101 uint32_t nFlag); | 101 uint32_t nFlag); |
102 void OnValidate(CPDFSDK_Widget* pWidget, | 102 void OnValidate(CPDFSDK_Annot::ObservedPtr& pWidget, |
103 CPDFSDK_PageView* pPageView, | 103 CPDFSDK_PageView* pPageView, |
104 FX_BOOL& bRC, | 104 FX_BOOL& bRC, |
105 FX_BOOL& bExit, | 105 FX_BOOL& bExit, |
106 uint32_t nFlag); | 106 uint32_t nFlag); |
107 | 107 |
108 void OnCalculate(CPDFSDK_Widget* pWidget, | 108 void OnCalculate(CPDFSDK_Widget* pWidget, |
109 CPDFSDK_PageView* pPageView, | 109 CPDFSDK_PageView* pPageView, |
110 FX_BOOL& bExit, | 110 FX_BOOL& bExit, |
111 uint32_t nFlag); | 111 uint32_t nFlag); |
112 void OnFormat(CPDFSDK_Widget* pWidget, | 112 void OnFormat(CPDFSDK_Widget* pWidget, |
113 CPDFSDK_PageView* pPageView, | 113 CPDFSDK_PageView* pPageView, |
114 FX_BOOL& bExit, | 114 FX_BOOL& bExit, |
115 uint32_t nFlag); | 115 uint32_t nFlag); |
116 void OnButtonUp(CPDFSDK_Widget* pWidget, | 116 void OnButtonUp(CPDFSDK_Annot::ObservedPtr& pWidget, |
117 CPDFSDK_PageView* pPageView, | 117 CPDFSDK_PageView* pPageView, |
118 FX_BOOL& bReset, | 118 FX_BOOL& bReset, |
119 FX_BOOL& bExit, | 119 FX_BOOL& bExit, |
120 uint32_t nFlag); | 120 uint32_t nFlag); |
121 #ifdef PDF_ENABLE_XFA | 121 #ifdef PDF_ENABLE_XFA |
122 void OnClick(CPDFSDK_Widget* pWidget, | 122 void OnClick(CPDFSDK_Widget* pWidget, |
123 CPDFSDK_PageView* pPageView, | 123 CPDFSDK_PageView* pPageView, |
124 FX_BOOL& bReset, | 124 FX_BOOL& bReset, |
125 FX_BOOL& bExit, | 125 FX_BOOL& bExit, |
126 uint32_t nFlag); | 126 uint32_t nFlag); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 class CFFL_PrivateData { | 181 class CFFL_PrivateData { |
182 public: | 182 public: |
183 CPDFSDK_Widget* pWidget; | 183 CPDFSDK_Widget* pWidget; |
184 CPDFSDK_PageView* pPageView; | 184 CPDFSDK_PageView* pPageView; |
185 int nWidgetAge; | 185 int nWidgetAge; |
186 int nValueAge; | 186 int nValueAge; |
187 }; | 187 }; |
188 | 188 |
189 #endif // FPDFSDK_FORMFILLER_CFFL_INTERACTIVEFORMFILLER_H_ | 189 #endif // FPDFSDK_FORMFILLER_CFFL_INTERACTIVEFORMFILLER_H_ |
OLD | NEW |