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

Side by Side Diff: xfa/include/fxfa/fxfa.h

Issue 1153553003: Make CPDFXFA_App / IXFA_AppProvider saner (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Address comments. Created 5 years, 7 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
« no previous file with comments | « fpdfsdk/src/javascript/global.cpp ('k') | xfa/src/fxfa/src/app/xfa_ffapp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 _FXFA 7 #ifndef FXFA_H_
8 #define _FXFA 8 #define FXFA_H_
9
9 class IFDE_XMLElement; 10 class IFDE_XMLElement;
10 class CXFA_Node; 11 class CXFA_Node;
11 class CXFA_NodeList; 12 class CXFA_NodeList;
12 class CXFA_WidgetAcc; 13 class CXFA_WidgetAcc;
13 class IFWL_AdapterTimerMgr; 14 class IFWL_AdapterTimerMgr;
14 class IFX_Font; 15 class IFX_Font;
15 class CFX_Graphics; 16 class CFX_Graphics;
16 class IXFA_AppProvider; 17 class IXFA_AppProvider;
17 class IXFA_App; 18 class IXFA_App;
18 class IXFA_FontMgr; 19 class IXFA_FontMgr;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 #define XFA_IDS_StringMonth_Oct 90 139 #define XFA_IDS_StringMonth_Oct 90
139 #define XFA_IDS_StringMonth_Nov 91 140 #define XFA_IDS_StringMonth_Nov 91
140 #define XFA_IDS_StringMonth_Dec 92 141 #define XFA_IDS_StringMonth_Dec 92
141 #define XFA_IDS_String_Today 93 142 #define XFA_IDS_String_Today 93
142 #define XFA_IDS_ValidateLimit 94 143 #define XFA_IDS_ValidateLimit 94
143 #define XFA_IDS_ValidateNullWarning 95 144 #define XFA_IDS_ValidateNullWarning 95
144 #define XFA_IDS_ValidateNullError 96 145 #define XFA_IDS_ValidateNullError 96
145 #define XFA_IDS_ValidateWarning 97 146 #define XFA_IDS_ValidateWarning 97
146 #define XFA_IDS_ValidateError 98 147 #define XFA_IDS_ValidateError 98
147 #define XFA_IDS_ValidateNumberError 99 148 #define XFA_IDS_ValidateNumberError 99
149
150 // Probably should be called IXFA_AppDelegate.
148 class IXFA_AppProvider 151 class IXFA_AppProvider
149 { 152 {
150 public: 153 public:
151 virtual ~IXFA_AppProvider() { } 154 virtual ~IXFA_AppProvider() { }
152 155
153 virtual void» » SetAppType(FX_WSTR wsAppType) = 0; 156 /**
154 virtual void» » GetAppType(CFX_WideString &wsAppType) = 0; 157 * Specifies the name of the client application in which a form currently ex ists. Such as Exchange-Pro.
158 */
159 virtual void SetAppType(const CFX_WideStringC& wsAppType) = 0;
160 virtual void GetAppType(CFX_WideString &wsAppType) = 0;
161 virtual void SetFoxitAppType(const CFX_WideStringC& wsFoxitAppType) { }
162 virtual void GetFoxitAppType(CFX_WideString &wsFoxitAppType) {
163 wsFoxitAppType.Empty();
164 }
155 165
156 virtual void» » SetFoxitAppType(FX_WSTR wsFoxitAppType) { } 166 /**
157 virtual void» » GetFoxitAppType(CFX_WideString &wsFoxitAppType) { } 167 * Returns the language of the running host application. Such as zh_CN
168 */
169 virtual void GetLanguage(CFX_WideString &wsLanguage) = 0;
158 170
159 virtual void» » GetLanguage(CFX_WideString &wsLanguage) = 0; 171 /**
160 virtual void» » GetPlatform(CFX_WideString &wsPlatform) = 0; 172 * Returns the platform of the machine running the script. Such as WIN
161 virtual void» » GetVariation(CFX_WideString &wsVariation) = 0; 173 */
174 virtual void GetPlatform(CFX_WideString &wsPlatform) = 0;
162 175
163 virtual void» » GetVersion(CFX_WideString &wsVersion) = 0; 176 /**
164 virtual void» » GetFoxitVersion(CFX_WideString &wsFoxitVersion) { } 177 * Indicates the packaging of the application that is running the script. Su ch as Full
178 */
179 virtual void GetVariation(CFX_WideString &wsVariation) = 0;
165 180
166 virtual void» » GetAppName(CFX_WideString& wsName) = 0; 181 /**
167 virtual void» » GetFoxitAppName(CFX_WideString& wsFoxitName) { } 182 * Indicates the version number of the current application. Such as 9
183 */
184 virtual void GetVersion(CFX_WideString &wsVersion) = 0;
185 virtual void GetFoxitVersion(CFX_WideString &wsFoxitVersion) {
186 wsFoxitVersion.Empty();
187 }
168 188
169 virtual void» » Beep(FX_DWORD dwType) = 0; 189 /**
190 * Get application name, such as Phantom.
191 */
192 virtual void GetAppName(CFX_WideString& wsName) = 0;
193 virtual void GetFoxitAppName(CFX_WideString& wsFoxitName) {
194 wsFoxitName.Empty();
195 }
170 196
171 virtual FX_INT32» MsgBox(FX_WSTR wsMessage, FX_WSTR wsTitle = FX_WSTRC(L"" ), FX_DWORD dwIconType = 0, FX_DWORD dwButtonType = 0) = 0; 197 /**
172 virtual void» » Response(CFX_WideString &wsAnswer, FX_WSTR wsQue stion, FX_WSTR wsTitle = FX_WSTRC(L""), FX_WSTR wsDefaultAnswer = FX_WSTRC(L""), FX_BOOL bMark = TRUE) = 0; 198 * Causes the system to play a sound.
173 virtual FX_INT32» GetDocumentCountInBatch() = 0; 199 * @param[in] dwType The system code for the appropriate sound.0 (Error)1 (W arning)2 (Question)3 (Status)4 (Default)
174 virtual FX_INT32» GetCurDocumentInBatch() = 0; 200 */
201 virtual void Beep(FX_DWORD dwType) = 0;
202
203 /**
204 * Displays a message box.
205 * @param[in] dwIconType Icon type, refer to XFA_MBICON.
206 * @param[in] dwButtonType Button type, refer to XFA_MESSAGEBUTTON.
207 * @return A valid integer representing the value of the button pressed by t he user, refer to XFA_ID.
208 */
209 virtual FX_INT32 MsgBox(FX_WSTR wsMessage, FX_WSTR wsTitle = FX_WSTRC(L""),
210 FX_DWORD dwIconType = 0, FX_DWORD dwButtonType = 0) = 0;
211
212 /**
213 * Get a response from the user.
214 * @param[in] bMark - Mask the user input with * (asterisks) when true,
215 */
216 virtual void Response(CFX_WideString &wsAnswer, FX_WSTR wsQuestion, FX_WSTR wsTitle = FX_WSTRC(L""),
217 FX_WSTR wsDefaultAnswer = FX_WSTRC(L""), FX_BOOL bMark = TRUE) = 0;
218
219 virtual FX_INT32 GetDocumentCountInBatch() = 0;
220 virtual FX_INT32 GetCurDocumentInBatch() = 0;
221
222 /**
223 * Download something from somewhere.
224 * @param[in] wsURL - http, ftp, such as "http://www.w3.org/TR/REC-xml-names /".
225 */
175 virtual IFX_FileRead* DownloadURL(FX_WSTR wsURL) = 0; 226 virtual IFX_FileRead* DownloadURL(FX_WSTR wsURL) = 0;
176 227
177 virtual FX_BOOL» » PostRequestURL(FX_WSTR wsURL, FX_WSTR wsData, FX _WSTR wsContentType, 228 /**
178 FX_WSTR wsEncode, FX_WSTR wsHeader, CFX_W ideString &wsResponse) = 0; 229 * POST data to the given url.
230 * @param[in] wsURL the URL being uploaded.
231 * @param[in] wsData the data being uploaded.
232 * @param[in] wsContentType the content type of data including text/html, te xt/xml, text/plain, multipart/form-data,
233 * application/x-www-form-urlencoded, application/o ctet-stream, any valid MIME type.
234 * @param[in] wsEncode the encode of data including UTF-8, UTF-16, ISO8 859-1, any recognized [IANA]character encoding
235 * @param[in] wsHeader any additional HTTP headers to be included in th e post.
236 * @param[out] wsResponse decoded response from server.
237 * @return TRUE Server permitted the post request, FALSE otherwise.
238 */
239 virtual FX_BOOL PostRequestURL(FX_WSTR wsURL, FX_WSTR wsData, FX_WSTR wsCont entType,
240 FX_WSTR wsEncode, FX_WSTR wsHeader, CFX_WideS tring &wsResponse) = 0;
179 241
180 virtual FX_BOOL» » PutRequestURL(FX_WSTR wsURL, FX_WSTR wsData, FX_ WSTR wsEncode) = 0; 242 /**
181 virtual void» » LoadString(FX_INT32 iStringID, CFX_WideString &w sString) = 0; 243 * PUT data to the given url.
182 virtual» FX_BOOL»» ShowFileDialog(FX_WSTR wsTitle, FX_WSTR wsFilter , CFX_WideStringArray &wsPathArr, FX_BOOL bOpen = TRUE) = 0; 244 * @param[in] wsURL the URL being uploaded.
245 * @param[in] wsData the data being uploaded.
246 * @param[in] wsEncode the encode of data including UTF-8, UTF-16, ISO8 859-1, any recognized [IANA]character encoding
247 * @return TRUE Server permitted the post request, FALSE otherwise.
248 */
249 virtual FX_BOOL PutRequestURL(FX_WSTR wsURL, FX_WSTR wsData, FX_WSTR wsE ncode) = 0;
250
251 virtual void LoadString(FX_INT32 iStringID, CFX_WideString &wsString) = 0;
252 virtual FX_BOOL ShowFileDialog(FX_WSTR wsTitle, FX_WSTR wsFilter, CFX_WideSt ringArray &wsPathArr, FX_BOOL bOpen = TRUE) = 0;
183 virtual IFWL_AdapterTimerMgr* GetTimerMgr() = 0; 253 virtual IFWL_AdapterTimerMgr* GetTimerMgr() = 0;
184 }; 254 };
185 class IXFA_FontMgr 255 class IXFA_FontMgr
186 { 256 {
187 public: 257 public:
188 virtual void» » Release() = 0; 258 static IXFA_FontMgr* CreateDefault();
259 virtual ~IXFA_FontMgr();
260
189 virtual IFX_Font* GetFont(XFA_HDOC hDoc, FX_WSTR wsFontFamily, FX_DWORD dw FontStyles, FX_WORD wCodePage = 0xFFFF) = 0; 261 virtual IFX_Font* GetFont(XFA_HDOC hDoc, FX_WSTR wsFontFamily, FX_DWORD dw FontStyles, FX_WORD wCodePage = 0xFFFF) = 0;
190 virtual IFX_Font* GetDefaultFont(XFA_HDOC hDoc, FX_WSTR wsFontFamily, FX_D WORD dwFontStyles, FX_WORD wCodePage = 0xFFFF) = 0; 262 virtual IFX_Font* GetDefaultFont(XFA_HDOC hDoc, FX_WSTR wsFontFamily, FX_D WORD dwFontStyles, FX_WORD wCodePage = 0xFFFF) = 0;
191 protected:
192 ~IXFA_FontMgr() { }
193 }; 263 };
194 IXFA_FontMgr* XFA_GetDefaultFontMgr();
195 class IXFA_App 264 class IXFA_App
196 { 265 {
197 public: 266 public:
198 static IXFA_App*» Create(IXFA_AppProvider* pProvider); 267 static IXFA_App* Create(IXFA_AppProvider* pProvider);
199 virtual void» » Release() = 0; 268 virtual ~IXFA_App();
269
200 virtual IXFA_DocHandler* GetDocHandler() = 0; 270 virtual IXFA_DocHandler* GetDocHandler() = 0;
201 virtual XFA_HDOC CreateDoc(IXFA_DocProvider* pProvider, I FX_FileRead* pStream, FX_BOOL bTakeOverFile = TRUE) = 0; 271 virtual XFA_HDOC CreateDoc(IXFA_DocProvider* pProvider, I FX_FileRead* pStream, FX_BOOL bTakeOverFile = TRUE) = 0;
202 virtual XFA_HDOC CreateDoc(IXFA_DocProvider* pProvider, C PDF_Document* pPDFDoc) = 0; 272 virtual XFA_HDOC CreateDoc(IXFA_DocProvider* pProvider, C PDF_Document* pPDFDoc) = 0;
203 virtual IXFA_AppProvider* GetAppProvider() = 0; 273 virtual IXFA_AppProvider* GetAppProvider() = 0;
204 virtual void SetDefaultFontMgr(IXFA_FontMgr* pFontMgr) = 0; 274 virtual void SetDefaultFontMgr(IXFA_FontMgr* pFontMgr) = 0;
205 virtual IXFA_MenuHandler* GetMenuHandler() = 0; 275 virtual IXFA_MenuHandler* GetMenuHandler() = 0;
206 protected:
207 ~IXFA_App() { }
208 }; 276 };
209 class IXFA_MenuHandler 277 class IXFA_MenuHandler
210 { 278 {
211 public: 279 public:
212 virtual ~IXFA_MenuHandler() { } 280 virtual ~IXFA_MenuHandler() { }
213 281
214 virtual FX_BOOL CanCopy(XFA_HWIDGET hWidget) = 0; 282 virtual FX_BOOL CanCopy(XFA_HWIDGET hWidget) = 0;
215 virtual FX_BOOL CanCut(XFA_HWIDGET hWidget) = 0; 283 virtual FX_BOOL CanCut(XFA_HWIDGET hWidget) = 0;
216 virtual FX_BOOL CanPaste(XFA_HWIDGET hWidget) = 0; 284 virtual FX_BOOL CanPaste(XFA_HWIDGET hWidget) = 0;
217 virtual FX_BOOL CanSelectAll(XFA_HWIDGET hWidget) = 0; 285 virtual FX_BOOL CanSelectAll(XFA_HWIDGET hWidget) = 0;
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 virtual void Release() = 0; 688 virtual void Release() = 0;
621 689
622 virtual FX_BOOL StartChecksum() = 0; 690 virtual FX_BOOL StartChecksum() = 0;
623 virtual FX_BOOL UpdateChecksum(IFX_FileRead* pSr cFile, FX_FILESIZE offset = 0, size_t size = 0) = 0; 691 virtual FX_BOOL UpdateChecksum(IFX_FileRead* pSr cFile, FX_FILESIZE offset = 0, size_t size = 0) = 0;
624 virtual void FinishChecksum() = 0; 692 virtual void FinishChecksum() = 0;
625 virtual void GetChecksum(CFX_ByteString &bsCh ecksum) = 0; 693 virtual void GetChecksum(CFX_ByteString &bsCh ecksum) = 0;
626 protected: 694 protected:
627 ~IXFA_ChecksumContext() { } 695 ~IXFA_ChecksumContext() { }
628 }; 696 };
629 IXFA_ChecksumContext* XFA_Checksum_Create(); 697 IXFA_ChecksumContext* XFA_Checksum_Create();
630 #endif 698
699 #endif // FXFA_H_
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/global.cpp ('k') | xfa/src/fxfa/src/app/xfa_ffapp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698