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_FORMFILLER_H_ | 7 #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_FORMFILLER_H_ |
8 #define FPDFSDK_INCLUDE_FORMFILLER_FFL_FORMFILLER_H_ | 8 #define FPDFSDK_INCLUDE_FORMFILLER_FFL_FORMFILLER_H_ |
9 | 9 |
10 #include "fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h" | 10 #include "fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 virtual void OnCreate(CPDFSDK_Annot* pAnnot); | 38 virtual void OnCreate(CPDFSDK_Annot* pAnnot); |
39 virtual void OnLoad(CPDFSDK_Annot* pAnnot); | 39 virtual void OnLoad(CPDFSDK_Annot* pAnnot); |
40 virtual void OnDelete(CPDFSDK_Annot* pAnnot); | 40 virtual void OnDelete(CPDFSDK_Annot* pAnnot); |
41 | 41 |
42 virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot); | 42 virtual void OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot); |
43 virtual void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot); | 43 virtual void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot); |
44 | 44 |
45 virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, | 45 virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, |
46 CPDFSDK_Annot* pAnnot, | 46 CPDFSDK_Annot* pAnnot, |
47 FX_UINT nFlags, | 47 FX_UINT nFlags, |
48 const CPDF_Point& point); | 48 const CFX_FloatPoint& point); |
49 virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, | 49 virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, |
50 CPDFSDK_Annot* pAnnot, | 50 CPDFSDK_Annot* pAnnot, |
51 FX_UINT nFlags, | 51 FX_UINT nFlags, |
52 const CPDF_Point& point); | 52 const CFX_FloatPoint& point); |
53 virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, | 53 virtual FX_BOOL OnLButtonDblClk(CPDFSDK_PageView* pPageView, |
54 CPDFSDK_Annot* pAnnot, | 54 CPDFSDK_Annot* pAnnot, |
55 FX_UINT nFlags, | 55 FX_UINT nFlags, |
56 const CPDF_Point& point); | 56 const CFX_FloatPoint& point); |
57 virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, | 57 virtual FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, |
58 CPDFSDK_Annot* pAnnot, | 58 CPDFSDK_Annot* pAnnot, |
59 FX_UINT nFlags, | 59 FX_UINT nFlags, |
60 const CPDF_Point& point); | 60 const CFX_FloatPoint& point); |
61 virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, | 61 virtual FX_BOOL OnMouseWheel(CPDFSDK_PageView* pPageView, |
62 CPDFSDK_Annot* pAnnot, | 62 CPDFSDK_Annot* pAnnot, |
63 FX_UINT nFlags, | 63 FX_UINT nFlags, |
64 short zDelta, | 64 short zDelta, |
65 const CPDF_Point& point); | 65 const CFX_FloatPoint& point); |
66 virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, | 66 virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView* pPageView, |
67 CPDFSDK_Annot* pAnnot, | 67 CPDFSDK_Annot* pAnnot, |
68 FX_UINT nFlags, | 68 FX_UINT nFlags, |
69 const CPDF_Point& point); | 69 const CFX_FloatPoint& point); |
70 virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, | 70 virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView* pPageView, |
71 CPDFSDK_Annot* pAnnot, | 71 CPDFSDK_Annot* pAnnot, |
72 FX_UINT nFlags, | 72 FX_UINT nFlags, |
73 const CPDF_Point& point); | 73 const CFX_FloatPoint& point); |
74 | 74 |
75 virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, | 75 virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, |
76 FX_UINT nKeyCode, | 76 FX_UINT nKeyCode, |
77 FX_UINT nFlags); | 77 FX_UINT nFlags); |
78 virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags); | 78 virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags); |
79 | 79 |
80 void SetFocusForAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); | 80 void SetFocusForAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); |
81 void KillFocusForAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); | 81 void KillFocusForAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); |
82 | 82 |
83 // CPWL_TimerHandler | 83 // CPWL_TimerHandler |
(...skipping 15 matching lines...) Expand all Loading... |
99 const PDFSDK_FieldAction& faNew); | 99 const PDFSDK_FieldAction& faNew); |
100 | 100 |
101 virtual void SaveState(CPDFSDK_PageView* pPageView); | 101 virtual void SaveState(CPDFSDK_PageView* pPageView); |
102 virtual void RestoreState(CPDFSDK_PageView* pPageView); | 102 virtual void RestoreState(CPDFSDK_PageView* pPageView); |
103 | 103 |
104 virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, | 104 virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, |
105 FX_BOOL bRestoreValue); | 105 FX_BOOL bRestoreValue); |
106 | 106 |
107 CFX_Matrix GetCurMatrix(); | 107 CFX_Matrix GetCurMatrix(); |
108 | 108 |
109 CPDF_Rect FFLtoPWL(const CPDF_Rect& rect); | 109 CFX_FloatRect FFLtoPWL(const CFX_FloatRect& rect); |
110 CPDF_Rect PWLtoFFL(const CPDF_Rect& rect); | 110 CFX_FloatRect PWLtoFFL(const CFX_FloatRect& rect); |
111 CPDF_Point FFLtoPWL(const CPDF_Point& point); | 111 CFX_FloatPoint FFLtoPWL(const CFX_FloatPoint& point); |
112 CPDF_Point PWLtoFFL(const CPDF_Point& point); | 112 CFX_FloatPoint PWLtoFFL(const CFX_FloatPoint& point); |
113 | 113 |
114 CPDF_Point WndtoPWL(CPDFSDK_PageView* pPageView, const CPDF_Point& pt); | 114 CFX_FloatPoint WndtoPWL(CPDFSDK_PageView* pPageView, |
115 CPDF_Rect FFLtoWnd(CPDFSDK_PageView* pPageView, const CPDF_Rect& rect); | 115 const CFX_FloatPoint& pt); |
| 116 CFX_FloatRect FFLtoWnd(CPDFSDK_PageView* pPageView, |
| 117 const CFX_FloatRect& rect); |
116 | 118 |
117 void SetWindowRect(CPDFSDK_PageView* pPageView, const CPDF_Rect& rcWindow); | 119 void SetWindowRect(CPDFSDK_PageView* pPageView, |
118 CPDF_Rect GetWindowRect(CPDFSDK_PageView* pPageView); | 120 const CFX_FloatRect& rcWindow); |
| 121 CFX_FloatRect GetWindowRect(CPDFSDK_PageView* pPageView); |
119 | 122 |
120 FX_BOOL CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag); | 123 FX_BOOL CommitData(CPDFSDK_PageView* pPageView, FX_UINT nFlag); |
121 virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView); | 124 virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView); |
122 virtual void SaveData(CPDFSDK_PageView* pPageView); | 125 virtual void SaveData(CPDFSDK_PageView* pPageView); |
123 | 126 |
124 #ifdef PDF_ENABLE_XFA | 127 #ifdef PDF_ENABLE_XFA |
125 virtual FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView); | 128 virtual FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView); |
126 #endif // PDF_ENABLE_XFA | 129 #endif // PDF_ENABLE_XFA |
127 | 130 |
128 CPWL_Wnd* GetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bNew); | 131 CPWL_Wnd* GetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bNew); |
129 void DestroyPDFWindow(CPDFSDK_PageView* pPageView); | 132 void DestroyPDFWindow(CPDFSDK_PageView* pPageView); |
130 void EscapeFiller(CPDFSDK_PageView* pPageView, FX_BOOL bDestroyPDFWindow); | 133 void EscapeFiller(CPDFSDK_PageView* pPageView, FX_BOOL bDestroyPDFWindow); |
131 | 134 |
132 virtual PWL_CREATEPARAM GetCreateParam(); | 135 virtual PWL_CREATEPARAM GetCreateParam(); |
133 virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, | 136 virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, |
134 CPDFSDK_PageView* pPageView) = 0; | 137 CPDFSDK_PageView* pPageView) = 0; |
135 virtual CPDF_Rect GetFocusBox(CPDFSDK_PageView* pPageView); | 138 virtual CFX_FloatRect GetFocusBox(CPDFSDK_PageView* pPageView); |
136 | 139 |
137 FX_BOOL IsValid() const; | 140 FX_BOOL IsValid() const; |
138 CPDF_Rect GetPDFWindowRect() const; | 141 CFX_FloatRect GetPDFWindowRect() const; |
139 | 142 |
140 CPDFSDK_PageView* GetCurPageView(); | 143 CPDFSDK_PageView* GetCurPageView(); |
141 void SetChangeMark(); | 144 void SetChangeMark(); |
142 | 145 |
143 virtual void InvalidateRect(double left, | 146 virtual void InvalidateRect(double left, |
144 double top, | 147 double top, |
145 double right, | 148 double right, |
146 double bottom); | 149 double bottom); |
147 CPDFDoc_Environment* GetApp() { return m_pApp; } | 150 CPDFDoc_Environment* GetApp() { return m_pApp; } |
148 CPDFSDK_Annot* GetSDKAnnot() { return m_pAnnot; } | 151 CPDFSDK_Annot* GetSDKAnnot() { return m_pAnnot; } |
149 | 152 |
150 protected: | 153 protected: |
151 using CFFL_PageView2PDFWindow = std::map<CPDFSDK_PageView*, CPWL_Wnd*>; | 154 using CFFL_PageView2PDFWindow = std::map<CPDFSDK_PageView*, CPWL_Wnd*>; |
152 | 155 |
153 CPDFDoc_Environment* m_pApp; | 156 CPDFDoc_Environment* m_pApp; |
154 CPDFSDK_Widget* m_pWidget; | 157 CPDFSDK_Widget* m_pWidget; |
155 CPDFSDK_Annot* m_pAnnot; | 158 CPDFSDK_Annot* m_pAnnot; |
156 | 159 |
157 FX_BOOL m_bValid; | 160 FX_BOOL m_bValid; |
158 CFFL_PageView2PDFWindow m_Maps; | 161 CFFL_PageView2PDFWindow m_Maps; |
159 CPDF_Point m_ptOldPos; | 162 CFX_FloatPoint m_ptOldPos; |
160 }; | 163 }; |
161 | 164 |
162 class CFFL_Button : public CFFL_FormFiller { | 165 class CFFL_Button : public CFFL_FormFiller { |
163 public: | 166 public: |
164 CFFL_Button(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget); | 167 CFFL_Button(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget); |
165 ~CFFL_Button() override; | 168 ~CFFL_Button() override; |
166 | 169 |
167 // CFFL_FormFiller | 170 // CFFL_FormFiller |
168 void OnMouseEnter(CPDFSDK_PageView* pPageView, | 171 void OnMouseEnter(CPDFSDK_PageView* pPageView, |
169 CPDFSDK_Annot* pAnnot) override; | 172 CPDFSDK_Annot* pAnnot) override; |
170 void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) override; | 173 void OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot) override; |
171 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, | 174 FX_BOOL OnLButtonDown(CPDFSDK_PageView* pPageView, |
172 CPDFSDK_Annot* pAnnot, | 175 CPDFSDK_Annot* pAnnot, |
173 FX_UINT nFlags, | 176 FX_UINT nFlags, |
174 const CPDF_Point& point) override; | 177 const CFX_FloatPoint& point) override; |
175 FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, | 178 FX_BOOL OnLButtonUp(CPDFSDK_PageView* pPageView, |
176 CPDFSDK_Annot* pAnnot, | 179 CPDFSDK_Annot* pAnnot, |
177 FX_UINT nFlags, | 180 FX_UINT nFlags, |
178 const CPDF_Point& point) override; | 181 const CFX_FloatPoint& point) override; |
179 FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, | 182 FX_BOOL OnMouseMove(CPDFSDK_PageView* pPageView, |
180 CPDFSDK_Annot* pAnnot, | 183 CPDFSDK_Annot* pAnnot, |
181 FX_UINT nFlags, | 184 FX_UINT nFlags, |
182 const CPDF_Point& point) override; | 185 const CFX_FloatPoint& point) override; |
183 void OnDraw(CPDFSDK_PageView* pPageView, | 186 void OnDraw(CPDFSDK_PageView* pPageView, |
184 CPDFSDK_Annot* pAnnot, | 187 CPDFSDK_Annot* pAnnot, |
185 CFX_RenderDevice* pDevice, | 188 CFX_RenderDevice* pDevice, |
186 CFX_Matrix* pUser2Device, | 189 CFX_Matrix* pUser2Device, |
187 FX_DWORD dwFlags) override; | 190 FX_DWORD dwFlags) override; |
188 void OnDrawDeactive(CPDFSDK_PageView* pPageView, | 191 void OnDrawDeactive(CPDFSDK_PageView* pPageView, |
189 CPDFSDK_Annot* pAnnot, | 192 CPDFSDK_Annot* pAnnot, |
190 CFX_RenderDevice* pDevice, | 193 CFX_RenderDevice* pDevice, |
191 CFX_Matrix* pUser2Device, | 194 CFX_Matrix* pUser2Device, |
192 FX_DWORD dwFlags) override; | 195 FX_DWORD dwFlags) override; |
193 | 196 |
194 protected: | 197 protected: |
195 FX_BOOL m_bMouseIn; | 198 FX_BOOL m_bMouseIn; |
196 FX_BOOL m_bMouseDown; | 199 FX_BOOL m_bMouseDown; |
197 }; | 200 }; |
198 | 201 |
199 #endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_FORMFILLER_H_ | 202 #endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_FORMFILLER_H_ |
OLD | NEW |