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_FSDK_BASEFORM_H_ | 7 #ifndef FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ |
8 #define FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ | 8 #define FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ |
9 | 9 |
10 #if _FX_OS_ == _FX_ANDROID_ | 10 #if _FX_OS_ == _FX_ANDROID_ |
(...skipping 13 matching lines...) Expand all Loading... |
24 class CFFL_FormFiller; | 24 class CFFL_FormFiller; |
25 class CPDFSDK_Annot; | 25 class CPDFSDK_Annot; |
26 class CPDFSDK_DateTime; | 26 class CPDFSDK_DateTime; |
27 class CPDFSDK_Document; | 27 class CPDFSDK_Document; |
28 class CPDFSDK_InterForm; | 28 class CPDFSDK_InterForm; |
29 class CPDFSDK_PageView; | 29 class CPDFSDK_PageView; |
30 class CPDF_Action; | 30 class CPDF_Action; |
31 class CPDF_FormField; | 31 class CPDF_FormField; |
32 struct CPWL_Color; | 32 struct CPWL_Color; |
33 | 33 |
| 34 #ifdef PDF_ENABLE_XFA |
| 35 typedef enum _PDFSDK_XFAAActionType { |
| 36 PDFSDK_XFA_Click = 0, |
| 37 PDFSDK_XFA_Full, |
| 38 PDFSDK_XFA_PreOpen, |
| 39 PDFSDK_XFA_PostOpen |
| 40 } PDFSDK_XFAAActionType; |
| 41 |
| 42 #endif |
34 typedef struct _PDFSDK_FieldAction { | 43 typedef struct _PDFSDK_FieldAction { |
35 _PDFSDK_FieldAction() { | 44 _PDFSDK_FieldAction() { |
36 bModifier = FALSE; | 45 bModifier = FALSE; |
37 bShift = FALSE; | 46 bShift = FALSE; |
38 nCommitKey = 0; | 47 nCommitKey = 0; |
39 bKeyDown = FALSE; | 48 bKeyDown = FALSE; |
40 nSelEnd = nSelStart = 0; | 49 nSelEnd = nSelStart = 0; |
41 bWillCommit = FALSE; | 50 bWillCommit = FALSE; |
42 bFieldFull = FALSE; | 51 bFieldFull = FALSE; |
43 bRC = TRUE; | 52 bRC = TRUE; |
44 } | 53 } |
45 | 54 |
46 FX_BOOL bModifier; // in | 55 FX_BOOL bModifier; // in |
47 FX_BOOL bShift; // in | 56 FX_BOOL bShift; // in |
48 int nCommitKey; // in | 57 int nCommitKey; // in |
49 CFX_WideString sChange; // in[out] | 58 CFX_WideString sChange; // in[out] |
50 CFX_WideString sChangeEx; // in | 59 CFX_WideString sChangeEx; // in |
51 FX_BOOL bKeyDown; // in | 60 FX_BOOL bKeyDown; // in |
52 int nSelEnd; // in[out] | 61 int nSelEnd; // in[out] |
53 int nSelStart; // in[out] | 62 int nSelStart; // in[out] |
54 CFX_WideString sValue; // in[out] | 63 CFX_WideString sValue; // in[out] |
55 FX_BOOL bWillCommit; // in | 64 FX_BOOL bWillCommit; // in |
56 FX_BOOL bFieldFull; // in | 65 FX_BOOL bFieldFull; // in |
57 FX_BOOL bRC; // in[out] | 66 FX_BOOL bRC; // in[out] |
58 } PDFSDK_FieldAction; | 67 } PDFSDK_FieldAction; |
59 | 68 |
60 class CPDFSDK_Widget : public CPDFSDK_BAAnnot { | 69 class CPDFSDK_Widget : public CPDFSDK_BAAnnot { |
61 public: | 70 public: |
| 71 #ifdef PDF_ENABLE_XFA |
| 72 IXFA_Widget* GetMixXFAWidget() const; |
| 73 IXFA_Widget* GetGroupMixXFAWidget(); |
| 74 IXFA_WidgetHandler* GetXFAWidgetHandler() const; |
| 75 |
| 76 FX_BOOL HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT); |
| 77 FX_BOOL OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, |
| 78 PDFSDK_FieldAction& data, |
| 79 CPDFSDK_PageView* pPageView); |
| 80 |
| 81 void Synchronize(FX_BOOL bSynchronizeElse); |
| 82 void SynchronizeXFAValue(); |
| 83 void SynchronizeXFAItems(); |
| 84 |
| 85 static void SynchronizeXFAValue(IXFA_DocView* pXFADocView, |
| 86 IXFA_Widget* hWidget, |
| 87 CPDF_FormField* pFormField, |
| 88 CPDF_FormControl* pFormControl); |
| 89 static void SynchronizeXFAItems(IXFA_DocView* pXFADocView, |
| 90 IXFA_Widget* hWidget, |
| 91 CPDF_FormField* pFormField, |
| 92 CPDF_FormControl* pFormControl); |
| 93 |
| 94 #endif |
62 CPDFSDK_Widget(CPDF_Annot* pAnnot, | 95 CPDFSDK_Widget(CPDF_Annot* pAnnot, |
63 CPDFSDK_PageView* pPageView, | 96 CPDFSDK_PageView* pPageView, |
64 CPDFSDK_InterForm* pInterForm); | 97 CPDFSDK_InterForm* pInterForm); |
65 ~CPDFSDK_Widget() override; | 98 ~CPDFSDK_Widget() override; |
66 | 99 |
67 // CPDFSDK_Annot | 100 // CPDFSDK_Annot |
68 CFX_ByteString GetSubType() const override; | 101 CFX_ByteString GetSubType() const override; |
69 CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT) override; | 102 CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT) override; |
70 FX_BOOL IsAppearanceValid() override; | 103 FX_BOOL IsAppearanceValid() override; |
71 | 104 |
72 int GetLayoutOrder() const override { return 2; } | 105 int GetLayoutOrder() const override { return 2; } |
73 | 106 |
74 int GetFieldType() const; | 107 int GetFieldType() const; |
75 | 108 |
76 // Possible values from PDF 32000-1:2008, table 221. | 109 // Possible values from PDF 32000-1:2008, table 221. |
77 // FIELDFLAG_READONLY | 110 // FIELDFLAG_READONLY |
78 // FIELDFLAG_REQUIRED | 111 // FIELDFLAG_REQUIRED |
79 // FIELDFLAG_NOEXPORT | 112 // FIELDFLAG_NOEXPORT |
80 int GetFieldFlags() const; | 113 int GetFieldFlags() const; |
81 int GetRotate() const; | 114 int GetRotate() const; |
82 | 115 |
83 FX_BOOL GetFillColor(FX_COLORREF& color) const; | 116 FX_BOOL GetFillColor(FX_COLORREF& color) const; |
84 FX_BOOL GetBorderColor(FX_COLORREF& color) const; | 117 FX_BOOL GetBorderColor(FX_COLORREF& color) const; |
85 FX_BOOL GetTextColor(FX_COLORREF& color) const; | 118 FX_BOOL GetTextColor(FX_COLORREF& color) const; |
86 FX_FLOAT GetFontSize() const; | 119 FX_FLOAT GetFontSize() const; |
87 | 120 |
88 int GetSelectedIndex(int nIndex) const; | 121 int GetSelectedIndex(int nIndex) const; |
| 122 #ifndef PDF_ENABLE_XFA |
89 CFX_WideString GetValue() const; | 123 CFX_WideString GetValue() const; |
| 124 #else |
| 125 CFX_WideString GetValue(FX_BOOL bDisplay = TRUE) const; |
| 126 #endif |
90 CFX_WideString GetDefaultValue() const; | 127 CFX_WideString GetDefaultValue() const; |
91 CFX_WideString GetOptionLabel(int nIndex) const; | 128 CFX_WideString GetOptionLabel(int nIndex) const; |
92 int CountOptions() const; | 129 int CountOptions() const; |
93 FX_BOOL IsOptionSelected(int nIndex) const; | 130 FX_BOOL IsOptionSelected(int nIndex) const; |
94 int GetTopVisibleIndex() const; | 131 int GetTopVisibleIndex() const; |
95 FX_BOOL IsChecked() const; | 132 FX_BOOL IsChecked() const; |
96 /* | 133 /* |
97 BF_ALIGN_LEFT | 134 BF_ALIGN_LEFT |
98 BF_ALIGN_MIDDL | 135 BF_ALIGN_MIDDL |
99 BF_ALIGN_RIGHT | 136 BF_ALIGN_RIGHT |
100 */ | 137 */ |
101 int GetAlignment() const; | 138 int GetAlignment() const; |
102 int GetMaxLen() const; | 139 int GetMaxLen() const; |
| 140 #ifdef PDF_ENABLE_XFA |
| 141 CFX_WideString GetName() const; |
| 142 #endif |
103 CFX_WideString GetAlternateName() const; | 143 CFX_WideString GetAlternateName() const; |
104 | 144 |
105 // Set Properties. | 145 // Set Properties. |
106 void SetCheck(FX_BOOL bChecked, FX_BOOL bNotify); | 146 void SetCheck(FX_BOOL bChecked, FX_BOOL bNotify); |
107 void SetValue(const CFX_WideString& sValue, FX_BOOL bNotify); | 147 void SetValue(const CFX_WideString& sValue, FX_BOOL bNotify); |
108 void SetDefaultValue(const CFX_WideString& sValue); | 148 void SetDefaultValue(const CFX_WideString& sValue); |
109 void SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify); | 149 void SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify); |
110 void ClearSelection(FX_BOOL bNotify); | 150 void ClearSelection(FX_BOOL bNotify); |
111 void SetTopVisibleIndex(int index); | 151 void SetTopVisibleIndex(int index); |
112 | 152 |
| 153 #ifdef PDF_ENABLE_XFA |
| 154 void ResetAppearance(FX_BOOL bValueChanged); |
| 155 #endif |
113 void ResetAppearance(const FX_WCHAR* sValue, FX_BOOL bValueChanged); | 156 void ResetAppearance(const FX_WCHAR* sValue, FX_BOOL bValueChanged); |
114 void ResetFieldAppearance(FX_BOOL bValueChanged); | 157 void ResetFieldAppearance(FX_BOOL bValueChanged); |
115 void UpdateField(); | 158 void UpdateField(); |
116 CFX_WideString OnFormat(FX_BOOL& bFormated); | 159 CFX_WideString OnFormat(FX_BOOL& bFormated); |
117 | 160 |
118 // Message. | 161 // Message. |
119 FX_BOOL OnAAction(CPDF_AAction::AActionType type, | 162 FX_BOOL OnAAction(CPDF_AAction::AActionType type, |
120 PDFSDK_FieldAction& data, | 163 PDFSDK_FieldAction& data, |
121 CPDFSDK_PageView* pPageView); | 164 CPDFSDK_PageView* pPageView); |
122 | 165 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 202 |
160 public: | 203 public: |
161 FX_BOOL IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode); | 204 FX_BOOL IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode); |
162 void DrawAppearance(CFX_RenderDevice* pDevice, | 205 void DrawAppearance(CFX_RenderDevice* pDevice, |
163 const CPDF_Matrix* pUser2Device, | 206 const CPDF_Matrix* pUser2Device, |
164 CPDF_Annot::AppearanceMode mode, | 207 CPDF_Annot::AppearanceMode mode, |
165 const CPDF_RenderOptions* pOptions) override; | 208 const CPDF_RenderOptions* pOptions) override; |
166 | 209 |
167 FX_BOOL HitTest(FX_FLOAT pageX, FX_FLOAT pageY); | 210 FX_BOOL HitTest(FX_FLOAT pageX, FX_FLOAT pageY); |
168 | 211 |
| 212 #ifndef PDF_ENABLE_XFA |
169 private: | 213 private: |
| 214 #endif |
170 CPDFSDK_InterForm* m_pInterForm; | 215 CPDFSDK_InterForm* m_pInterForm; |
171 FX_BOOL m_bAppModified; | 216 FX_BOOL m_bAppModified; |
172 int32_t m_nAppAge; | 217 int32_t m_nAppAge; |
173 int32_t m_nValueAge; | 218 int32_t m_nValueAge; |
| 219 #ifdef PDF_ENABLE_XFA |
| 220 |
| 221 mutable IXFA_Widget* m_hMixXFAWidget; |
| 222 mutable IXFA_WidgetHandler* m_pWidgetHandler; |
| 223 #endif |
174 }; | 224 }; |
175 | 225 |
| 226 #ifdef PDF_ENABLE_XFA |
| 227 class CPDFSDK_XFAWidget : public CPDFSDK_Annot { |
| 228 public: |
| 229 CPDFSDK_XFAWidget(IXFA_Widget* pAnnot, |
| 230 CPDFSDK_PageView* pPageView, |
| 231 CPDFSDK_InterForm* pInterForm); |
| 232 ~CPDFSDK_XFAWidget() override {} |
| 233 |
| 234 FX_BOOL IsXFAField() override; |
| 235 IXFA_Widget* GetXFAWidget() const override { return m_hXFAWidget; } |
| 236 CFX_ByteString GetType() const override; |
| 237 CFX_ByteString GetSubType() const override { return ""; } |
| 238 CFX_FloatRect GetRect() const override; |
| 239 |
| 240 CPDFSDK_InterForm* GetInterForm() { return m_pInterForm; } |
| 241 |
| 242 private: |
| 243 CPDFSDK_InterForm* m_pInterForm; |
| 244 IXFA_Widget* m_hXFAWidget; |
| 245 }; |
| 246 |
| 247 #define CPDFSDK_XFAWidgetMap \ |
| 248 CFX_MapPtrTemplate<IXFA_Widget*, CPDFSDK_XFAWidget*> |
| 249 #define CPDFSDK_FieldSynchronizeMap CFX_MapPtrTemplate<CPDF_FormField*, int> |
| 250 |
| 251 #endif |
176 class CPDFSDK_InterForm : public CPDF_FormNotify { | 252 class CPDFSDK_InterForm : public CPDF_FormNotify { |
177 public: | 253 public: |
178 explicit CPDFSDK_InterForm(CPDFSDK_Document* pDocument); | 254 explicit CPDFSDK_InterForm(CPDFSDK_Document* pDocument); |
179 ~CPDFSDK_InterForm() override; | 255 ~CPDFSDK_InterForm() override; |
180 | 256 |
181 CPDF_InterForm* GetInterForm() const { return m_pInterForm; } | 257 CPDF_InterForm* GetInterForm() const { return m_pInterForm; } |
182 CPDFSDK_Document* GetDocument() const { return m_pDocument; } | 258 CPDFSDK_Document* GetDocument() const { return m_pDocument; } |
183 | 259 |
184 FX_BOOL HighlightWidgets(); | 260 FX_BOOL HighlightWidgets(); |
185 | 261 |
186 CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const; | 262 CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const; |
187 CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const; | 263 CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const; |
188 void GetWidgets(const CFX_WideString& sFieldName, | 264 void GetWidgets(const CFX_WideString& sFieldName, |
189 std::vector<CPDFSDK_Widget*>* widgets) const; | 265 std::vector<CPDFSDK_Widget*>* widgets) const; |
190 void GetWidgets(CPDF_FormField* pField, | 266 void GetWidgets(CPDF_FormField* pField, |
191 std::vector<CPDFSDK_Widget*>* widgets) const; | 267 std::vector<CPDFSDK_Widget*>* widgets) const; |
192 | 268 |
193 void AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget); | 269 void AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget); |
194 void RemoveMap(CPDF_FormControl* pControl); | 270 void RemoveMap(CPDF_FormControl* pControl); |
195 | 271 |
| 272 #ifdef PDF_ENABLE_XFA |
| 273 void AddXFAMap(IXFA_Widget* hWidget, CPDFSDK_XFAWidget* pWidget); |
| 274 void RemoveXFAMap(IXFA_Widget* hWidget); |
| 275 CPDFSDK_XFAWidget* GetXFAWidget(IXFA_Widget* hWidget); |
| 276 |
| 277 #endif |
196 void EnableCalculate(FX_BOOL bEnabled); | 278 void EnableCalculate(FX_BOOL bEnabled); |
197 FX_BOOL IsCalculateEnabled() const; | 279 FX_BOOL IsCalculateEnabled() const; |
198 | 280 |
| 281 #ifdef PDF_ENABLE_XFA |
| 282 void XfaEnableCalculate(FX_BOOL bEnabled); |
| 283 FX_BOOL IsXfaCalculateEnabled() const; |
| 284 |
| 285 FX_BOOL IsXfaValidationsEnabled(); |
| 286 void XfaSetValidationsEnabled(FX_BOOL bEnabled); |
| 287 |
| 288 #endif |
199 #ifdef _WIN32 | 289 #ifdef _WIN32 |
200 CPDF_Stream* LoadImageFromFile(const CFX_WideString& sFile); | 290 CPDF_Stream* LoadImageFromFile(const CFX_WideString& sFile); |
201 #endif | 291 #endif |
202 | 292 |
203 void OnKeyStrokeCommit(CPDF_FormField* pFormField, | 293 void OnKeyStrokeCommit(CPDF_FormField* pFormField, |
204 CFX_WideString& csValue, | 294 CFX_WideString& csValue, |
205 FX_BOOL& bRC); | 295 FX_BOOL& bRC); |
206 void OnValidate(CPDF_FormField* pFormField, | 296 void OnValidate(CPDF_FormField* pFormField, |
207 CFX_WideString& csValue, | 297 CFX_WideString& csValue, |
208 FX_BOOL& bRC); | 298 FX_BOOL& bRC); |
(...skipping 17 matching lines...) Expand all Loading... |
226 const std::vector<CPDF_FormField*>& fields, | 316 const std::vector<CPDF_FormField*>& fields, |
227 FX_BOOL bIncludeOrExclude, | 317 FX_BOOL bIncludeOrExclude, |
228 FX_BOOL bUrlEncoded); | 318 FX_BOOL bUrlEncoded); |
229 FX_BOOL SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded); | 319 FX_BOOL SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded); |
230 FX_BOOL ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf); | 320 FX_BOOL ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf); |
231 FX_BOOL ExportFieldsToFDFTextBuf(const std::vector<CPDF_FormField*>& fields, | 321 FX_BOOL ExportFieldsToFDFTextBuf(const std::vector<CPDF_FormField*>& fields, |
232 FX_BOOL bIncludeOrExclude, | 322 FX_BOOL bIncludeOrExclude, |
233 CFX_ByteTextBuf& textBuf); | 323 CFX_ByteTextBuf& textBuf); |
234 CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt); | 324 CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt); |
235 | 325 |
| 326 #ifdef PDF_ENABLE_XFA |
| 327 void SynchronizeField(CPDF_FormField* pFormField, FX_BOOL bSynchronizeElse); |
| 328 |
| 329 #endif |
236 private: | 330 private: |
237 // CPDF_FormNotify | 331 // CPDF_FormNotify |
238 int BeforeValueChange(const CPDF_FormField* pField, | 332 int BeforeValueChange(const CPDF_FormField* pField, |
239 CFX_WideString& csValue) override; | 333 CFX_WideString& csValue) override; |
240 int AfterValueChange(const CPDF_FormField* pField) override; | 334 int AfterValueChange(const CPDF_FormField* pField) override; |
241 int BeforeSelectionChange(const CPDF_FormField* pField, | 335 int BeforeSelectionChange(const CPDF_FormField* pField, |
242 CFX_WideString& csValue) override; | 336 CFX_WideString& csValue) override; |
243 int AfterSelectionChange(const CPDF_FormField* pField) override; | 337 int AfterSelectionChange(const CPDF_FormField* pField) override; |
244 int AfterCheckedStatusChange(const CPDF_FormField* pField, | 338 int AfterCheckedStatusChange(const CPDF_FormField* pField, |
245 const CFX_ByteArray& statusArray) override; | 339 const CFX_ByteArray& statusArray) override; |
246 int BeforeFormReset(const CPDF_InterForm* pForm) override; | 340 int BeforeFormReset(const CPDF_InterForm* pForm) override; |
247 int AfterFormReset(const CPDF_InterForm* pForm) override; | 341 int AfterFormReset(const CPDF_InterForm* pForm) override; |
248 int BeforeFormImportData(const CPDF_InterForm* pForm) override; | 342 int BeforeFormImportData(const CPDF_InterForm* pForm) override; |
249 int AfterFormImportData(const CPDF_InterForm* pForm) override; | 343 int AfterFormImportData(const CPDF_InterForm* pForm) override; |
250 | 344 |
251 FX_BOOL FDFToURLEncodedData(CFX_WideString csFDFFile, | 345 FX_BOOL FDFToURLEncodedData(CFX_WideString csFDFFile, |
252 CFX_WideString csTxtFile); | 346 CFX_WideString csTxtFile); |
253 FX_BOOL FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize); | 347 FX_BOOL FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize); |
254 int GetPageIndexByAnnotDict(CPDF_Document* pDocument, | 348 int GetPageIndexByAnnotDict(CPDF_Document* pDocument, |
255 CPDF_Dictionary* pAnnotDict) const; | 349 CPDF_Dictionary* pAnnotDict) const; |
256 | 350 |
257 using CPDFSDK_WidgetMap = std::map<CPDF_FormControl*, CPDFSDK_Widget*>; | 351 using CPDFSDK_WidgetMap = std::map<CPDF_FormControl*, CPDFSDK_Widget*>; |
258 | 352 |
259 CPDFSDK_Document* m_pDocument; | 353 CPDFSDK_Document* m_pDocument; |
260 CPDF_InterForm* m_pInterForm; | 354 CPDF_InterForm* m_pInterForm; |
261 CPDFSDK_WidgetMap m_Map; | 355 CPDFSDK_WidgetMap m_Map; |
| 356 #ifdef PDF_ENABLE_XFA |
| 357 CPDFSDK_XFAWidgetMap m_XFAMap; |
| 358 CPDFSDK_FieldSynchronizeMap m_FieldSynchronizeMap; |
| 359 #endif |
262 FX_BOOL m_bCalculate; | 360 FX_BOOL m_bCalculate; |
| 361 #ifdef PDF_ENABLE_XFA |
| 362 FX_BOOL m_bXfaCalculate; |
| 363 FX_BOOL m_bXfaValidationsEnabled; |
| 364 #endif |
263 FX_BOOL m_bBusy; | 365 FX_BOOL m_bBusy; |
264 | 366 |
265 public: | 367 public: |
266 FX_BOOL IsNeedHighLight(int nFieldType); | 368 FX_BOOL IsNeedHighLight(int nFieldType); |
267 void RemoveAllHighLight(); | 369 void RemoveAllHighLight(); |
268 void SetHighlightAlpha(uint8_t alpha) { m_iHighlightAlpha = alpha; } | 370 void SetHighlightAlpha(uint8_t alpha) { m_iHighlightAlpha = alpha; } |
269 uint8_t GetHighlightAlpha() { return m_iHighlightAlpha; } | 371 uint8_t GetHighlightAlpha() { return m_iHighlightAlpha; } |
270 void SetHighlightColor(FX_COLORREF clr, int nFieldType); | 372 void SetHighlightColor(FX_COLORREF clr, int nFieldType); |
271 FX_COLORREF GetHighlightColor(int nFieldType); | 373 FX_COLORREF GetHighlightColor(int nFieldType); |
272 | 374 |
273 private: | 375 private: |
| 376 #ifndef PDF_ENABLE_XFA |
274 static const int kNumFieldTypes = 6; | 377 static const int kNumFieldTypes = 6; |
| 378 #else |
| 379 static const int kNumFieldTypes = 7; |
| 380 #endif |
275 FX_COLORREF m_aHighlightColor[kNumFieldTypes]; | 381 FX_COLORREF m_aHighlightColor[kNumFieldTypes]; |
276 uint8_t m_iHighlightAlpha; | 382 uint8_t m_iHighlightAlpha; |
277 FX_BOOL m_bNeedHightlight[kNumFieldTypes]; | 383 FX_BOOL m_bNeedHightlight[kNumFieldTypes]; |
278 }; | 384 }; |
279 | 385 |
280 #define BAI_STRUCTURE 0 | 386 #define BAI_STRUCTURE 0 |
281 #define BAI_ROW 1 | 387 #define BAI_ROW 1 |
282 #define BAI_COLUMN 2 | 388 #define BAI_COLUMN 2 |
283 | 389 |
284 #define CPDFSDK_Annots CFX_ArrayTemplate<CPDFSDK_Annot*> | 390 #define CPDFSDK_Annots CFX_ArrayTemplate<CPDFSDK_Annot*> |
(...skipping 17 matching lines...) Expand all Loading... |
302 static CPDF_Rect GetAnnotRect(CPDFSDK_Annot* pAnnot); | 408 static CPDF_Rect GetAnnotRect(CPDFSDK_Annot* pAnnot); |
303 | 409 |
304 CPDFSDK_PageView* m_pPageView; | 410 CPDFSDK_PageView* m_pPageView; |
305 CFX_ByteString m_sType; | 411 CFX_ByteString m_sType; |
306 CFX_ByteString m_sSubType; | 412 CFX_ByteString m_sSubType; |
307 int m_nTabs; | 413 int m_nTabs; |
308 CPDFSDK_Annots m_Annots; | 414 CPDFSDK_Annots m_Annots; |
309 }; | 415 }; |
310 | 416 |
311 #endif // FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ | 417 #endif // FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ |
OLD | NEW |