Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Side by Side Diff: fpdfsdk/include/fsdk_baseform.h

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

Powered by Google App Engine
This is Rietveld 408576698