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 XFA_INCLUDE_FXFA_FXFA_H_ | 7 #ifndef XFA_INCLUDE_FXFA_FXFA_H_ |
8 #define XFA_INCLUDE_FXFA_FXFA_H_ | 8 #define XFA_INCLUDE_FXFA_FXFA_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "xfa/include/fxfa/fxfa_basic.h" | 12 #include "xfa/include/fxfa/fxfa_basic.h" |
13 #include "xfa/include/fxfa/fxfa_widget.h" | 13 #include "xfa/include/fxfa/fxfa_widget.h" |
14 | 14 |
15 class CFX_Graphics; | 15 class CFX_Graphics; |
16 class CPDF_Document; | 16 class CPDF_Document; |
| 17 class CXFA_FFPageView; |
17 class CXFA_Node; | 18 class CXFA_Node; |
18 class CXFA_NodeList; | 19 class CXFA_NodeList; |
19 class CXFA_WidgetAcc; | 20 class CXFA_WidgetAcc; |
20 class IFWL_AdapterTimerMgr; | 21 class IFWL_AdapterTimerMgr; |
21 class IFX_Font; | 22 class IFX_Font; |
22 class IXFA_App; | |
23 class IXFA_AppProvider; | 23 class IXFA_AppProvider; |
24 class IXFA_ChecksumContext; | |
25 class IXFA_DocHandler; | |
26 class IXFA_DocProvider; | 24 class IXFA_DocProvider; |
27 class IXFA_DocView; | |
28 class IXFA_FontMgr; | |
29 class IXFA_MenuHandler; | |
30 class IXFA_PageView; | |
31 class IXFA_WidgetAccIterator; | 25 class IXFA_WidgetAccIterator; |
32 class IXFA_WidgetHandler; | |
33 class IXFA_WidgetIterator; | 26 class IXFA_WidgetIterator; |
34 | 27 |
35 class IXFA_Doc { | |
36 public: | |
37 virtual ~IXFA_Doc() {} | |
38 | |
39 protected: | |
40 IXFA_Doc() {} | |
41 }; | |
42 | |
43 class IXFA_Widget { | |
44 public: | |
45 virtual ~IXFA_Widget() {} | |
46 | |
47 protected: | |
48 IXFA_Widget() {} | |
49 }; | |
50 | |
51 #define XFA_MBICON_Error 0 | 28 #define XFA_MBICON_Error 0 |
52 #define XFA_MBICON_Warning 1 | 29 #define XFA_MBICON_Warning 1 |
53 #define XFA_MBICON_Question 2 | 30 #define XFA_MBICON_Question 2 |
54 #define XFA_MBICON_Status 3 | 31 #define XFA_MBICON_Status 3 |
55 #define XFA_MB_OK 0 | 32 #define XFA_MB_OK 0 |
56 #define XFA_MB_OKCancel 1 | 33 #define XFA_MB_OKCancel 1 |
57 #define XFA_MB_YesNo 2 | 34 #define XFA_MB_YesNo 2 |
58 #define XFA_MB_YesNoCancel 3 | 35 #define XFA_MB_YesNoCancel 3 |
59 #define XFA_IDOK 1 | 36 #define XFA_IDOK 1 |
60 #define XFA_IDCancel 2 | 37 #define XFA_IDCancel 2 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 const CFX_WideStringC& wsData, | 258 const CFX_WideStringC& wsData, |
282 const CFX_WideStringC& wsEncode) = 0; | 259 const CFX_WideStringC& wsEncode) = 0; |
283 | 260 |
284 virtual void LoadString(int32_t iStringID, CFX_WideString& wsString) = 0; | 261 virtual void LoadString(int32_t iStringID, CFX_WideString& wsString) = 0; |
285 virtual FX_BOOL ShowFileDialog(const CFX_WideStringC& wsTitle, | 262 virtual FX_BOOL ShowFileDialog(const CFX_WideStringC& wsTitle, |
286 const CFX_WideStringC& wsFilter, | 263 const CFX_WideStringC& wsFilter, |
287 CFX_WideStringArray& wsPathArr, | 264 CFX_WideStringArray& wsPathArr, |
288 FX_BOOL bOpen = TRUE) = 0; | 265 FX_BOOL bOpen = TRUE) = 0; |
289 virtual IFWL_AdapterTimerMgr* GetTimerMgr() = 0; | 266 virtual IFWL_AdapterTimerMgr* GetTimerMgr() = 0; |
290 }; | 267 }; |
291 class IXFA_FontMgr { | |
292 public: | |
293 static IXFA_FontMgr* CreateDefault(); | |
294 virtual ~IXFA_FontMgr(); | |
295 | 268 |
296 virtual IFX_Font* GetFont(IXFA_Doc* hDoc, | |
297 const CFX_WideStringC& wsFontFamily, | |
298 uint32_t dwFontStyles, | |
299 uint16_t wCodePage = 0xFFFF) = 0; | |
300 virtual IFX_Font* GetDefaultFont(IXFA_Doc* hDoc, | |
301 const CFX_WideStringC& wsFontFamily, | |
302 uint32_t dwFontStyles, | |
303 uint16_t wCodePage = 0xFFFF) = 0; | |
304 }; | |
305 class IXFA_App { | |
306 public: | |
307 static IXFA_App* Create(IXFA_AppProvider* pProvider); | |
308 virtual ~IXFA_App(); | |
309 | |
310 virtual IXFA_DocHandler* GetDocHandler() = 0; | |
311 virtual IXFA_Doc* CreateDoc(IXFA_DocProvider* pProvider, | |
312 IFX_FileRead* pStream, | |
313 FX_BOOL bTakeOverFile = TRUE) = 0; | |
314 virtual IXFA_Doc* CreateDoc(IXFA_DocProvider* pProvider, | |
315 CPDF_Document* pPDFDoc) = 0; | |
316 virtual IXFA_AppProvider* GetAppProvider() = 0; | |
317 virtual void SetDefaultFontMgr(IXFA_FontMgr* pFontMgr) = 0; | |
318 virtual IXFA_MenuHandler* GetMenuHandler() = 0; | |
319 }; | |
320 class IXFA_MenuHandler { | |
321 public: | |
322 virtual ~IXFA_MenuHandler() {} | |
323 | |
324 virtual FX_BOOL CanCopy(IXFA_Widget* hWidget) = 0; | |
325 virtual FX_BOOL CanCut(IXFA_Widget* hWidget) = 0; | |
326 virtual FX_BOOL CanPaste(IXFA_Widget* hWidget) = 0; | |
327 virtual FX_BOOL CanSelectAll(IXFA_Widget* hWidget) = 0; | |
328 virtual FX_BOOL CanDelete(IXFA_Widget* hWidget) = 0; | |
329 virtual FX_BOOL CanDeSelect(IXFA_Widget* hWidget) = 0; | |
330 virtual FX_BOOL Copy(IXFA_Widget* hWidget, CFX_WideString& wsText) = 0; | |
331 virtual FX_BOOL Cut(IXFA_Widget* hWidget, CFX_WideString& wsText) = 0; | |
332 virtual FX_BOOL Paste(IXFA_Widget* hWidget, const CFX_WideString& wsText) = 0; | |
333 virtual FX_BOOL SelectAll(IXFA_Widget* hWidget) = 0; | |
334 virtual FX_BOOL Delete(IXFA_Widget* hWidget) = 0; | |
335 virtual FX_BOOL DeSelect(IXFA_Widget* hWidget) = 0; | |
336 virtual FX_BOOL CanUndo(IXFA_Widget* hWidget) = 0; | |
337 virtual FX_BOOL CanRedo(IXFA_Widget* hWidget) = 0; | |
338 virtual FX_BOOL Undo(IXFA_Widget* hWidget) = 0; | |
339 virtual FX_BOOL Redo(IXFA_Widget* hWidget) = 0; | |
340 virtual FX_BOOL GetSuggestWords(IXFA_Widget* hWidget, | |
341 CFX_PointF pointf, | |
342 std::vector<CFX_ByteString>& sSuggest) = 0; | |
343 virtual FX_BOOL ReplaceSpellCheckWord(IXFA_Widget* hWidget, | |
344 CFX_PointF pointf, | |
345 const CFX_ByteStringC& bsReplace) = 0; | |
346 }; | |
347 #define XFA_INVALIDATE_AllPages 0x00000000 | 269 #define XFA_INVALIDATE_AllPages 0x00000000 |
348 #define XFA_INVALIDATE_CurrentPage 0x00000001 | 270 #define XFA_INVALIDATE_CurrentPage 0x00000001 |
349 #define XFA_PRINTOPT_ShowDialog 0x00000001 | 271 #define XFA_PRINTOPT_ShowDialog 0x00000001 |
350 #define XFA_PRINTOPT_CanCancel 0x00000002 | 272 #define XFA_PRINTOPT_CanCancel 0x00000002 |
351 #define XFA_PRINTOPT_ShrinkPage 0x00000004 | 273 #define XFA_PRINTOPT_ShrinkPage 0x00000004 |
352 #define XFA_PRINTOPT_AsImage 0x00000008 | 274 #define XFA_PRINTOPT_AsImage 0x00000008 |
353 #define XFA_PRINTOPT_ReverseOrder 0x00000010 | 275 #define XFA_PRINTOPT_ReverseOrder 0x00000010 |
354 #define XFA_PRINTOPT_PrintAnnot 0x00000020 | 276 #define XFA_PRINTOPT_PrintAnnot 0x00000020 |
355 #define XFA_PAGEVIEWEVENT_PostAdded 1 | 277 #define XFA_PAGEVIEWEVENT_PostAdded 1 |
356 #define XFA_PAGEVIEWEVENT_PostRemoved 3 | 278 #define XFA_PAGEVIEWEVENT_PostRemoved 3 |
357 #define XFA_PAGEVIEWEVENT_StopLayout 4 | 279 #define XFA_PAGEVIEWEVENT_StopLayout 4 |
358 #define XFA_WIDGETEVENT_PostAdded 2 | 280 #define XFA_WIDGETEVENT_PostAdded 2 |
359 #define XFA_WIDGETEVENT_PreRemoved 3 | 281 #define XFA_WIDGETEVENT_PreRemoved 3 |
360 #define XFA_WIDGETEVENT_PostContentChanged 6 | 282 #define XFA_WIDGETEVENT_PostContentChanged 6 |
361 #define XFA_WIDGETEVENT_ListItemRemoved 7 | 283 #define XFA_WIDGETEVENT_ListItemRemoved 7 |
362 #define XFA_WIDGETEVENT_ListItemAdded 8 | 284 #define XFA_WIDGETEVENT_ListItemAdded 8 |
363 #define XFA_WIDGETEVENT_AccessChanged 9 | 285 #define XFA_WIDGETEVENT_AccessChanged 9 |
364 class IXFA_DocProvider { | 286 class IXFA_DocProvider { |
365 public: | 287 public: |
366 virtual ~IXFA_DocProvider() {} | 288 virtual ~IXFA_DocProvider() {} |
367 | 289 |
368 virtual void SetChangeMark(IXFA_Doc* hDoc) = 0; | 290 virtual void SetChangeMark(CXFA_FFDoc* hDoc) = 0; |
369 virtual void InvalidateRect(IXFA_PageView* pPageView, | 291 virtual void InvalidateRect(CXFA_FFPageView* pPageView, |
370 const CFX_RectF& rt, | 292 const CFX_RectF& rt, |
371 uint32_t dwFlags = 0) = 0; | 293 uint32_t dwFlags = 0) = 0; |
372 virtual void DisplayCaret(IXFA_Widget* hWidget, | 294 virtual void DisplayCaret(CXFA_FFWidget* hWidget, |
373 FX_BOOL bVisible, | 295 FX_BOOL bVisible, |
374 const CFX_RectF* pRtAnchor) = 0; | 296 const CFX_RectF* pRtAnchor) = 0; |
375 virtual FX_BOOL GetPopupPos(IXFA_Widget* hWidget, | 297 virtual FX_BOOL GetPopupPos(CXFA_FFWidget* hWidget, |
376 FX_FLOAT fMinPopup, | 298 FX_FLOAT fMinPopup, |
377 FX_FLOAT fMaxPopup, | 299 FX_FLOAT fMaxPopup, |
378 const CFX_RectF& rtAnchor, | 300 const CFX_RectF& rtAnchor, |
379 CFX_RectF& rtPopup) = 0; | 301 CFX_RectF& rtPopup) = 0; |
380 virtual FX_BOOL PopupMenu(IXFA_Widget* hWidget, | 302 virtual FX_BOOL PopupMenu(CXFA_FFWidget* hWidget, |
381 CFX_PointF ptPopup, | 303 CFX_PointF ptPopup, |
382 const CFX_RectF* pRectExclude = NULL) = 0; | 304 const CFX_RectF* pRectExclude = NULL) = 0; |
383 virtual void PageViewEvent(IXFA_PageView* pPageView, uint32_t dwFlags) = 0; | 305 virtual void PageViewEvent(CXFA_FFPageView* pPageView, uint32_t dwFlags) = 0; |
384 virtual void WidgetEvent(IXFA_Widget* hWidget, | 306 virtual void WidgetEvent(CXFA_FFWidget* hWidget, |
385 CXFA_WidgetAcc* pWidgetData, | 307 CXFA_WidgetAcc* pWidgetData, |
386 uint32_t dwEvent, | 308 uint32_t dwEvent, |
387 void* pParam = NULL, | 309 void* pParam = NULL, |
388 void* pAdditional = NULL) = 0; | 310 void* pAdditional = NULL) = 0; |
389 virtual FX_BOOL RenderCustomWidget(IXFA_Widget* hWidget, | 311 virtual FX_BOOL RenderCustomWidget(CXFA_FFWidget* hWidget, |
390 CFX_Graphics* pGS, | 312 CFX_Graphics* pGS, |
391 CFX_Matrix* pMatrix, | 313 CFX_Matrix* pMatrix, |
392 const CFX_RectF& rtUI) { | 314 const CFX_RectF& rtUI) { |
393 return FALSE; | 315 return FALSE; |
394 } | 316 } |
395 virtual int32_t CountPages(IXFA_Doc* hDoc) = 0; | 317 virtual int32_t CountPages(CXFA_FFDoc* hDoc) = 0; |
396 virtual int32_t GetCurrentPage(IXFA_Doc* hDoc) = 0; | 318 virtual int32_t GetCurrentPage(CXFA_FFDoc* hDoc) = 0; |
397 virtual void SetCurrentPage(IXFA_Doc* hDoc, int32_t iCurPage) = 0; | 319 virtual void SetCurrentPage(CXFA_FFDoc* hDoc, int32_t iCurPage) = 0; |
398 virtual FX_BOOL IsCalculationsEnabled(IXFA_Doc* hDoc) = 0; | 320 virtual FX_BOOL IsCalculationsEnabled(CXFA_FFDoc* hDoc) = 0; |
399 virtual void SetCalculationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled) = 0; | 321 virtual void SetCalculationsEnabled(CXFA_FFDoc* hDoc, FX_BOOL bEnabled) = 0; |
400 virtual void GetTitle(IXFA_Doc* hDoc, CFX_WideString& wsTitle) = 0; | 322 virtual void GetTitle(CXFA_FFDoc* hDoc, CFX_WideString& wsTitle) = 0; |
401 virtual void SetTitle(IXFA_Doc* hDoc, const CFX_WideStringC& wsTitle) = 0; | 323 virtual void SetTitle(CXFA_FFDoc* hDoc, const CFX_WideStringC& wsTitle) = 0; |
402 virtual void ExportData(IXFA_Doc* hDoc, | 324 virtual void ExportData(CXFA_FFDoc* hDoc, |
403 const CFX_WideStringC& wsFilePath, | 325 const CFX_WideStringC& wsFilePath, |
404 FX_BOOL bXDP = TRUE) = 0; | 326 FX_BOOL bXDP = TRUE) = 0; |
405 virtual void ImportData(IXFA_Doc* hDoc, | 327 virtual void ImportData(CXFA_FFDoc* hDoc, |
406 const CFX_WideStringC& wsFilePath) = 0; | 328 const CFX_WideStringC& wsFilePath) = 0; |
407 virtual void GotoURL(IXFA_Doc* hDoc, | 329 virtual void GotoURL(CXFA_FFDoc* hDoc, |
408 const CFX_WideStringC& bsURL, | 330 const CFX_WideStringC& bsURL, |
409 FX_BOOL bAppend = TRUE) = 0; | 331 FX_BOOL bAppend = TRUE) = 0; |
410 virtual FX_BOOL IsValidationsEnabled(IXFA_Doc* hDoc) = 0; | 332 virtual FX_BOOL IsValidationsEnabled(CXFA_FFDoc* hDoc) = 0; |
411 virtual void SetValidationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled) = 0; | 333 virtual void SetValidationsEnabled(CXFA_FFDoc* hDoc, FX_BOOL bEnabled) = 0; |
412 virtual void SetFocusWidget(IXFA_Doc* hDoc, IXFA_Widget* hWidget) = 0; | 334 virtual void SetFocusWidget(CXFA_FFDoc* hDoc, CXFA_FFWidget* hWidget) = 0; |
413 virtual void Print(IXFA_Doc* hDoc, | 335 virtual void Print(CXFA_FFDoc* hDoc, |
414 int32_t nStartPage, | 336 int32_t nStartPage, |
415 int32_t nEndPage, | 337 int32_t nEndPage, |
416 uint32_t dwOptions) = 0; | 338 uint32_t dwOptions) = 0; |
417 virtual int32_t AbsPageCountInBatch(IXFA_Doc* hDoc) = 0; | 339 virtual int32_t AbsPageCountInBatch(CXFA_FFDoc* hDoc) = 0; |
418 virtual int32_t AbsPageInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget) = 0; | 340 virtual int32_t AbsPageInBatch(CXFA_FFDoc* hDoc, CXFA_FFWidget* hWidget) = 0; |
419 virtual int32_t SheetCountInBatch(IXFA_Doc* hDoc) = 0; | 341 virtual int32_t SheetCountInBatch(CXFA_FFDoc* hDoc) = 0; |
420 virtual int32_t SheetInBatch(IXFA_Doc* hDoc, IXFA_Widget* hWidget) = 0; | 342 virtual int32_t SheetInBatch(CXFA_FFDoc* hDoc, CXFA_FFWidget* hWidget) = 0; |
421 virtual int32_t Verify(IXFA_Doc* hDoc, | 343 virtual int32_t Verify(CXFA_FFDoc* hDoc, |
422 CXFA_Node* pSigNode, | 344 CXFA_Node* pSigNode, |
423 FX_BOOL bUsed = TRUE) { | 345 FX_BOOL bUsed = TRUE) { |
424 return 0; | 346 return 0; |
425 } | 347 } |
426 virtual FX_BOOL Sign(IXFA_Doc* hDoc, | 348 virtual FX_BOOL Sign(CXFA_FFDoc* hDoc, |
427 CXFA_NodeList* pNodeList, | 349 CXFA_NodeList* pNodeList, |
428 const CFX_WideStringC& wsExpression, | 350 const CFX_WideStringC& wsExpression, |
429 const CFX_WideStringC& wsXMLIdent, | 351 const CFX_WideStringC& wsXMLIdent, |
430 const CFX_WideStringC& wsValue = FX_WSTRC(L"open"), | 352 const CFX_WideStringC& wsValue = FX_WSTRC(L"open"), |
431 FX_BOOL bUsed = TRUE) { | 353 FX_BOOL bUsed = TRUE) { |
432 return 0; | 354 return 0; |
433 } | 355 } |
434 virtual CXFA_NodeList* Enumerate(IXFA_Doc* hDoc) { return 0; } | 356 virtual CXFA_NodeList* Enumerate(CXFA_FFDoc* hDoc) { return 0; } |
435 virtual FX_BOOL Clear(IXFA_Doc* hDoc, | 357 virtual FX_BOOL Clear(CXFA_FFDoc* hDoc, |
436 CXFA_Node* pSigNode, | 358 CXFA_Node* pSigNode, |
437 FX_BOOL bCleared = TRUE) { | 359 FX_BOOL bCleared = TRUE) { |
438 return 0; | 360 return 0; |
439 } | 361 } |
440 virtual void GetURL(IXFA_Doc* hDoc, CFX_WideString& wsDocURL) = 0; | 362 virtual void GetURL(CXFA_FFDoc* hDoc, CFX_WideString& wsDocURL) = 0; |
441 virtual FX_ARGB GetHighlightColor(IXFA_Doc* hDoc) = 0; | 363 virtual FX_ARGB GetHighlightColor(CXFA_FFDoc* hDoc) = 0; |
442 | 364 |
443 virtual FX_BOOL SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit) = 0; | 365 virtual FX_BOOL SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) = 0; |
444 virtual FX_BOOL CheckWord(IXFA_Doc* hDoc, const CFX_ByteStringC& sWord) = 0; | 366 virtual FX_BOOL CheckWord(CXFA_FFDoc* hDoc, const CFX_ByteStringC& sWord) = 0; |
445 virtual FX_BOOL GetSuggestWords(IXFA_Doc* hDoc, | 367 virtual FX_BOOL GetSuggestWords(CXFA_FFDoc* hDoc, |
446 const CFX_ByteStringC& sWord, | 368 const CFX_ByteStringC& sWord, |
447 std::vector<CFX_ByteString>& sSuggest) = 0; | 369 std::vector<CFX_ByteString>& sSuggest) = 0; |
448 virtual FX_BOOL GetPDFScriptObject(IXFA_Doc* hDoc, | 370 virtual FX_BOOL GetPDFScriptObject(CXFA_FFDoc* hDoc, |
449 const CFX_ByteStringC& utf8Name, | 371 const CFX_ByteStringC& utf8Name, |
450 FXJSE_HVALUE hValue) = 0; | 372 FXJSE_HVALUE hValue) = 0; |
451 virtual FX_BOOL GetGlobalProperty(IXFA_Doc* hDoc, | 373 virtual FX_BOOL GetGlobalProperty(CXFA_FFDoc* hDoc, |
452 const CFX_ByteStringC& szPropName, | 374 const CFX_ByteStringC& szPropName, |
453 FXJSE_HVALUE hValue) = 0; | 375 FXJSE_HVALUE hValue) = 0; |
454 virtual FX_BOOL SetGlobalProperty(IXFA_Doc* hDoc, | 376 virtual FX_BOOL SetGlobalProperty(CXFA_FFDoc* hDoc, |
455 const CFX_ByteStringC& szPropName, | 377 const CFX_ByteStringC& szPropName, |
456 FXJSE_HVALUE hValue) = 0; | 378 FXJSE_HVALUE hValue) = 0; |
457 virtual CPDF_Document* OpenPDF(IXFA_Doc* hDoc, | 379 virtual CPDF_Document* OpenPDF(CXFA_FFDoc* hDoc, |
458 IFX_FileRead* pFile, | 380 IFX_FileRead* pFile, |
459 FX_BOOL bTakeOverFile) = 0; | 381 FX_BOOL bTakeOverFile) = 0; |
460 virtual IFX_FileRead* OpenLinkedFile(IXFA_Doc* hDoc, | 382 virtual IFX_FileRead* OpenLinkedFile(CXFA_FFDoc* hDoc, |
461 const CFX_WideString& wsLink) = 0; | 383 const CFX_WideString& wsLink) = 0; |
462 }; | 384 }; |
463 #define XFA_DOCVIEW_View 0x00000000 | 385 #define XFA_DOCVIEW_View 0x00000000 |
464 #define XFA_DOCVIEW_MasterPage 0x00000001 | 386 #define XFA_DOCVIEW_MasterPage 0x00000001 |
465 #define XFA_DOCVIEW_Design 0x00000002 | 387 #define XFA_DOCVIEW_Design 0x00000002 |
466 #define XFA_DOCTYPE_Dynamic 0 | 388 #define XFA_DOCTYPE_Dynamic 0 |
467 #define XFA_DOCTYPE_Static 1 | 389 #define XFA_DOCTYPE_Static 1 |
468 #define XFA_DOCTYPE_XDP 2 | 390 #define XFA_DOCTYPE_XDP 2 |
469 #define XFA_PARSESTATUS_StatusErr -3 | 391 #define XFA_PARSESTATUS_StatusErr -3 |
470 #define XFA_PARSESTATUS_StreamErr -2 | 392 #define XFA_PARSESTATUS_StreamErr -2 |
471 #define XFA_PARSESTATUS_SyntaxErr -1 | 393 #define XFA_PARSESTATUS_SyntaxErr -1 |
472 #define XFA_PARSESTATUS_Ready 0 | 394 #define XFA_PARSESTATUS_Ready 0 |
473 #define XFA_PARSESTATUS_Done 100 | 395 #define XFA_PARSESTATUS_Done 100 |
474 class IXFA_DocHandler { | |
475 public: | |
476 virtual ~IXFA_DocHandler() {} | |
477 | 396 |
478 virtual void ReleaseDoc(IXFA_Doc* hDoc) = 0; | |
479 virtual IXFA_DocProvider* GetDocProvider(IXFA_Doc* hDoc) = 0; | |
480 | |
481 virtual uint32_t GetDocType(IXFA_Doc* hDoc) = 0; | |
482 virtual int32_t StartLoad(IXFA_Doc* hDoc) = 0; | |
483 virtual int32_t DoLoad(IXFA_Doc* hDoc, IFX_Pause* pPause = NULL) = 0; | |
484 virtual void StopLoad(IXFA_Doc* hDoc) = 0; | |
485 | |
486 virtual IXFA_DocView* CreateDocView(IXFA_Doc* hDoc, uint32_t dwView = 0) = 0; | |
487 | |
488 virtual int32_t CountPackages(IXFA_Doc* hDoc) = 0; | |
489 virtual void GetPackageName(IXFA_Doc* hDoc, | |
490 int32_t iPackage, | |
491 CFX_WideStringC& wsPackage) = 0; | |
492 | |
493 virtual FX_BOOL SavePackage(IXFA_Doc* hDoc, | |
494 const CFX_WideStringC& wsPackage, | |
495 IFX_FileWrite* pFile, | |
496 IXFA_ChecksumContext* pCSContext = NULL) = 0; | |
497 virtual FX_BOOL CloseDoc(IXFA_Doc* hDoc) = 0; | |
498 | |
499 virtual FX_BOOL ImportData(IXFA_Doc* hDoc, | |
500 IFX_FileRead* pStream, | |
501 FX_BOOL bXDP = TRUE) = 0; | |
502 virtual void SetJSERuntime(IXFA_Doc* hDoc, FXJSE_HRUNTIME hRuntime) = 0; | |
503 virtual FXJSE_HVALUE GetXFAScriptObject(IXFA_Doc* hDoc) = 0; | |
504 virtual XFA_ATTRIBUTEENUM GetRestoreState(IXFA_Doc* hDoc) = 0; | |
505 virtual FX_BOOL RunDocScript(IXFA_Doc* hDoc, | |
506 XFA_SCRIPTTYPE eScriptType, | |
507 const CFX_WideStringC& wsScript, | |
508 FXJSE_HVALUE hRetValue, | |
509 FXJSE_HVALUE hThisObject) = 0; | |
510 }; | |
511 enum XFA_EVENTTYPE { | 397 enum XFA_EVENTTYPE { |
512 XFA_EVENT_Click, | 398 XFA_EVENT_Click, |
513 XFA_EVENT_Change, | 399 XFA_EVENT_Change, |
514 XFA_EVENT_DocClose, | 400 XFA_EVENT_DocClose, |
515 XFA_EVENT_DocReady, | 401 XFA_EVENT_DocReady, |
516 XFA_EVENT_Enter, | 402 XFA_EVENT_Enter, |
517 XFA_EVENT_Exit, | 403 XFA_EVENT_Exit, |
518 XFA_EVENT_Full, | 404 XFA_EVENT_Full, |
519 XFA_EVENT_IndexChange, | 405 XFA_EVENT_IndexChange, |
520 XFA_EVENT_Initialize, | 406 XFA_EVENT_Initialize, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 FX_BOOL m_bIsFormReady; | 480 FX_BOOL m_bIsFormReady; |
595 int32_t m_iValidateActivities; | 481 int32_t m_iValidateActivities; |
596 }; | 482 }; |
597 #define XFA_EVENTERROR_Success 1 | 483 #define XFA_EVENTERROR_Success 1 |
598 #define XFA_EVENTERROR_Error -1 | 484 #define XFA_EVENTERROR_Error -1 |
599 #define XFA_EVENTERROR_NotExist 0 | 485 #define XFA_EVENTERROR_NotExist 0 |
600 #define XFA_EVENTERROR_Disabled 2 | 486 #define XFA_EVENTERROR_Disabled 2 |
601 enum XFA_WIDGETORDER { | 487 enum XFA_WIDGETORDER { |
602 XFA_WIDGETORDER_PreOrder, | 488 XFA_WIDGETORDER_PreOrder, |
603 }; | 489 }; |
604 class IXFA_DocView { | |
605 public: | |
606 virtual ~IXFA_DocView() {} | |
607 | 490 |
608 virtual IXFA_Doc* GetDoc() = 0; | |
609 virtual int32_t StartLayout(int32_t iStartPage = 0) = 0; | |
610 virtual int32_t DoLayout(IFX_Pause* pPause = NULL) = 0; | |
611 virtual void StopLayout() = 0; | |
612 | |
613 virtual int32_t GetLayoutStatus() = 0; | |
614 virtual void UpdateDocView() = 0; | |
615 virtual int32_t CountPageViews() = 0; | |
616 virtual IXFA_PageView* GetPageView(int32_t nIndex) = 0; | |
617 virtual IXFA_Widget* GetWidgetByName(const CFX_WideStringC& wsName) = 0; | |
618 virtual CXFA_WidgetAcc* GetWidgetAccByName(const CFX_WideStringC& wsName) = 0; | |
619 virtual void ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc = NULL) = 0; | |
620 virtual int32_t ProcessWidgetEvent(CXFA_EventParam* pParam, | |
621 CXFA_WidgetAcc* pWidgetAcc = NULL) = 0; | |
622 virtual IXFA_WidgetHandler* GetWidgetHandler() = 0; | |
623 virtual IXFA_WidgetIterator* CreateWidgetIterator() = 0; | |
624 virtual IXFA_WidgetAccIterator* CreateWidgetAccIterator( | |
625 XFA_WIDGETORDER eOrder = XFA_WIDGETORDER_PreOrder) = 0; | |
626 virtual IXFA_Widget* GetFocusWidget() = 0; | |
627 virtual void KillFocus() = 0; | |
628 virtual FX_BOOL SetFocus(IXFA_Widget* hWidget) = 0; | |
629 }; | |
630 #define XFA_TRAVERSEWAY_Tranvalse 0x0001 | 491 #define XFA_TRAVERSEWAY_Tranvalse 0x0001 |
631 #define XFA_TRAVERSEWAY_Form 0x0002 | 492 #define XFA_TRAVERSEWAY_Form 0x0002 |
632 #define XFA_WIDGETFILTER_Visible 0x0001 | 493 #define XFA_WIDGETFILTER_Visible 0x0001 |
633 #define XFA_WIDGETFILTER_Viewable 0x0010 | 494 #define XFA_WIDGETFILTER_Viewable 0x0010 |
634 #define XFA_WIDGETFILTER_Printable 0x0020 | 495 #define XFA_WIDGETFILTER_Printable 0x0020 |
635 #define XFA_WIDGETFILTER_Field 0x0100 | 496 #define XFA_WIDGETFILTER_Field 0x0100 |
636 #define XFA_WIDGETFILTER_AllType 0x0F00 | 497 #define XFA_WIDGETFILTER_AllType 0x0F00 |
637 class IXFA_PageView { | |
638 public: | |
639 virtual ~IXFA_PageView() {} | |
640 | 498 |
641 virtual IXFA_DocView* GetDocView() = 0; | |
642 virtual int32_t GetPageViewIndex() = 0; | |
643 virtual void GetPageViewRect(CFX_RectF& rtPage) = 0; | |
644 | |
645 virtual void GetDisplayMatrix(CFX_Matrix& mt, | |
646 const CFX_Rect& rtDisp, | |
647 int32_t iRotate) = 0; | |
648 | |
649 virtual int32_t LoadPageView(IFX_Pause* pPause = NULL) = 0; | |
650 virtual void UnloadPageView() = 0; | |
651 virtual IXFA_Widget* GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy) = 0; | |
652 virtual IXFA_WidgetIterator* CreateWidgetIterator( | |
653 uint32_t dwTraverseWay = XFA_TRAVERSEWAY_Form, | |
654 uint32_t dwWidgetFilter = XFA_WIDGETFILTER_Visible | | |
655 XFA_WIDGETFILTER_Viewable | | |
656 XFA_WIDGETFILTER_AllType) = 0; | |
657 }; | |
658 class CXFA_RenderOptions { | 499 class CXFA_RenderOptions { |
659 public: | 500 public: |
660 CXFA_RenderOptions() : m_bPrint(FALSE), m_bHighlight(TRUE) {} | 501 CXFA_RenderOptions() : m_bPrint(FALSE), m_bHighlight(TRUE) {} |
661 FX_BOOL m_bPrint; | 502 FX_BOOL m_bPrint; |
662 FX_BOOL m_bHighlight; | 503 FX_BOOL m_bHighlight; |
663 }; | 504 }; |
664 #define XFA_RENDERSTATUS_Ready 1 | 505 #define XFA_RENDERSTATUS_Ready 1 |
665 #define XFA_RENDERSTATUS_ToBeContinued 2 | 506 #define XFA_RENDERSTATUS_ToBeContinued 2 |
666 #define XFA_RENDERSTATUS_Done 3 | 507 #define XFA_RENDERSTATUS_Done 3 |
667 #define XFA_RENDERSTATUS_Failed -1 | 508 #define XFA_RENDERSTATUS_Failed -1 |
668 class IXFA_RenderContext { | |
669 public: | |
670 virtual void Release() = 0; | |
671 virtual int32_t StartRender(IXFA_PageView* pPageView, | |
672 CFX_Graphics* pGS, | |
673 const CFX_Matrix& pMatrix, | |
674 const CXFA_RenderOptions& options) = 0; | |
675 virtual int32_t DoRender(IFX_Pause* pPause = NULL) = 0; | |
676 virtual void StopRender() = 0; | |
677 | 509 |
678 protected: | |
679 ~IXFA_RenderContext() {} | |
680 }; | |
681 IXFA_RenderContext* XFA_RenderContext_Create(); | |
682 enum XFA_WIDGETTYPE { | 510 enum XFA_WIDGETTYPE { |
683 XFA_WIDGETTYPE_Barcode, | 511 XFA_WIDGETTYPE_Barcode, |
684 XFA_WIDGETTYPE_PushButton, | 512 XFA_WIDGETTYPE_PushButton, |
685 XFA_WIDGETTYPE_CheckButton, | 513 XFA_WIDGETTYPE_CheckButton, |
686 XFA_WIDGETTYPE_RadioButton, | 514 XFA_WIDGETTYPE_RadioButton, |
687 XFA_WIDGETTYPE_DatetimeEdit, | 515 XFA_WIDGETTYPE_DatetimeEdit, |
688 XFA_WIDGETTYPE_DecimalField, | 516 XFA_WIDGETTYPE_DecimalField, |
689 XFA_WIDGETTYPE_NumericField, | 517 XFA_WIDGETTYPE_NumericField, |
690 XFA_WIDGETTYPE_Signature, | 518 XFA_WIDGETTYPE_Signature, |
691 XFA_WIDGETTYPE_TextEdit, | 519 XFA_WIDGETTYPE_TextEdit, |
692 XFA_WIDGETTYPE_DropdownList, | 520 XFA_WIDGETTYPE_DropdownList, |
693 XFA_WIDGETTYPE_ListBox, | 521 XFA_WIDGETTYPE_ListBox, |
694 XFA_WIDGETTYPE_ImageField, | 522 XFA_WIDGETTYPE_ImageField, |
695 XFA_WIDGETTYPE_PasswordEdit, | 523 XFA_WIDGETTYPE_PasswordEdit, |
696 XFA_WIDGETTYPE_Arc, | 524 XFA_WIDGETTYPE_Arc, |
697 XFA_WIDGETTYPE_Rectangle, | 525 XFA_WIDGETTYPE_Rectangle, |
698 XFA_WIDGETTYPE_Image, | 526 XFA_WIDGETTYPE_Image, |
699 XFA_WIDGETTYPE_Line, | 527 XFA_WIDGETTYPE_Line, |
700 XFA_WIDGETTYPE_Text, | 528 XFA_WIDGETTYPE_Text, |
701 XFA_WIDGETTYPE_ExcludeGroup, | 529 XFA_WIDGETTYPE_ExcludeGroup, |
702 XFA_WIDGETTYPE_Subform, | 530 XFA_WIDGETTYPE_Subform, |
703 XFA_WIDGETTYPE_Unknown, | 531 XFA_WIDGETTYPE_Unknown, |
704 }; | 532 }; |
705 #define XFA_WIDGETSTATUS_Visible 0x00000001 | 533 #define XFA_WIDGETSTATUS_Visible 0x00000001 |
706 #define XFA_WIDGETSTATUS_Invisible 0x00000002 | 534 #define XFA_WIDGETSTATUS_Invisible 0x00000002 |
707 #define XFA_WIDGETSTATUS_Hidden 0x00000004 | 535 #define XFA_WIDGETSTATUS_Hidden 0x00000004 |
708 #define XFA_WIDGETSTATUS_Viewable 0x00000010 | 536 #define XFA_WIDGETSTATUS_Viewable 0x00000010 |
709 #define XFA_WIDGETSTATUS_Printable 0x00000020 | 537 #define XFA_WIDGETSTATUS_Printable 0x00000020 |
710 #define XFA_WIDGETSTATUS_Focused 0x00000100 | 538 #define XFA_WIDGETSTATUS_Focused 0x00000100 |
711 class IXFA_WidgetHandler { | |
712 public: | |
713 virtual ~IXFA_WidgetHandler() {} | |
714 | 539 |
715 virtual IXFA_Widget* CreateWidget(IXFA_Widget* hParent, | |
716 XFA_WIDGETTYPE eType, | |
717 IXFA_Widget* hBefore = NULL) = 0; | |
718 virtual IXFA_PageView* GetPageView(IXFA_Widget* hWidget) = 0; | |
719 virtual void GetRect(IXFA_Widget* hWidget, CFX_RectF& rt) = 0; | |
720 virtual uint32_t GetStatus(IXFA_Widget* hWidget) = 0; | |
721 virtual FX_BOOL GetBBox(IXFA_Widget* hWidget, | |
722 CFX_RectF& rtBox, | |
723 uint32_t dwStatus, | |
724 FX_BOOL bDrawFocus = FALSE) = 0; | |
725 virtual CXFA_WidgetAcc* GetDataAcc(IXFA_Widget* hWidget) = 0; | |
726 | |
727 virtual void GetName(IXFA_Widget* hWidget, | |
728 CFX_WideString& wsName, | |
729 int32_t iNameType = 0) = 0; | |
730 virtual FX_BOOL GetToolTip(IXFA_Widget* hWidget, | |
731 CFX_WideString& wsToolTip) = 0; | |
732 virtual void SetPrivateData(IXFA_Widget* hWidget, | |
733 void* module_id, | |
734 void* pData, | |
735 PD_CALLBACK_FREEDATA callback) = 0; | |
736 virtual void* GetPrivateData(IXFA_Widget* hWidget, void* module_id) = 0; | |
737 virtual FX_BOOL OnMouseEnter(IXFA_Widget* hWidget) = 0; | |
738 virtual FX_BOOL OnMouseExit(IXFA_Widget* hWidget) = 0; | |
739 virtual FX_BOOL OnLButtonDown(IXFA_Widget* hWidget, | |
740 uint32_t dwFlags, | |
741 FX_FLOAT fx, | |
742 FX_FLOAT fy) = 0; | |
743 virtual FX_BOOL OnLButtonUp(IXFA_Widget* hWidget, | |
744 uint32_t dwFlags, | |
745 FX_FLOAT fx, | |
746 FX_FLOAT fy) = 0; | |
747 virtual FX_BOOL OnLButtonDblClk(IXFA_Widget* hWidget, | |
748 uint32_t dwFlags, | |
749 FX_FLOAT fx, | |
750 FX_FLOAT fy) = 0; | |
751 virtual FX_BOOL OnMouseMove(IXFA_Widget* hWidget, | |
752 uint32_t dwFlags, | |
753 FX_FLOAT fx, | |
754 FX_FLOAT fy) = 0; | |
755 virtual FX_BOOL OnMouseWheel(IXFA_Widget* hWidget, | |
756 uint32_t dwFlags, | |
757 int16_t zDelta, | |
758 FX_FLOAT fx, | |
759 FX_FLOAT fy) = 0; | |
760 virtual FX_BOOL OnRButtonDown(IXFA_Widget* hWidget, | |
761 uint32_t dwFlags, | |
762 FX_FLOAT fx, | |
763 FX_FLOAT fy) = 0; | |
764 virtual FX_BOOL OnRButtonUp(IXFA_Widget* hWidget, | |
765 uint32_t dwFlags, | |
766 FX_FLOAT fx, | |
767 FX_FLOAT fy) = 0; | |
768 virtual FX_BOOL OnRButtonDblClk(IXFA_Widget* hWidget, | |
769 uint32_t dwFlags, | |
770 FX_FLOAT fx, | |
771 FX_FLOAT fy) = 0; | |
772 | |
773 virtual FX_BOOL OnKeyDown(IXFA_Widget* hWidget, | |
774 uint32_t dwKeyCode, | |
775 uint32_t dwFlags) = 0; | |
776 virtual FX_BOOL OnKeyUp(IXFA_Widget* hWidget, | |
777 uint32_t dwKeyCode, | |
778 uint32_t dwFlags) = 0; | |
779 virtual FX_BOOL OnChar(IXFA_Widget* hWidget, | |
780 uint32_t dwChar, | |
781 uint32_t dwFlags) = 0; | |
782 virtual uint32_t OnHitTest(IXFA_Widget* hWidget, | |
783 FX_FLOAT fx, | |
784 FX_FLOAT fy) = 0; | |
785 virtual FX_BOOL OnSetCursor(IXFA_Widget* hWidget, | |
786 FX_FLOAT fx, | |
787 FX_FLOAT fy) = 0; | |
788 | |
789 virtual void RenderWidget(IXFA_Widget* hWidget, | |
790 CFX_Graphics* pGS, | |
791 CFX_Matrix* pMatrix = NULL, | |
792 FX_BOOL bHighlight = FALSE) = 0; | |
793 virtual FX_BOOL HasEvent(CXFA_WidgetAcc* pWidgetAcc, | |
794 XFA_EVENTTYPE eEventType) = 0; | |
795 virtual int32_t ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, | |
796 CXFA_EventParam* pParam) = 0; | |
797 }; | |
798 class IXFA_WidgetIterator { | 540 class IXFA_WidgetIterator { |
799 public: | 541 public: |
800 virtual void Release() = 0; | 542 virtual void Release() = 0; |
801 virtual void Reset() = 0; | 543 virtual void Reset() = 0; |
802 virtual IXFA_Widget* MoveToFirst() = 0; | 544 virtual CXFA_FFWidget* MoveToFirst() = 0; |
803 virtual IXFA_Widget* MoveToLast() = 0; | 545 virtual CXFA_FFWidget* MoveToLast() = 0; |
804 virtual IXFA_Widget* MoveToNext() = 0; | 546 virtual CXFA_FFWidget* MoveToNext() = 0; |
805 virtual IXFA_Widget* MoveToPrevious() = 0; | 547 virtual CXFA_FFWidget* MoveToPrevious() = 0; |
806 virtual IXFA_Widget* GetCurrentWidget() = 0; | 548 virtual CXFA_FFWidget* GetCurrentWidget() = 0; |
807 virtual FX_BOOL SetCurrentWidget(IXFA_Widget* hWidget) = 0; | 549 virtual FX_BOOL SetCurrentWidget(CXFA_FFWidget* hWidget) = 0; |
808 | 550 |
809 protected: | 551 protected: |
810 ~IXFA_WidgetIterator() {} | 552 ~IXFA_WidgetIterator() {} |
811 }; | 553 }; |
812 class IXFA_WidgetAccIterator { | |
813 public: | |
814 virtual void Release() = 0; | |
815 virtual void Reset() = 0; | |
816 virtual CXFA_WidgetAcc* MoveToFirst() = 0; | |
817 virtual CXFA_WidgetAcc* MoveToLast() = 0; | |
818 virtual CXFA_WidgetAcc* MoveToNext() = 0; | |
819 virtual CXFA_WidgetAcc* MoveToPrevious() = 0; | |
820 virtual CXFA_WidgetAcc* GetCurrentWidgetAcc() = 0; | |
821 virtual FX_BOOL SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget) = 0; | |
822 virtual void SkipTree() = 0; | |
823 | |
824 protected: | |
825 ~IXFA_WidgetAccIterator() {} | |
826 }; | |
827 IXFA_WidgetAccIterator* XFA_WidgetAccIterator_Create( | |
828 CXFA_WidgetAcc* pTravelRoot, | |
829 XFA_WIDGETORDER eOrder = XFA_WIDGETORDER_PreOrder); | |
830 class IXFA_ChecksumContext { | |
831 public: | |
832 virtual void Release() = 0; | |
833 | |
834 virtual FX_BOOL StartChecksum() = 0; | |
835 virtual FX_BOOL UpdateChecksum(IFX_FileRead* pSrcFile, | |
836 FX_FILESIZE offset = 0, | |
837 size_t size = 0) = 0; | |
838 virtual void FinishChecksum() = 0; | |
839 virtual void GetChecksum(CFX_ByteString& bsChecksum) = 0; | |
840 | |
841 protected: | |
842 ~IXFA_ChecksumContext() {} | |
843 }; | |
844 IXFA_ChecksumContext* XFA_Checksum_Create(); | |
845 | 554 |
846 #endif // XFA_INCLUDE_FXFA_FXFA_H_ | 555 #endif // XFA_INCLUDE_FXFA_FXFA_H_ |
OLD | NEW |