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 typedef struct _PDFSDK_FieldAction | 34 typedef struct _PDFSDK_FieldAction { |
35 { | 35 _PDFSDK_FieldAction() { |
36 » _PDFSDK_FieldAction() | 36 bModifier = FALSE; |
37 » { | 37 bShift = FALSE; |
38 » » bModifier = FALSE; | 38 nCommitKey = 0; |
39 » » bShift = FALSE; | 39 bKeyDown = FALSE; |
40 » » nCommitKey = 0; | 40 nSelEnd = nSelStart = 0; |
41 » » bKeyDown = FALSE; | 41 bWillCommit = FALSE; |
42 » » nSelEnd = nSelStart = 0; | 42 bFieldFull = FALSE; |
43 » » bWillCommit = FALSE; | 43 bRC = TRUE; |
44 » » bFieldFull = FALSE; | 44 } |
45 » » bRC = TRUE; | 45 |
46 » } | 46 FX_BOOL bModifier; // in |
47 | 47 FX_BOOL bShift; // in |
48 » FX_BOOL»» » » » bModifier;» » //in | 48 int nCommitKey; // in |
49 » FX_BOOL»» » » » bShift;»» » //in | 49 CFX_WideString sChange; // in[out] |
50 » int» » » » » » nCommitKey;» »
//in | 50 CFX_WideString sChangeEx; // in |
51 » CFX_WideString» » » sChange;» » //in[out] | 51 FX_BOOL bKeyDown; // in |
52 » CFX_WideString» » » sChangeEx;» » //in | 52 int nSelEnd; // in[out] |
53 » FX_BOOL»» » » » bKeyDown;» » //in | 53 int nSelStart; // in[out] |
54 » int» » » » » » nSelEnd;» »
//in[out] | 54 CFX_WideString sValue; // in[out] |
55 » int» » » » » » nSelStart;» »
//in[out] | 55 FX_BOOL bWillCommit; // in |
56 » CFX_WideString» » » sValue;»» » //in[out] | 56 FX_BOOL bFieldFull; // in |
57 » FX_BOOL»» » » » bWillCommit;» //in | 57 FX_BOOL bRC; // in[out] |
58 » FX_BOOL»» » » » bFieldFull;» » //in | 58 } PDFSDK_FieldAction; |
59 » FX_BOOL»» » » » bRC;» » » //in[out
] | 59 class CPDFSDK_Widget : public CPDFSDK_Annot { |
60 }PDFSDK_FieldAction; | 60 public: |
61 class CPDFSDK_Widget : public CPDFSDK_Annot | 61 CPDFSDK_Widget(CPDF_Annot* pAnnot, |
62 { | 62 CPDFSDK_PageView* pPageView, |
63 public: | 63 CPDFSDK_InterForm* pInterForm); |
64 » CPDFSDK_Widget(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView, CPDFSDK_
InterForm* pInterForm); | 64 virtual ~CPDFSDK_Widget(); |
65 » virtual ~CPDFSDK_Widget(); | 65 |
66 | 66 virtual CFX_ByteString GetSubType() const; |
67 » virtual CFX_ByteString» » » GetSubType() const; | 67 |
68 | 68 virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT); |
69 » virtual CPDF_Action» » » » GetAAction(CPDF_AAction:
:AActionType eAAT); | 69 |
70 | 70 int GetFieldType() const; |
71 » int» » » » » » » » GetField
Type() const; | 71 // define layout order to 2. |
72 » //define layout order to 2. | 72 virtual int GetLayoutOrder() const { return 2; } |
73 » virtual int» » » » » » GetLayoutOrder()
const {return 2;} | 73 /* |
74 » /* | 74 FIELDFLAG_READONLY |
75 » FIELDFLAG_READONLY | 75 FIELDFLAG_REQUIRED |
76 » FIELDFLAG_REQUIRED | 76 FIELDFLAG_NOEXPORT |
77 » FIELDFLAG_NOEXPORT | 77 */ |
78 » */ | 78 |
79 | 79 int GetFieldFlags() const; |
80 » int» » » » » » » » GetField
Flags() const; | 80 int GetRotate() const; |
81 » int» » » » » » » » GetRotat
e() const; | 81 |
82 | 82 FX_BOOL GetFillColor(FX_COLORREF& color) const; |
83 » FX_BOOL»» » » » » » GetFillColor(FX_
COLORREF& color) const; | 83 FX_BOOL GetBorderColor(FX_COLORREF& color) const; |
84 » FX_BOOL»» » » » » » GetBorderColor(F
X_COLORREF& color) const; | 84 FX_BOOL GetTextColor(FX_COLORREF& color) const; |
85 » FX_BOOL»» » » » » » GetTextColor(FX_
COLORREF& color) const; | 85 FX_FLOAT GetFontSize() const; |
86 » FX_FLOAT» » » » » » GetFontSize() co
nst; | 86 |
87 | 87 int GetSelectedIndex(int nIndex) const; |
88 » int» » » » » » » » GetSelec
tedIndex(int nIndex) const; | 88 CFX_WideString GetValue() const; |
89 » CFX_WideString» » » » » GetValue() const; | 89 CFX_WideString GetDefaultValue() const; |
90 » CFX_WideString» » » » » GetDefaultValue() const; | 90 CFX_WideString GetOptionLabel(int nIndex) const; |
91 » CFX_WideString» » » » » GetOptionLabel(int nInde
x) const; | 91 int CountOptions() const; |
92 » int» » » » » » » » CountOpt
ions() const; | 92 FX_BOOL IsOptionSelected(int nIndex) const; |
93 » FX_BOOL»» » » » » » IsOptionSelected
(int nIndex) const; | 93 int GetTopVisibleIndex() const; |
94 » int» » » » » » » » GetTopVi
sibleIndex() const; | 94 FX_BOOL IsChecked() const; |
95 » FX_BOOL»» » » » » » IsChecked() cons
t; | 95 /* |
96 » /* | 96 BF_ALIGN_LEFT |
97 » BF_ALIGN_LEFT | 97 BF_ALIGN_MIDDL |
98 » BF_ALIGN_MIDDL | 98 BF_ALIGN_RIGHT |
99 » BF_ALIGN_RIGHT | 99 */ |
100 » */ | 100 int GetAlignment() const; |
101 » int» » » » » » » » GetAlign
ment() const; | 101 int GetMaxLen() const; |
102 » int» » » » » » » » GetMaxLe
n() const; | 102 CFX_WideString GetAlternateName() const; |
103 » CFX_WideString» » » » » GetAlternateName() const
; | 103 |
104 | 104 // Set Properties. |
105 //Set Properties. | 105 void SetCheck(FX_BOOL bChecked, FX_BOOL bNotify); |
106 » void» » » » » » » SetCheck(FX_BOOL
bChecked, FX_BOOL bNotify); | 106 void SetValue(const CFX_WideString& sValue, FX_BOOL bNotify); |
107 » void» » » » » » » SetValue(const C
FX_WideString& sValue, FX_BOOL bNotify); | 107 void SetDefaultValue(const CFX_WideString& sValue); |
108 » void» » » » » » » SetDefaultValue(
const CFX_WideString& sValue); | 108 void SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bNotify); |
109 » void» » » » » » » SetOptionSelecti
on(int index, FX_BOOL bSelected, FX_BOOL bNotify); | 109 void ClearSelection(FX_BOOL bNotify); |
110 » void» » » » » » » ClearSelection(F
X_BOOL bNotify); | 110 void SetTopVisibleIndex(int index); |
111 » void» » » » » » » SetTopVisibleInd
ex(int index); | 111 |
112 | 112 void ResetAppearance(const FX_WCHAR* sValue, FX_BOOL bValueChanged); |
113 » void» » » » » » » ResetAppearance(
const FX_WCHAR* sValue, FX_BOOL bValueChanged); | 113 void ResetFieldAppearance(FX_BOOL bValueChanged); |
114 » void» » » » » » » ResetFieldAppear
ance(FX_BOOL bValueChanged); | 114 void UpdateField(); |
115 » void» » » » » » » UpdateField(); | 115 CFX_WideString OnFormat(FX_BOOL& bFormated); |
116 » CFX_WideString» » » » » OnFormat(FX_BOOL& bForma
ted); | 116 |
117 | 117 // Message. |
118 //Message. | 118 FX_BOOL OnAAction(CPDF_AAction::AActionType type, |
119 » FX_BOOL»» » » » » » OnAAction(CPDF_A
Action::AActionType type, PDFSDK_FieldAction& data, | 119 PDFSDK_FieldAction& data, |
120 » » » » » » » » » »
» » CPDFSDK_PageView* pPageView); | 120 CPDFSDK_PageView* pPageView); |
121 | 121 |
122 » CPDFSDK_InterForm*» » » » GetInterForm() const {re
turn m_pInterForm;} | 122 CPDFSDK_InterForm* GetInterForm() const { return m_pInterForm; } |
123 » CPDF_FormField*»» » » » GetFormField() const; | 123 CPDF_FormField* GetFormField() const; |
124 » CPDF_FormControl*» » » » GetFormControl() const; | 124 CPDF_FormControl* GetFormControl() const; |
125 » static CPDF_FormControl*» » GetFormControl(CPDF_InterForm* p
InterForm, CPDF_Dictionary* pAnnotDict); | 125 static CPDF_FormControl* GetFormControl(CPDF_InterForm* pInterForm, |
126 | 126 CPDF_Dictionary* pAnnotDict); |
127 » void» » » » » » » DrawShadow(CFX_R
enderDevice* pDevice, CPDFSDK_PageView* pPageView); | 127 |
128 | 128 void DrawShadow(CFX_RenderDevice* pDevice, CPDFSDK_PageView* pPageView); |
129 » void» » » » » » » SetAppModified()
; | 129 |
130 » void» » » » » » » ClearAppModified
(); | 130 void SetAppModified(); |
131 » FX_BOOL»» » » » » » IsAppModified()
const; | 131 void ClearAppModified(); |
132 | 132 FX_BOOL IsAppModified() const; |
133 » int32_t»» » » » » GetAppearanceAge() const
; | 133 |
134 » int32_t»» » » » » GetValueAge() const; | 134 int32_t GetAppearanceAge() const; |
135 | 135 int32_t GetValueAge() const; |
136 private: | 136 |
137 » void» » » » » » » ResetAppearance_
PushButton(); | 137 private: |
138 » void» » » » » » » ResetAppearance_
CheckBox(); | 138 void ResetAppearance_PushButton(); |
139 » void» » » » » » » ResetAppearance_
RadioButton(); | 139 void ResetAppearance_CheckBox(); |
140 » void» » » » » » » ResetAppearance_
ComboBox(const FX_WCHAR* sValue); | 140 void ResetAppearance_RadioButton(); |
141 » void» » » » » » » ResetAppearance_
ListBox(); | 141 void ResetAppearance_ComboBox(const FX_WCHAR* sValue); |
142 » void» » » » » » » ResetAppearance_
TextField(const FX_WCHAR* sValue); | 142 void ResetAppearance_ListBox(); |
143 | 143 void ResetAppearance_TextField(const FX_WCHAR* sValue); |
144 » CPDF_Rect» » » » » » GetClientRect()
const; | 144 |
145 » CPDF_Rect» » » » » » GetRotatedRect()
const; | 145 CPDF_Rect GetClientRect() const; |
146 | 146 CPDF_Rect GetRotatedRect() const; |
147 » CFX_ByteString» » » » » GetBackgroundAppStream()
const; | 147 |
148 » CFX_ByteString» » » » » GetBorderAppStream() con
st; | 148 CFX_ByteString GetBackgroundAppStream() const; |
149 » CPDF_Matrix» » » » » » GetMatrix() cons
t; | 149 CFX_ByteString GetBorderAppStream() const; |
150 | 150 CPDF_Matrix GetMatrix() const; |
151 » CPWL_Color» » » » » » GetTextPWLColor(
) const; | 151 |
152 » CPWL_Color» » » » » » GetBorderPWLColo
r() const; | 152 CPWL_Color GetTextPWLColor() const; |
153 » CPWL_Color» » » » » » GetFillPWLColor(
) const; | 153 CPWL_Color GetBorderPWLColor() const; |
154 | 154 CPWL_Color GetFillPWLColor() const; |
155 » void» » » » » » » AddImageToAppear
ance(const CFX_ByteString& sAPType, CPDF_Stream* pImage); | 155 |
156 » void» » » » » » » RemoveAppearance
(const CFX_ByteString& sAPType); | 156 void AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_Stream* pImage); |
157 public: | 157 void RemoveAppearance(const CFX_ByteString& sAPType); |
158 » FX_BOOL»» » » » » » IsWidgetAppearan
ceValid(CPDF_Annot::AppearanceMode mode); | 158 |
159 » void» » » » » » » DrawAppearance(C
FX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device, | 159 public: |
160 » » CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOpti
ons); | 160 FX_BOOL IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode); |
161 public: | 161 void DrawAppearance(CFX_RenderDevice* pDevice, |
162 » FX_BOOL»» » » » » » HitTest(FX_FLOAT
pageX, FX_FLOAT pageY); | 162 const CPDF_Matrix* pUser2Device, |
163 private: | 163 CPDF_Annot::AppearanceMode mode, |
164 » CPDFSDK_InterForm*» » » » m_pInterForm; | 164 const CPDF_RenderOptions* pOptions); |
165 » FX_BOOL»» » » » » » m_bAppModified; | 165 |
166 » int32_t»» » » » » m_nAppAge; | 166 public: |
167 » int32_t»» » » » » m_nValueAge; | 167 FX_BOOL HitTest(FX_FLOAT pageX, FX_FLOAT pageY); |
| 168 |
| 169 private: |
| 170 CPDFSDK_InterForm* m_pInterForm; |
| 171 FX_BOOL m_bAppModified; |
| 172 int32_t m_nAppAge; |
| 173 int32_t m_nValueAge; |
168 }; | 174 }; |
169 | 175 |
170 class CPDFSDK_InterForm : public CPDF_FormNotify | 176 class CPDFSDK_InterForm : public CPDF_FormNotify { |
171 { | 177 public: |
172 public: | 178 explicit CPDFSDK_InterForm(CPDFSDK_Document* pDocument); |
173 » explicit CPDFSDK_InterForm(CPDFSDK_Document* pDocument); | 179 ~CPDFSDK_InterForm() override; |
174 » ~CPDFSDK_InterForm() override; | 180 |
175 | 181 CPDF_InterForm* GetInterForm() const { return m_pInterForm; } |
176 » CPDF_InterForm* GetInterForm() const { return m_pInterForm; } | 182 CPDFSDK_Document* GetDocument() const { return m_pDocument; } |
177 » CPDFSDK_Document* GetDocument() const { return m_pDocument; } | 183 |
178 | 184 FX_BOOL HighlightWidgets(); |
179 » FX_BOOL»» » » » » » HighlightWidgets
(); | 185 |
180 | 186 CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const; |
181 » CPDFSDK_Widget*»» » » » GetSibling(CPDFSDK_Widge
t* pWidget, FX_BOOL bNext) const; | 187 CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const; |
182 » CPDFSDK_Widget*»» » » » GetWidget(CPDF_FormContr
ol* pControl) const; | 188 void GetWidgets(const CFX_WideString& sFieldName, CFX_PtrArray& widgets); |
183 » void» » » » » » » GetWidgets(const
CFX_WideString& sFieldName, CFX_PtrArray& widgets); | 189 void GetWidgets(CPDF_FormField* pField, CFX_PtrArray& widgets); |
184 » void» » » » » » » GetWidgets(CPDF_
FormField* pField, CFX_PtrArray& widgets); | 190 |
185 | 191 void AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget); |
186 » void» » » » » » » AddMap(CPDF_Form
Control* pControl, CPDFSDK_Widget* pWidget); | 192 void RemoveMap(CPDF_FormControl* pControl); |
187 » void» » » » » » » RemoveMap(CPDF_F
ormControl* pControl); | 193 |
188 | 194 void EnableCalculate(FX_BOOL bEnabled); |
189 » void» » » » » » » EnableCalculate(
FX_BOOL bEnabled); | 195 FX_BOOL IsCalculateEnabled() const; |
190 » FX_BOOL»» » » » » » IsCalculateEnabl
ed() const; | |
191 | 196 |
192 #ifdef _WIN32 | 197 #ifdef _WIN32 |
193 » CPDF_Stream*» » » » » LoadImageFromFile(const
CFX_WideString& sFile); | 198 CPDF_Stream* LoadImageFromFile(const CFX_WideString& sFile); |
194 #endif | 199 #endif |
195 | 200 |
196 » void» » » » » » » OnKeyStrokeCommi
t(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC); | 201 void OnKeyStrokeCommit(CPDF_FormField* pFormField, |
197 » void» » » » » » » OnValidate(CPDF_
FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC); | 202 CFX_WideString& csValue, |
198 » void» » » » » » » OnCalculate(CPDF
_FormField* pFormField = NULL); | 203 FX_BOOL& bRC); |
199 » CFX_WideString» » » » » OnFormat(CPDF_FormField*
pFormField, FX_BOOL& bFormated); | 204 void OnValidate(CPDF_FormField* pFormField, |
200 | 205 CFX_WideString& csValue, |
201 » void» » » » » » » ResetFieldAppear
ance(CPDF_FormField* pFormField, const FX_WCHAR* sValue, FX_BOOL bValueChanged); | 206 FX_BOOL& bRC); |
202 » void» » » » » » » UpdateField(CPDF
_FormField* pFormField); | 207 void OnCalculate(CPDF_FormField* pFormField = NULL); |
203 | 208 CFX_WideString OnFormat(CPDF_FormField* pFormField, FX_BOOL& bFormated); |
204 » FX_BOOL»» » » » » » DoAction_Hide(co
nst CPDF_Action& action); | 209 |
205 » FX_BOOL»» » » » » » DoAction_SubmitF
orm(const CPDF_Action& action); | 210 void ResetFieldAppearance(CPDF_FormField* pFormField, |
206 » FX_BOOL»» » » » » » DoAction_ResetFo
rm(const CPDF_Action& action); | 211 const FX_WCHAR* sValue, |
207 » FX_BOOL»» » » » » » DoAction_ImportD
ata(const CPDF_Action& action); | 212 FX_BOOL bValueChanged); |
208 | 213 void UpdateField(CPDF_FormField* pFormField); |
209 » void» » » » » » » GetFieldFromObje
cts(const CFX_PtrArray& objects, CFX_PtrArray& fields); | 214 |
210 » FX_BOOL»» » » » » » IsValidField(CPD
F_Dictionary* pFieldDict); | 215 FX_BOOL DoAction_Hide(const CPDF_Action& action); |
211 » FX_BOOL»» » » » » » SubmitFields(con
st CFX_WideString& csDestination, const CFX_PtrArray& fields, | 216 FX_BOOL DoAction_SubmitForm(const CPDF_Action& action); |
212 » » FX_BOOL bIncludeOrExclude, FX_BOOL bUrlEncoded); | 217 FX_BOOL DoAction_ResetForm(const CPDF_Action& action); |
213 » FX_BOOL»» » » » » » SubmitForm(const
CFX_WideString& sDestination, FX_BOOL bUrlEncoded); | 218 FX_BOOL DoAction_ImportData(const CPDF_Action& action); |
214 » FX_BOOL»» » » » » » ExportFormToFDFT
extBuf(CFX_ByteTextBuf& textBuf); | 219 |
215 » FX_BOOL»» » » » » » ExportFieldsToFD
FTextBuf(const CFX_PtrArray& fields,FX_BOOL bIncludeOrExclude, CFX_ByteTextBuf&
textBuf); | 220 void GetFieldFromObjects(const CFX_PtrArray& objects, CFX_PtrArray& fields); |
216 » CFX_WideString» » » » » GetTemporaryFileName(con
st CFX_WideString& sFileExt); | 221 FX_BOOL IsValidField(CPDF_Dictionary* pFieldDict); |
217 | 222 FX_BOOL SubmitFields(const CFX_WideString& csDestination, |
218 private: | 223 const CFX_PtrArray& fields, |
219 » virtual int» » » » » » BeforeValueChang
e(const CPDF_FormField* pField, CFX_WideString& csValue); | 224 FX_BOOL bIncludeOrExclude, |
220 » virtual int» » » » » » AfterValueChange
(const CPDF_FormField* pField); | 225 FX_BOOL bUrlEncoded); |
221 » virtual int» » » » » » BeforeSelectionC
hange(const CPDF_FormField* pField, CFX_WideString& csValue); | 226 FX_BOOL SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded); |
222 » virtual int» » » » » » AfterSelectionCh
ange(const CPDF_FormField* pField); | 227 FX_BOOL ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf); |
223 » virtual int» » » » » » AfterCheckedStat
usChange(const CPDF_FormField* pField, const CFX_ByteArray& statusArray); | 228 FX_BOOL ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields, |
224 » virtual int» » » » » » BeforeFormReset(
const CPDF_InterForm* pForm); | 229 FX_BOOL bIncludeOrExclude, |
225 » virtual int» » » » » » AfterFormReset(c
onst CPDF_InterForm* pForm); | 230 CFX_ByteTextBuf& textBuf); |
226 » virtual int» » » » » » BeforeFormImport
Data(const CPDF_InterForm* pForm); | 231 CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt); |
227 » virtual int» » » » » » AfterFormImportD
ata(const CPDF_InterForm* pForm); | 232 |
228 | 233 private: |
229 » FX_BOOL»» » » » » » FDFToURLEncodedD
ata(CFX_WideString csFDFFile, CFX_WideString csTxtFile); | 234 virtual int BeforeValueChange(const CPDF_FormField* pField, |
230 » FX_BOOL»» » » » » » FDFToURLEncodedD
ata(uint8_t*& pBuf, FX_STRSIZE& nBufSize); | 235 CFX_WideString& csValue); |
231 » int» » » » » » » » GetPageI
ndexByAnnotDict(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict) const; | 236 virtual int AfterValueChange(const CPDF_FormField* pField); |
232 » void» » » » » » » DoFDFBuffer(CFX_
ByteString sBuffer); | 237 virtual int BeforeSelectionChange(const CPDF_FormField* pField, |
233 | 238 CFX_WideString& csValue); |
234 using CPDFSDK_WidgetMap = std::map<CPDF_FormControl*, CPDFSDK_Widget*>; | 239 virtual int AfterSelectionChange(const CPDF_FormField* pField); |
235 | 240 virtual int AfterCheckedStatusChange(const CPDF_FormField* pField, |
236 CPDFSDK_Document* m_pDocument; | 241 const CFX_ByteArray& statusArray); |
237 CPDF_InterForm* m_pInterForm; | 242 virtual int BeforeFormReset(const CPDF_InterForm* pForm); |
238 CPDFSDK_WidgetMap m_Map; | 243 virtual int AfterFormReset(const CPDF_InterForm* pForm); |
239 FX_BOOL m_bCalculate; | 244 virtual int BeforeFormImportData(const CPDF_InterForm* pForm); |
240 FX_BOOL m_bBusy; | 245 virtual int AfterFormImportData(const CPDF_InterForm* pForm); |
241 | 246 |
242 public: | 247 FX_BOOL FDFToURLEncodedData(CFX_WideString csFDFFile, |
243 » FX_BOOL IsNeedHighLight(int nFieldType); | 248 CFX_WideString csTxtFile); |
244 » void RemoveAllHighLight(); | 249 FX_BOOL FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize); |
245 » void SetHighlightAlpha(uint8_t alpha) {m_iHighlightAlpha = alpha;} | 250 int GetPageIndexByAnnotDict(CPDF_Document* pDocument, |
246 » uint8_t GetHighlightAlpha() {return m_iHighlightAlpha;} | 251 CPDF_Dictionary* pAnnotDict) const; |
247 » void SetHighlightColor(FX_COLORREF clr, int nFieldType); | 252 void DoFDFBuffer(CFX_ByteString sBuffer); |
248 » FX_COLORREF GetHighlightColor(int nFieldType); | 253 |
249 private: | 254 using CPDFSDK_WidgetMap = std::map<CPDF_FormControl*, CPDFSDK_Widget*>; |
250 » FX_COLORREF m_aHighlightColor[6]; | 255 |
251 » uint8_t m_iHighlightAlpha; | 256 CPDFSDK_Document* m_pDocument; |
252 » FX_BOOL»m_bNeedHightlight[6]; | 257 CPDF_InterForm* m_pInterForm; |
| 258 CPDFSDK_WidgetMap m_Map; |
| 259 FX_BOOL m_bCalculate; |
| 260 FX_BOOL m_bBusy; |
| 261 |
| 262 public: |
| 263 FX_BOOL IsNeedHighLight(int nFieldType); |
| 264 void RemoveAllHighLight(); |
| 265 void SetHighlightAlpha(uint8_t alpha) { m_iHighlightAlpha = alpha; } |
| 266 uint8_t GetHighlightAlpha() { return m_iHighlightAlpha; } |
| 267 void SetHighlightColor(FX_COLORREF clr, int nFieldType); |
| 268 FX_COLORREF GetHighlightColor(int nFieldType); |
| 269 |
| 270 private: |
| 271 FX_COLORREF m_aHighlightColor[6]; |
| 272 uint8_t m_iHighlightAlpha; |
| 273 FX_BOOL m_bNeedHightlight[6]; |
253 }; | 274 }; |
254 | 275 |
255 #define BAI_STRUCTURE» » 0 | 276 #define BAI_STRUCTURE 0 |
256 #define BAI_ROW»» » » 1 | 277 #define BAI_ROW 1 |
257 #define BAI_COLUMN» » » 2 | 278 #define BAI_COLUMN 2 |
258 | 279 |
259 #define CPDFSDK_Annots» » » » CFX_ArrayTemplate<CPDFSDK_Annot*
> | 280 #define CPDFSDK_Annots CFX_ArrayTemplate<CPDFSDK_Annot*> |
260 #define CPDFSDK_SortAnnots» » » CGW_ArrayTemplate<CPDFSDK_Annot*
> | 281 #define CPDFSDK_SortAnnots CGW_ArrayTemplate<CPDFSDK_Annot*> |
261 class CBA_AnnotIterator | 282 class CBA_AnnotIterator { |
262 { | 283 public: |
263 public: | 284 CBA_AnnotIterator(CPDFSDK_PageView* pPageView, |
264 » CBA_AnnotIterator(CPDFSDK_PageView* pPageView, const CFX_ByteString& sTy
pe, const CFX_ByteString& sSubType); | 285 const CFX_ByteString& sType, |
265 » ~CBA_AnnotIterator(); | 286 const CFX_ByteString& sSubType); |
266 | 287 ~CBA_AnnotIterator(); |
267 » CPDFSDK_Annot*» » » » GetFirstAnnot(); | 288 |
268 » CPDFSDK_Annot*» » » » GetLastAnnot(); | 289 CPDFSDK_Annot* GetFirstAnnot(); |
269 » CPDFSDK_Annot*» » » » GetNextAnnot(CPDFSDK_Annot* pAnn
ot); | 290 CPDFSDK_Annot* GetLastAnnot(); |
270 » CPDFSDK_Annot*» » » » GetPrevAnnot(CPDFSDK_Annot* pAnn
ot); | 291 CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pAnnot); |
271 | 292 CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot); |
272 private: | 293 |
273 » void» » » » » » » » Generate
Results(); | 294 private: |
274 » static int» » » » » » » CompareB
yLeft(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2); | 295 void GenerateResults(); |
275 » static int» » » » » » » CompareB
yTop(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2); | 296 static int CompareByLeft(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2); |
276 » static CPDF_Rect» » » » » GetAnnotRect(CPD
FSDK_Annot* pAnnot); | 297 static int CompareByTop(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2); |
277 | 298 static CPDF_Rect GetAnnotRect(CPDFSDK_Annot* pAnnot); |
278 » CPDFSDK_PageView*» » » » » m_pPageView; | 299 |
279 » CFX_ByteString» » » » » » m_sType; | 300 CPDFSDK_PageView* m_pPageView; |
280 » CFX_ByteString» » » » » » m_sSubType; | 301 CFX_ByteString m_sType; |
281 » int» » » » » » » » »
m_nTabs; | 302 CFX_ByteString m_sSubType; |
282 » CPDFSDK_Annots» » » » » » m_Annots; | 303 int m_nTabs; |
| 304 CPDFSDK_Annots m_Annots; |
283 }; | 305 }; |
284 | 306 |
285 #endif // FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ | 307 #endif // FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ |
OLD | NEW |