diff options
author | dsinclair <dsinclair@chromium.org> | 2016-04-06 14:33:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-06 14:33:08 -0700 |
commit | 7222ea6936cbcff886037e4d8d4018e13a7f720f (patch) | |
tree | 2901f6ff4cbd1205a261843f5bc18a31cdc69b69 /xfa/fxfa/include | |
parent | 0b5adb6ead171069aa6f8c49c529f1c6d381e155 (diff) | |
download | pdfium-7222ea6936cbcff886037e4d8d4018e13a7f720f.tar.xz |
Move remaining xfa/include/fxfa files
This CL moves the remaining files in xfa/include/fxfa to xfa/fxfa/include.
Review URL: https://codereview.chromium.org/1864973005
Diffstat (limited to 'xfa/fxfa/include')
-rw-r--r-- | xfa/fxfa/include/DEPS | 3 | ||||
-rw-r--r-- | xfa/fxfa/include/fxfa.h | 555 | ||||
-rw-r--r-- | xfa/fxfa/include/fxfa_basic.h | 1079 | ||||
-rw-r--r-- | xfa/fxfa/include/fxfa_widget.h | 128 | ||||
-rw-r--r-- | xfa/fxfa/include/xfa_checksum.h | 74 | ||||
-rw-r--r-- | xfa/fxfa/include/xfa_ffapp.h | 78 | ||||
-rw-r--r-- | xfa/fxfa/include/xfa_ffdoc.h | 65 | ||||
-rw-r--r-- | xfa/fxfa/include/xfa_ffdochandler.h | 31 | ||||
-rw-r--r-- | xfa/fxfa/include/xfa_ffdocview.h | 172 | ||||
-rw-r--r-- | xfa/fxfa/include/xfa_ffpageview.h | 113 | ||||
-rw-r--r-- | xfa/fxfa/include/xfa_ffwidget.h | 182 | ||||
-rw-r--r-- | xfa/fxfa/include/xfa_ffwidgethandler.h | 127 | ||||
-rw-r--r-- | xfa/fxfa/include/xfa_fontmgr.h | 99 | ||||
-rw-r--r-- | xfa/fxfa/include/xfa_rendercontext.h | 36 |
14 files changed, 2742 insertions, 0 deletions
diff --git a/xfa/fxfa/include/DEPS b/xfa/fxfa/include/DEPS new file mode 100644 index 0000000000..97ccb1faa6 --- /dev/null +++ b/xfa/fxfa/include/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + '+core/fxcodec/include', +] diff --git a/xfa/fxfa/include/fxfa.h b/xfa/fxfa/include/fxfa.h new file mode 100644 index 0000000000..eb99e59110 --- /dev/null +++ b/xfa/fxfa/include/fxfa.h @@ -0,0 +1,555 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_INCLUDE_FXFA_H_ +#define XFA_FXFA_INCLUDE_FXFA_H_ + +#include <vector> + +#include "xfa/fxfa/include/fxfa_basic.h" +#include "xfa/fxfa/include/fxfa_widget.h" + +class CFX_Graphics; +class CPDF_Document; +class CXFA_FFPageView; +class CXFA_Node; +class CXFA_NodeList; +class CXFA_WidgetAcc; +class IFWL_AdapterTimerMgr; +class IFX_Font; +class IXFA_AppProvider; +class IXFA_DocProvider; +class IXFA_WidgetAccIterator; +class IXFA_WidgetIterator; + +#define XFA_MBICON_Error 0 +#define XFA_MBICON_Warning 1 +#define XFA_MBICON_Question 2 +#define XFA_MBICON_Status 3 +#define XFA_MB_OK 0 +#define XFA_MB_OKCancel 1 +#define XFA_MB_YesNo 2 +#define XFA_MB_YesNoCancel 3 +#define XFA_IDOK 1 +#define XFA_IDCancel 2 +#define XFA_IDNo 3 +#define XFA_IDYes 4 +#define XFA_IDS_ValidateFailed 1 +#define XFA_IDS_CalcOverride 2 +#define XFA_IDS_ModifyField 3 +#define XFA_IDS_NotModifyField 4 +#define XFA_IDS_AppName 5 +#define XFA_IDS_ImageFilter 6 +#define XFA_IDS_UNKNOW_CATCHED 7 +#define XFA_IDS_Unable_TO_SET 8 +#define XFA_IDS_VALUE_EXCALMATORY 9 +#define XFA_IDS_INVALID_ENUM_VALUE 10 +#define XFA_IDS_UNSUPPORT_METHOD 11 +#define XFA_IDS_UNSUPPORT_PROP 12 +#define XFA_IDS_INVAlID_PROP_SET 13 +#define XFA_IDS_NOT_DEFAUL_VALUE 14 +#define XFA_IDS_UNABLE_SET_LANGUAGE 15 +#define XFA_IDS_UNABLE_SET_NUMPAGES 16 +#define XFA_IDS_UNABLE_SET_PLATFORM 17 +#define XFA_IDS_UNABLE_SET_VALIDATIONENABLE 18 +#define XFA_IDS_UNABLE_SET_VARIATION 19 +#define XFA_IDS_UNABLE_SET_VERSION 20 +#define XFA_IDS_UNABLE_SET_READY 21 +#define XFA_IDS_NUMBER_OF_OCCUR 22 +#define XFA_IDS_UNABLE_SET_CLASS_NAME 23 +#define XFA_IDS_UNABLE_SET_LENGTH_VALUE 24 +#define XFA_IDS_UNSUPPORT_CHAR 25 +#define XFA_IDS_BAD_SUFFIX 26 +#define XFA_IDS_EXPECTED_IDENT 27 +#define XFA_IDS_EXPECTED_STRING 28 +#define XFA_IDS_INVALIDATE_CHAR 29 +#define XFA_IDS_REDEFINITION 30 +#define XFA_IDS_INVALIDATE_TOKEN 31 +#define XFA_IDS_INVALIDATE_EXPRESSION 32 +#define XFA_IDS_UNDEFINE_IDENTIFIER 33 +#define XFA_IDS_INVALIDATE_LEFTVALUE 34 +#define XFA_IDS_COMPILER_ERROR 35 +#define XFA_IDS_CANNOT_MODIFY_VALUE 36 +#define XFA_IDS_ERROR_PARAMETERS 37 +#define XFA_IDS_EXPECT_ENDIF 38 +#define XFA_IDS_UNEXPECTED_EXPRESSION 39 +#define XFA_IDS_CONDITION_IS_NULL 40 +#define XFA_IDS_ILLEGALBREAK 41 +#define XFA_IDS_ILLEGALCONTINUE 42 +#define XFA_IDS_EXPECTED_OPERATOR 43 +#define XFA_IDS_DIVIDE_ZERO 44 +#define XFA_IDS_CANNOT_COVERT_OBJECT 45 +#define XFA_IDS_NOT_FOUND_CONTAINER 46 +#define XFA_IDS_NOT_FOUND_PROPERTY 47 +#define XFA_IDS_NOT_FOUND_METHOD 48 +#define XFA_IDS_NOT_FOUND_CONST 49 +#define XFA_IDS_NOT_ASSIGN_OBJECT 50 +#define XFA_IDS_IVALIDATE_INSTRUCTION 51 +#define XFA_IDS_EXPECT_NUMBER 52 +#define XFA_IDS_VALIDATE_OUT_ARRAY 53 +#define XFA_IDS_CANNOT_ASSIGN_IDENT 54 +#define XFA_IDS_NOT_FOUNT_FUNCTION 55 +#define XFA_IDS_NOT_ARRAY 56 +#define XFA_IDS_OUT_ARRAY 57 +#define XFA_IDS_NOT_SUPPORT_CALC 58 +#define XFA_IDS_ARGUMENT_NOT_ARRAY 59 +#define XFA_IDS_ARGUMENT_EXPECT_CONTAINER 60 +#define XFA_IDS_ACCESS_PROPERTY_IN_NOT_OBJECT 61 +#define XFA_IDS_FUNCTION_IS_BUILDIN 62 +#define XFA_IDS_ERROR_MSG 63 +#define XFA_IDS_INDEX_OUT_OF_BOUNDS 64 +#define XFA_IDS_INCORRECT_NUMBER_OF_METHOD 65 +#define XFA_IDS_ARGUMENT_MISMATCH 66 +#define XFA_IDS_INVALID_ENUMERATE 67 +#define XFA_IDS_INVALID_APPEND 68 +#define XFA_IDS_SOM_EXPECTED_LIST 69 +#define XFA_IDS_NOT_HAVE_PROPERTY 70 +#define XFA_IDS_INVALID_NODE_TYPE 71 +#define XFA_IDS_VIOLATE_BOUNDARY 72 +#define XFA_IDS_SERVER_DENY 73 +#define XFA_IDS_StringWeekDay_Sun 74 +#define XFA_IDS_StringWeekDay_Mon 75 +#define XFA_IDS_StringWeekDay_Tue 76 +#define XFA_IDS_StringWeekDay_Wed 77 +#define XFA_IDS_StringWeekDay_Thu 78 +#define XFA_IDS_StringWeekDay_Fri 79 +#define XFA_IDS_StringWeekDay_Sat 80 +#define XFA_IDS_StringMonth_Jan 81 +#define XFA_IDS_StringMonth_Feb 82 +#define XFA_IDS_StringMonth_March 83 +#define XFA_IDS_StringMonth_April 84 +#define XFA_IDS_StringMonth_May 85 +#define XFA_IDS_StringMonth_June 86 +#define XFA_IDS_StringMonth_July 87 +#define XFA_IDS_StringMonth_Aug 88 +#define XFA_IDS_StringMonth_Sept 89 +#define XFA_IDS_StringMonth_Oct 90 +#define XFA_IDS_StringMonth_Nov 91 +#define XFA_IDS_StringMonth_Dec 92 +#define XFA_IDS_String_Today 93 +#define XFA_IDS_ValidateLimit 94 +#define XFA_IDS_ValidateNullWarning 95 +#define XFA_IDS_ValidateNullError 96 +#define XFA_IDS_ValidateWarning 97 +#define XFA_IDS_ValidateError 98 +#define XFA_IDS_ValidateNumberError 99 + +// Probably should be called IXFA_AppDelegate. +class IXFA_AppProvider { + public: + virtual ~IXFA_AppProvider() {} + + /** + * Specifies the name of the client application in which a form currently + * exists. Such as Exchange-Pro. + */ + virtual void SetAppType(const CFX_WideStringC& wsAppType) = 0; + virtual void GetAppType(CFX_WideString& wsAppType) = 0; + virtual void SetFoxitAppType(const CFX_WideStringC& wsFoxitAppType) {} + virtual void GetFoxitAppType(CFX_WideString& wsFoxitAppType) { + wsFoxitAppType.Empty(); + } + + /** + * Returns the language of the running host application. Such as zh_CN + */ + virtual void GetLanguage(CFX_WideString& wsLanguage) = 0; + + /** + * Returns the platform of the machine running the script. Such as WIN + */ + virtual void GetPlatform(CFX_WideString& wsPlatform) = 0; + + /** + * Indicates the packaging of the application that is running the script. Such + * as Full + */ + virtual void GetVariation(CFX_WideString& wsVariation) = 0; + + /** + * Indicates the version number of the current application. Such as 9 + */ + virtual void GetVersion(CFX_WideString& wsVersion) = 0; + virtual void GetFoxitVersion(CFX_WideString& wsFoxitVersion) { + wsFoxitVersion.Empty(); + } + + /** + * Get application name, such as Phantom. + */ + virtual void GetAppName(CFX_WideString& wsName) = 0; + virtual void GetFoxitAppName(CFX_WideString& wsFoxitName) { + wsFoxitName.Empty(); + } + + /** + * Causes the system to play a sound. + * @param[in] dwType The system code for the appropriate sound.0 (Error)1 + * (Warning)2 (Question)3 (Status)4 (Default) + */ + virtual void Beep(uint32_t dwType) = 0; + + /** + * Displays a message box. + * @param[in] dwIconType Icon type, refer to XFA_MBICON. + * @param[in] dwButtonType Button type, refer to XFA_MESSAGEBUTTON. + * @return A valid integer representing the value of the button pressed by the + * user, refer to XFA_ID. + */ + virtual int32_t MsgBox(const CFX_WideStringC& wsMessage, + const CFX_WideStringC& wsTitle = FX_WSTRC(L""), + uint32_t dwIconType = 0, + uint32_t dwButtonType = 0) = 0; + + /** + * Get a response from the user. + * @param[in] bMark - Mask the user input with * (asterisks) when true, + */ + virtual void Response(CFX_WideString& wsAnswer, + const CFX_WideStringC& wsQuestion, + const CFX_WideStringC& wsTitle = FX_WSTRC(L""), + const CFX_WideStringC& wsDefaultAnswer = FX_WSTRC(L""), + FX_BOOL bMark = TRUE) = 0; + + virtual int32_t GetDocumentCountInBatch() = 0; + virtual int32_t GetCurDocumentInBatch() = 0; + + /** + * Download something from somewhere. + * @param[in] wsURL - http, ftp, such as + * "http://www.w3.org/TR/REC-xml-names/". + */ + virtual IFX_FileRead* DownloadURL(const CFX_WideStringC& wsURL) = 0; + + /** + * POST data to the given url. + * @param[in] wsURL the URL being uploaded. + * @param[in] wsData the data being uploaded. + * @param[in] wsContentType the content type of data including text/html, + * text/xml, text/plain, multipart/form-data, + * application/x-www-form-urlencoded, + * application/octet-stream, any valid MIME type. + * @param[in] wsEncode the encode of data including UTF-8, UTF-16, + * ISO8859-1, any recognized [IANA]character encoding + * @param[in] wsHeader any additional HTTP headers to be included in the + * post. + * @param[out] wsResponse decoded response from server. + * @return TRUE Server permitted the post request, FALSE otherwise. + */ + virtual FX_BOOL PostRequestURL(const CFX_WideStringC& wsURL, + const CFX_WideStringC& wsData, + const CFX_WideStringC& wsContentType, + const CFX_WideStringC& wsEncode, + const CFX_WideStringC& wsHeader, + CFX_WideString& wsResponse) = 0; + + /** + * PUT data to the given url. + * @param[in] wsURL the URL being uploaded. + * @param[in] wsData the data being uploaded. + * @param[in] wsEncode the encode of data including UTF-8, UTF-16, + * ISO8859-1, any recognized [IANA]character encoding + * @return TRUE Server permitted the post request, FALSE otherwise. + */ + virtual FX_BOOL PutRequestURL(const CFX_WideStringC& wsURL, + const CFX_WideStringC& wsData, + const CFX_WideStringC& wsEncode) = 0; + + virtual void LoadString(int32_t iStringID, CFX_WideString& wsString) = 0; + virtual FX_BOOL ShowFileDialog(const CFX_WideStringC& wsTitle, + const CFX_WideStringC& wsFilter, + CFX_WideStringArray& wsPathArr, + FX_BOOL bOpen = TRUE) = 0; + virtual IFWL_AdapterTimerMgr* GetTimerMgr() = 0; +}; + +#define XFA_INVALIDATE_AllPages 0x00000000 +#define XFA_INVALIDATE_CurrentPage 0x00000001 +#define XFA_PRINTOPT_ShowDialog 0x00000001 +#define XFA_PRINTOPT_CanCancel 0x00000002 +#define XFA_PRINTOPT_ShrinkPage 0x00000004 +#define XFA_PRINTOPT_AsImage 0x00000008 +#define XFA_PRINTOPT_ReverseOrder 0x00000010 +#define XFA_PRINTOPT_PrintAnnot 0x00000020 +#define XFA_PAGEVIEWEVENT_PostAdded 1 +#define XFA_PAGEVIEWEVENT_PostRemoved 3 +#define XFA_PAGEVIEWEVENT_StopLayout 4 +#define XFA_WIDGETEVENT_PostAdded 2 +#define XFA_WIDGETEVENT_PreRemoved 3 +#define XFA_WIDGETEVENT_PostContentChanged 6 +#define XFA_WIDGETEVENT_ListItemRemoved 7 +#define XFA_WIDGETEVENT_ListItemAdded 8 +#define XFA_WIDGETEVENT_AccessChanged 9 +class IXFA_DocProvider { + public: + virtual ~IXFA_DocProvider() {} + + virtual void SetChangeMark(CXFA_FFDoc* hDoc) = 0; + virtual void InvalidateRect(CXFA_FFPageView* pPageView, + const CFX_RectF& rt, + uint32_t dwFlags = 0) = 0; + virtual void DisplayCaret(CXFA_FFWidget* hWidget, + FX_BOOL bVisible, + const CFX_RectF* pRtAnchor) = 0; + virtual FX_BOOL GetPopupPos(CXFA_FFWidget* hWidget, + FX_FLOAT fMinPopup, + FX_FLOAT fMaxPopup, + const CFX_RectF& rtAnchor, + CFX_RectF& rtPopup) = 0; + virtual FX_BOOL PopupMenu(CXFA_FFWidget* hWidget, + CFX_PointF ptPopup, + const CFX_RectF* pRectExclude = NULL) = 0; + virtual void PageViewEvent(CXFA_FFPageView* pPageView, uint32_t dwFlags) = 0; + virtual void WidgetEvent(CXFA_FFWidget* hWidget, + CXFA_WidgetAcc* pWidgetData, + uint32_t dwEvent, + void* pParam = NULL, + void* pAdditional = NULL) = 0; + virtual FX_BOOL RenderCustomWidget(CXFA_FFWidget* hWidget, + CFX_Graphics* pGS, + CFX_Matrix* pMatrix, + const CFX_RectF& rtUI) { + return FALSE; + } + virtual int32_t CountPages(CXFA_FFDoc* hDoc) = 0; + virtual int32_t GetCurrentPage(CXFA_FFDoc* hDoc) = 0; + virtual void SetCurrentPage(CXFA_FFDoc* hDoc, int32_t iCurPage) = 0; + virtual FX_BOOL IsCalculationsEnabled(CXFA_FFDoc* hDoc) = 0; + virtual void SetCalculationsEnabled(CXFA_FFDoc* hDoc, FX_BOOL bEnabled) = 0; + virtual void GetTitle(CXFA_FFDoc* hDoc, CFX_WideString& wsTitle) = 0; + virtual void SetTitle(CXFA_FFDoc* hDoc, const CFX_WideStringC& wsTitle) = 0; + virtual void ExportData(CXFA_FFDoc* hDoc, + const CFX_WideStringC& wsFilePath, + FX_BOOL bXDP = TRUE) = 0; + virtual void ImportData(CXFA_FFDoc* hDoc, + const CFX_WideStringC& wsFilePath) = 0; + virtual void GotoURL(CXFA_FFDoc* hDoc, + const CFX_WideStringC& bsURL, + FX_BOOL bAppend = TRUE) = 0; + virtual FX_BOOL IsValidationsEnabled(CXFA_FFDoc* hDoc) = 0; + virtual void SetValidationsEnabled(CXFA_FFDoc* hDoc, FX_BOOL bEnabled) = 0; + virtual void SetFocusWidget(CXFA_FFDoc* hDoc, CXFA_FFWidget* hWidget) = 0; + virtual void Print(CXFA_FFDoc* hDoc, + int32_t nStartPage, + int32_t nEndPage, + uint32_t dwOptions) = 0; + virtual int32_t AbsPageCountInBatch(CXFA_FFDoc* hDoc) = 0; + virtual int32_t AbsPageInBatch(CXFA_FFDoc* hDoc, CXFA_FFWidget* hWidget) = 0; + virtual int32_t SheetCountInBatch(CXFA_FFDoc* hDoc) = 0; + virtual int32_t SheetInBatch(CXFA_FFDoc* hDoc, CXFA_FFWidget* hWidget) = 0; + virtual int32_t Verify(CXFA_FFDoc* hDoc, + CXFA_Node* pSigNode, + FX_BOOL bUsed = TRUE) { + return 0; + } + virtual FX_BOOL Sign(CXFA_FFDoc* hDoc, + CXFA_NodeList* pNodeList, + const CFX_WideStringC& wsExpression, + const CFX_WideStringC& wsXMLIdent, + const CFX_WideStringC& wsValue = FX_WSTRC(L"open"), + FX_BOOL bUsed = TRUE) { + return 0; + } + virtual CXFA_NodeList* Enumerate(CXFA_FFDoc* hDoc) { return 0; } + virtual FX_BOOL Clear(CXFA_FFDoc* hDoc, + CXFA_Node* pSigNode, + FX_BOOL bCleared = TRUE) { + return 0; + } + virtual void GetURL(CXFA_FFDoc* hDoc, CFX_WideString& wsDocURL) = 0; + virtual FX_ARGB GetHighlightColor(CXFA_FFDoc* hDoc) = 0; + + virtual FX_BOOL SubmitData(CXFA_FFDoc* hDoc, CXFA_Submit submit) = 0; + virtual FX_BOOL CheckWord(CXFA_FFDoc* hDoc, const CFX_ByteStringC& sWord) = 0; + virtual FX_BOOL GetSuggestWords(CXFA_FFDoc* hDoc, + const CFX_ByteStringC& sWord, + std::vector<CFX_ByteString>& sSuggest) = 0; + virtual FX_BOOL GetPDFScriptObject(CXFA_FFDoc* hDoc, + const CFX_ByteStringC& utf8Name, + FXJSE_HVALUE hValue) = 0; + virtual FX_BOOL GetGlobalProperty(CXFA_FFDoc* hDoc, + const CFX_ByteStringC& szPropName, + FXJSE_HVALUE hValue) = 0; + virtual FX_BOOL SetGlobalProperty(CXFA_FFDoc* hDoc, + const CFX_ByteStringC& szPropName, + FXJSE_HVALUE hValue) = 0; + virtual CPDF_Document* OpenPDF(CXFA_FFDoc* hDoc, + IFX_FileRead* pFile, + FX_BOOL bTakeOverFile) = 0; + virtual IFX_FileRead* OpenLinkedFile(CXFA_FFDoc* hDoc, + const CFX_WideString& wsLink) = 0; +}; +#define XFA_DOCVIEW_View 0x00000000 +#define XFA_DOCVIEW_MasterPage 0x00000001 +#define XFA_DOCVIEW_Design 0x00000002 +#define XFA_DOCTYPE_Dynamic 0 +#define XFA_DOCTYPE_Static 1 +#define XFA_DOCTYPE_XDP 2 +#define XFA_PARSESTATUS_StatusErr -3 +#define XFA_PARSESTATUS_StreamErr -2 +#define XFA_PARSESTATUS_SyntaxErr -1 +#define XFA_PARSESTATUS_Ready 0 +#define XFA_PARSESTATUS_Done 100 + +enum XFA_EVENTTYPE { + XFA_EVENT_Click, + XFA_EVENT_Change, + XFA_EVENT_DocClose, + XFA_EVENT_DocReady, + XFA_EVENT_Enter, + XFA_EVENT_Exit, + XFA_EVENT_Full, + XFA_EVENT_IndexChange, + XFA_EVENT_Initialize, + XFA_EVENT_MouseDown, + XFA_EVENT_MouseEnter, + XFA_EVENT_MouseExit, + XFA_EVENT_MouseUp, + XFA_EVENT_PostExecute, + XFA_EVENT_PostOpen, + XFA_EVENT_PostPrint, + XFA_EVENT_PostSave, + XFA_EVENT_PostSign, + XFA_EVENT_PostSubmit, + XFA_EVENT_PreExecute, + XFA_EVENT_PreOpen, + XFA_EVENT_PrePrint, + XFA_EVENT_PreSave, + XFA_EVENT_PreSign, + XFA_EVENT_PreSubmit, + XFA_EVENT_Ready, + XFA_EVENT_InitCalculate, + XFA_EVENT_InitVariables, + XFA_EVENT_Calculate, + XFA_EVENT_Validate, + XFA_EVENT_Unknown, +}; +#define XFA_VALIDATE_preSubmit 1 +#define XFA_VALIDATE_prePrint 2 +#define XFA_VALIDATE_preExecute 3 +#define XFA_VALIDATE_preSave 4 +class CXFA_EventParam { + public: + CXFA_EventParam() { + m_pTarget = NULL; + m_eType = XFA_EVENT_Unknown; + m_wsResult.Empty(); + Reset(); + } + void Reset() { + m_wsChange.Empty(); + m_iCommitKey = 0; + m_wsFullText.Empty(); + m_bKeyDown = FALSE; + m_bModifier = FALSE; + m_wsNewContentType.Empty(); + m_wsNewText.Empty(); + m_wsPrevContentType.Empty(); + m_wsPrevText.Empty(); + m_bReenter = FALSE; + m_iSelEnd = 0; + m_iSelStart = 0; + m_bShift = FALSE; + m_wsSoapFaultCode.Empty(); + m_wsSoapFaultString.Empty(); + m_bIsFormReady = FALSE; + m_iValidateActivities = XFA_VALIDATE_preSubmit; + } + CXFA_WidgetAcc* m_pTarget; + XFA_EVENTTYPE m_eType; + CFX_WideString m_wsResult; + FX_BOOL m_bCancelAction; + int32_t m_iCommitKey; + FX_BOOL m_bKeyDown; + FX_BOOL m_bModifier; + FX_BOOL m_bReenter; + int32_t m_iSelEnd; + int32_t m_iSelStart; + FX_BOOL m_bShift; + CFX_WideString m_wsChange; + CFX_WideString m_wsFullText; + CFX_WideString m_wsNewContentType; + CFX_WideString m_wsNewText; + CFX_WideString m_wsPrevContentType; + CFX_WideString m_wsPrevText; + CFX_WideString m_wsSoapFaultCode; + CFX_WideString m_wsSoapFaultString; + FX_BOOL m_bIsFormReady; + int32_t m_iValidateActivities; +}; +#define XFA_EVENTERROR_Success 1 +#define XFA_EVENTERROR_Error -1 +#define XFA_EVENTERROR_NotExist 0 +#define XFA_EVENTERROR_Disabled 2 +enum XFA_WIDGETORDER { + XFA_WIDGETORDER_PreOrder, +}; + +#define XFA_TRAVERSEWAY_Tranvalse 0x0001 +#define XFA_TRAVERSEWAY_Form 0x0002 +#define XFA_WIDGETFILTER_Visible 0x0001 +#define XFA_WIDGETFILTER_Viewable 0x0010 +#define XFA_WIDGETFILTER_Printable 0x0020 +#define XFA_WIDGETFILTER_Field 0x0100 +#define XFA_WIDGETFILTER_AllType 0x0F00 + +class CXFA_RenderOptions { + public: + CXFA_RenderOptions() : m_bPrint(FALSE), m_bHighlight(TRUE) {} + FX_BOOL m_bPrint; + FX_BOOL m_bHighlight; +}; +#define XFA_RENDERSTATUS_Ready 1 +#define XFA_RENDERSTATUS_ToBeContinued 2 +#define XFA_RENDERSTATUS_Done 3 +#define XFA_RENDERSTATUS_Failed -1 + +enum XFA_WIDGETTYPE { + XFA_WIDGETTYPE_Barcode, + XFA_WIDGETTYPE_PushButton, + XFA_WIDGETTYPE_CheckButton, + XFA_WIDGETTYPE_RadioButton, + XFA_WIDGETTYPE_DatetimeEdit, + XFA_WIDGETTYPE_DecimalField, + XFA_WIDGETTYPE_NumericField, + XFA_WIDGETTYPE_Signature, + XFA_WIDGETTYPE_TextEdit, + XFA_WIDGETTYPE_DropdownList, + XFA_WIDGETTYPE_ListBox, + XFA_WIDGETTYPE_ImageField, + XFA_WIDGETTYPE_PasswordEdit, + XFA_WIDGETTYPE_Arc, + XFA_WIDGETTYPE_Rectangle, + XFA_WIDGETTYPE_Image, + XFA_WIDGETTYPE_Line, + XFA_WIDGETTYPE_Text, + XFA_WIDGETTYPE_ExcludeGroup, + XFA_WIDGETTYPE_Subform, + XFA_WIDGETTYPE_Unknown, +}; +#define XFA_WIDGETSTATUS_Visible 0x00000001 +#define XFA_WIDGETSTATUS_Invisible 0x00000002 +#define XFA_WIDGETSTATUS_Hidden 0x00000004 +#define XFA_WIDGETSTATUS_Viewable 0x00000010 +#define XFA_WIDGETSTATUS_Printable 0x00000020 +#define XFA_WIDGETSTATUS_Focused 0x00000100 + +class IXFA_WidgetIterator { + public: + virtual void Release() = 0; + virtual void Reset() = 0; + virtual CXFA_FFWidget* MoveToFirst() = 0; + virtual CXFA_FFWidget* MoveToLast() = 0; + virtual CXFA_FFWidget* MoveToNext() = 0; + virtual CXFA_FFWidget* MoveToPrevious() = 0; + virtual CXFA_FFWidget* GetCurrentWidget() = 0; + virtual FX_BOOL SetCurrentWidget(CXFA_FFWidget* hWidget) = 0; + + protected: + ~IXFA_WidgetIterator() {} +}; + +#endif // XFA_FXFA_INCLUDE_FXFA_H_ diff --git a/xfa/fxfa/include/fxfa_basic.h b/xfa/fxfa/include/fxfa_basic.h new file mode 100644 index 0000000000..15fbc85ef4 --- /dev/null +++ b/xfa/fxfa/include/fxfa_basic.h @@ -0,0 +1,1079 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_INCLUDE_FXFA_BASIC_H_ +#define XFA_FXFA_INCLUDE_FXFA_BASIC_H_ + +#include "xfa/fxjse/cfxjse_arguments.h" +#include "xfa/fxjse/include/fxjse.h" + +class CXFA_Measurement; +#define XFA_HASHCODE_Xfa 0xc56b9ff +#define XFA_HASHCODE_Config 0x4e1e39b6 +#define XFA_HASHCODE_Template 0x803550fc +#define XFA_HASHCODE_Datasets 0x99b95079 +#define XFA_HASHCODE_Data 0xbde9abda +#define XFA_HASHCODE_Form 0xcd309ff4 +#define XFA_HASHCODE_LocaleSet 0x5473b6dc +#define XFA_HASHCODE_ConnectionSet 0xe14c801c +#define XFA_HASHCODE_SourceSet 0x811929d +#define XFA_HASHCODE_Xdc 0xc56afbf +#define XFA_HASHCODE_Pdf 0xb843dba +#define XFA_HASHCODE_Xfdf 0x48d004a8 +#define XFA_HASHCODE_Xmpmeta 0x132a8fbc +#define XFA_HASHCODE_Signature 0x8b036f32 +#define XFA_HASHCODE_Stylesheet 0x6038580a +#define XFA_HASHCODE_XDP 0xc56afcc +#define XFA_HASHCODE_Record 0x5779d65f +#define XFA_HASHCODE_DataWindow 0x83a550d2 +#define XFA_HASHCODE_Host 0xdb075bde +#define XFA_HASHCODE_Log 0x0b1b3d22 +#define XFA_HASHCODE_Event 0x185e41e2 +#define XFA_HASHCODE_Layout 0x7e7e845e +#define XFA_HASHCODE_Occur 0xf7eebe1c +#define XFA_HASHCODE_This 0x2d574d58 +#define XFA_HASHCODE_DataDescription 0x2b5df51e +#define XFA_HASHCODE_Name 0x31b19c1 +enum XFA_PACKET { + XFA_PACKET_USER, + XFA_PACKET_SourceSet, + XFA_PACKET_Pdf, + XFA_PACKET_Xdc, + XFA_PACKET_XDP, + XFA_PACKET_Xmpmeta, + XFA_PACKET_Xfdf, + XFA_PACKET_Config, + XFA_PACKET_LocaleSet, + XFA_PACKET_Stylesheet, + XFA_PACKET_Template, + XFA_PACKET_Signature, + XFA_PACKET_Datasets, + XFA_PACKET_Form, + XFA_PACKET_ConnectionSet, +}; +enum XFA_XDPPACKET { + XFA_XDPPACKET_UNKNOWN = 0, + XFA_XDPPACKET_Config = 1 << XFA_PACKET_Config, + XFA_XDPPACKET_Template = 1 << XFA_PACKET_Template, + XFA_XDPPACKET_Datasets = 1 << XFA_PACKET_Datasets, + XFA_XDPPACKET_Form = 1 << XFA_PACKET_Form, + XFA_XDPPACKET_LocaleSet = 1 << XFA_PACKET_LocaleSet, + XFA_XDPPACKET_ConnectionSet = 1 << XFA_PACKET_ConnectionSet, + XFA_XDPPACKET_SourceSet = 1 << XFA_PACKET_SourceSet, + XFA_XDPPACKET_Xdc = 1 << XFA_PACKET_Xdc, + XFA_XDPPACKET_Pdf = 1 << XFA_PACKET_Pdf, + XFA_XDPPACKET_Xfdf = 1 << XFA_PACKET_Xfdf, + XFA_XDPPACKET_Xmpmeta = 1 << XFA_PACKET_Xmpmeta, + XFA_XDPPACKET_Signature = 1 << XFA_PACKET_Signature, + XFA_XDPPACKET_Stylesheet = 1 << XFA_PACKET_Stylesheet, + XFA_XDPPACKET_USER = 1 << XFA_PACKET_USER, + XFA_XDPPACKET_XDP = 1 << XFA_PACKET_XDP, +}; +enum XFA_XDPPACKET_FLAGS { + XFA_XDPPACKET_FLAGS_COMPLETEMATCH = 1, + XFA_XDPPACKET_FLAGS_PREFIXMATCH = 2, + XFA_XDPPACKET_FLAGS_NOMATCH = 4, + XFA_XDPPACKET_FLAGS_SUPPORTONE = 8, + XFA_XDPPACKET_FLAGS_SUPPORTMANY = 16, +}; +struct XFA_PACKETINFO { + uint32_t uHash; + const FX_WCHAR* pName; + XFA_XDPPACKET eName; + const FX_WCHAR* pURI; + uint32_t eFlags; +}; + +const XFA_PACKETINFO* XFA_GetPacketByName(const CFX_WideStringC& wsName); +const XFA_PACKETINFO* XFA_GetPacketByID(uint32_t dwPacket); +const XFA_PACKETINFO* XFA_GetPacketByIndex(XFA_PACKET ePacket); + +enum XFA_ATTRIBUTEENUM { + XFA_ATTRIBUTEENUM_Asterisk, + XFA_ATTRIBUTEENUM_Slash, + XFA_ATTRIBUTEENUM_Backslash, + XFA_ATTRIBUTEENUM_On, + XFA_ATTRIBUTEENUM_Tb, + XFA_ATTRIBUTEENUM_Up, + XFA_ATTRIBUTEENUM_MetaData, + XFA_ATTRIBUTEENUM_Delegate, + XFA_ATTRIBUTEENUM_PostSubmit, + XFA_ATTRIBUTEENUM_Name, + XFA_ATTRIBUTEENUM_Cross, + XFA_ATTRIBUTEENUM_Next, + XFA_ATTRIBUTEENUM_None, + XFA_ATTRIBUTEENUM_ShortEdge, + XFA_ATTRIBUTEENUM_1mod10_1mod11, + XFA_ATTRIBUTEENUM_Height, + XFA_ATTRIBUTEENUM_CrossDiagonal, + XFA_ATTRIBUTEENUM_All, + XFA_ATTRIBUTEENUM_Any, + XFA_ATTRIBUTEENUM_ToRight, + XFA_ATTRIBUTEENUM_MatchTemplate, + XFA_ATTRIBUTEENUM_Dpl, + XFA_ATTRIBUTEENUM_Invisible, + XFA_ATTRIBUTEENUM_Fit, + XFA_ATTRIBUTEENUM_Width, + XFA_ATTRIBUTEENUM_PreSubmit, + XFA_ATTRIBUTEENUM_Ipl, + XFA_ATTRIBUTEENUM_FlateCompress, + XFA_ATTRIBUTEENUM_Med, + XFA_ATTRIBUTEENUM_Odd, + XFA_ATTRIBUTEENUM_Off, + XFA_ATTRIBUTEENUM_Pdf, + XFA_ATTRIBUTEENUM_Row, + XFA_ATTRIBUTEENUM_Top, + XFA_ATTRIBUTEENUM_Xdp, + XFA_ATTRIBUTEENUM_Xfd, + XFA_ATTRIBUTEENUM_Xml, + XFA_ATTRIBUTEENUM_Zip, + XFA_ATTRIBUTEENUM_Zpl, + XFA_ATTRIBUTEENUM_Visible, + XFA_ATTRIBUTEENUM_Exclude, + XFA_ATTRIBUTEENUM_MouseEnter, + XFA_ATTRIBUTEENUM_Pair, + XFA_ATTRIBUTEENUM_Filter, + XFA_ATTRIBUTEENUM_MoveLast, + XFA_ATTRIBUTEENUM_ExportAndImport, + XFA_ATTRIBUTEENUM_Push, + XFA_ATTRIBUTEENUM_Portrait, + XFA_ATTRIBUTEENUM_Default, + XFA_ATTRIBUTEENUM_StoredProc, + XFA_ATTRIBUTEENUM_StayBOF, + XFA_ATTRIBUTEENUM_StayEOF, + XFA_ATTRIBUTEENUM_PostPrint, + XFA_ATTRIBUTEENUM_UsCarrier, + XFA_ATTRIBUTEENUM_Right, + XFA_ATTRIBUTEENUM_PreOpen, + XFA_ATTRIBUTEENUM_Actual, + XFA_ATTRIBUTEENUM_Rest, + XFA_ATTRIBUTEENUM_TopCenter, + XFA_ATTRIBUTEENUM_StandardSymbol, + XFA_ATTRIBUTEENUM_Initialize, + XFA_ATTRIBUTEENUM_JustifyAll, + XFA_ATTRIBUTEENUM_Normal, + XFA_ATTRIBUTEENUM_Landscape, + XFA_ATTRIBUTEENUM_NonInteractive, + XFA_ATTRIBUTEENUM_MouseExit, + XFA_ATTRIBUTEENUM_Minus, + XFA_ATTRIBUTEENUM_DiagonalLeft, + XFA_ATTRIBUTEENUM_SimplexPaginated, + XFA_ATTRIBUTEENUM_Document, + XFA_ATTRIBUTEENUM_Warning, + XFA_ATTRIBUTEENUM_Auto, + XFA_ATTRIBUTEENUM_Below, + XFA_ATTRIBUTEENUM_BottomLeft, + XFA_ATTRIBUTEENUM_BottomCenter, + XFA_ATTRIBUTEENUM_Tcpl, + XFA_ATTRIBUTEENUM_Text, + XFA_ATTRIBUTEENUM_Grouping, + XFA_ATTRIBUTEENUM_SecureSymbol, + XFA_ATTRIBUTEENUM_PreExecute, + XFA_ATTRIBUTEENUM_DocClose, + XFA_ATTRIBUTEENUM_Keyset, + XFA_ATTRIBUTEENUM_Vertical, + XFA_ATTRIBUTEENUM_PreSave, + XFA_ATTRIBUTEENUM_PreSign, + XFA_ATTRIBUTEENUM_Bottom, + XFA_ATTRIBUTEENUM_ToTop, + XFA_ATTRIBUTEENUM_Verify, + XFA_ATTRIBUTEENUM_First, + XFA_ATTRIBUTEENUM_ContentArea, + XFA_ATTRIBUTEENUM_Solid, + XFA_ATTRIBUTEENUM_Pessimistic, + XFA_ATTRIBUTEENUM_DuplexPaginated, + XFA_ATTRIBUTEENUM_Round, + XFA_ATTRIBUTEENUM_Remerge, + XFA_ATTRIBUTEENUM_Ordered, + XFA_ATTRIBUTEENUM_Percent, + XFA_ATTRIBUTEENUM_Even, + XFA_ATTRIBUTEENUM_Exit, + XFA_ATTRIBUTEENUM_ToolTip, + XFA_ATTRIBUTEENUM_OrderedOccurrence, + XFA_ATTRIBUTEENUM_ReadOnly, + XFA_ATTRIBUTEENUM_Currency, + XFA_ATTRIBUTEENUM_Concat, + XFA_ATTRIBUTEENUM_Thai, + XFA_ATTRIBUTEENUM_Embossed, + XFA_ATTRIBUTEENUM_Formdata, + XFA_ATTRIBUTEENUM_Greek, + XFA_ATTRIBUTEENUM_Decimal, + XFA_ATTRIBUTEENUM_Select, + XFA_ATTRIBUTEENUM_LongEdge, + XFA_ATTRIBUTEENUM_Protected, + XFA_ATTRIBUTEENUM_BottomRight, + XFA_ATTRIBUTEENUM_Zero, + XFA_ATTRIBUTEENUM_ForwardOnly, + XFA_ATTRIBUTEENUM_DocReady, + XFA_ATTRIBUTEENUM_Hidden, + XFA_ATTRIBUTEENUM_Include, + XFA_ATTRIBUTEENUM_Dashed, + XFA_ATTRIBUTEENUM_MultiSelect, + XFA_ATTRIBUTEENUM_Inactive, + XFA_ATTRIBUTEENUM_Embed, + XFA_ATTRIBUTEENUM_Static, + XFA_ATTRIBUTEENUM_OnEntry, + XFA_ATTRIBUTEENUM_Cyrillic, + XFA_ATTRIBUTEENUM_NonBlank, + XFA_ATTRIBUTEENUM_TopRight, + XFA_ATTRIBUTEENUM_Hebrew, + XFA_ATTRIBUTEENUM_TopLeft, + XFA_ATTRIBUTEENUM_Center, + XFA_ATTRIBUTEENUM_MoveFirst, + XFA_ATTRIBUTEENUM_Diamond, + XFA_ATTRIBUTEENUM_PageOdd, + XFA_ATTRIBUTEENUM_1mod10, + XFA_ATTRIBUTEENUM_Korean, + XFA_ATTRIBUTEENUM_AboveEmbedded, + XFA_ATTRIBUTEENUM_ZipCompress, + XFA_ATTRIBUTEENUM_Numeric, + XFA_ATTRIBUTEENUM_Circle, + XFA_ATTRIBUTEENUM_ToBottom, + XFA_ATTRIBUTEENUM_Inverted, + XFA_ATTRIBUTEENUM_Update, + XFA_ATTRIBUTEENUM_Isoname, + XFA_ATTRIBUTEENUM_Server, + XFA_ATTRIBUTEENUM_Position, + XFA_ATTRIBUTEENUM_MiddleCenter, + XFA_ATTRIBUTEENUM_Optional, + XFA_ATTRIBUTEENUM_UsePrinterSetting, + XFA_ATTRIBUTEENUM_Outline, + XFA_ATTRIBUTEENUM_IndexChange, + XFA_ATTRIBUTEENUM_Change, + XFA_ATTRIBUTEENUM_PageArea, + XFA_ATTRIBUTEENUM_Once, + XFA_ATTRIBUTEENUM_Only, + XFA_ATTRIBUTEENUM_Open, + XFA_ATTRIBUTEENUM_Caption, + XFA_ATTRIBUTEENUM_Raised, + XFA_ATTRIBUTEENUM_Justify, + XFA_ATTRIBUTEENUM_RefAndDescendants, + XFA_ATTRIBUTEENUM_Short, + XFA_ATTRIBUTEENUM_PageFront, + XFA_ATTRIBUTEENUM_Monospace, + XFA_ATTRIBUTEENUM_Middle, + XFA_ATTRIBUTEENUM_PrePrint, + XFA_ATTRIBUTEENUM_Always, + XFA_ATTRIBUTEENUM_Unknown, + XFA_ATTRIBUTEENUM_ToLeft, + XFA_ATTRIBUTEENUM_Above, + XFA_ATTRIBUTEENUM_DashDot, + XFA_ATTRIBUTEENUM_Gregorian, + XFA_ATTRIBUTEENUM_Roman, + XFA_ATTRIBUTEENUM_MouseDown, + XFA_ATTRIBUTEENUM_Symbol, + XFA_ATTRIBUTEENUM_PageEven, + XFA_ATTRIBUTEENUM_Sign, + XFA_ATTRIBUTEENUM_AddNew, + XFA_ATTRIBUTEENUM_Star, + XFA_ATTRIBUTEENUM_Optimistic, + XFA_ATTRIBUTEENUM_Rl_tb, + XFA_ATTRIBUTEENUM_MiddleRight, + XFA_ATTRIBUTEENUM_Maintain, + XFA_ATTRIBUTEENUM_Package, + XFA_ATTRIBUTEENUM_SimplifiedChinese, + XFA_ATTRIBUTEENUM_ToCenter, + XFA_ATTRIBUTEENUM_Back, + XFA_ATTRIBUTEENUM_Unspecified, + XFA_ATTRIBUTEENUM_BatchOptimistic, + XFA_ATTRIBUTEENUM_Bold, + XFA_ATTRIBUTEENUM_Both, + XFA_ATTRIBUTEENUM_Butt, + XFA_ATTRIBUTEENUM_Client, + XFA_ATTRIBUTEENUM_2mod10, + XFA_ATTRIBUTEENUM_ImageOnly, + XFA_ATTRIBUTEENUM_Horizontal, + XFA_ATTRIBUTEENUM_Dotted, + XFA_ATTRIBUTEENUM_UserControl, + XFA_ATTRIBUTEENUM_DiagonalRight, + XFA_ATTRIBUTEENUM_ConsumeData, + XFA_ATTRIBUTEENUM_Check, + XFA_ATTRIBUTEENUM_Data, + XFA_ATTRIBUTEENUM_Down, + XFA_ATTRIBUTEENUM_SansSerif, + XFA_ATTRIBUTEENUM_Inline, + XFA_ATTRIBUTEENUM_TraditionalChinese, + XFA_ATTRIBUTEENUM_Warn, + XFA_ATTRIBUTEENUM_RefOnly, + XFA_ATTRIBUTEENUM_InteractiveForms, + XFA_ATTRIBUTEENUM_Word, + XFA_ATTRIBUTEENUM_Unordered, + XFA_ATTRIBUTEENUM_Required, + XFA_ATTRIBUTEENUM_ImportOnly, + XFA_ATTRIBUTEENUM_BelowEmbedded, + XFA_ATTRIBUTEENUM_Japanese, + XFA_ATTRIBUTEENUM_Full, + XFA_ATTRIBUTEENUM_Rl_row, + XFA_ATTRIBUTEENUM_Vietnamese, + XFA_ATTRIBUTEENUM_EastEuropeanRoman, + XFA_ATTRIBUTEENUM_MouseUp, + XFA_ATTRIBUTEENUM_ExportOnly, + XFA_ATTRIBUTEENUM_Clear, + XFA_ATTRIBUTEENUM_Click, + XFA_ATTRIBUTEENUM_Base64, + XFA_ATTRIBUTEENUM_Close, + XFA_ATTRIBUTEENUM_Host, + XFA_ATTRIBUTEENUM_Global, + XFA_ATTRIBUTEENUM_Blank, + XFA_ATTRIBUTEENUM_Table, + XFA_ATTRIBUTEENUM_Import, + XFA_ATTRIBUTEENUM_Custom, + XFA_ATTRIBUTEENUM_MiddleLeft, + XFA_ATTRIBUTEENUM_PostExecute, + XFA_ATTRIBUTEENUM_Radix, + XFA_ATTRIBUTEENUM_PostOpen, + XFA_ATTRIBUTEENUM_Enter, + XFA_ATTRIBUTEENUM_Ignore, + XFA_ATTRIBUTEENUM_Lr_tb, + XFA_ATTRIBUTEENUM_Fantasy, + XFA_ATTRIBUTEENUM_Italic, + XFA_ATTRIBUTEENUM_Author, + XFA_ATTRIBUTEENUM_ToEdge, + XFA_ATTRIBUTEENUM_Choice, + XFA_ATTRIBUTEENUM_Disabled, + XFA_ATTRIBUTEENUM_CrossHatch, + XFA_ATTRIBUTEENUM_DataRef, + XFA_ATTRIBUTEENUM_DashDotDot, + XFA_ATTRIBUTEENUM_Square, + XFA_ATTRIBUTEENUM_Dynamic, + XFA_ATTRIBUTEENUM_Manual, + XFA_ATTRIBUTEENUM_Etched, + XFA_ATTRIBUTEENUM_ValidationState, + XFA_ATTRIBUTEENUM_Cursive, + XFA_ATTRIBUTEENUM_Last, + XFA_ATTRIBUTEENUM_Left, + XFA_ATTRIBUTEENUM_Link, + XFA_ATTRIBUTEENUM_Long, + XFA_ATTRIBUTEENUM_InternationalCarrier, + XFA_ATTRIBUTEENUM_PDF1_3, + XFA_ATTRIBUTEENUM_PDF1_6, + XFA_ATTRIBUTEENUM_Serif, + XFA_ATTRIBUTEENUM_PostSave, + XFA_ATTRIBUTEENUM_Ready, + XFA_ATTRIBUTEENUM_PostSign, + XFA_ATTRIBUTEENUM_Arabic, + XFA_ATTRIBUTEENUM_Error, + XFA_ATTRIBUTEENUM_Urlencoded, + XFA_ATTRIBUTEENUM_Lowered, +}; +enum XFA_ATTRIBUTE { + XFA_ATTRIBUTE_H, + XFA_ATTRIBUTE_W, + XFA_ATTRIBUTE_X, + XFA_ATTRIBUTE_Y, + XFA_ATTRIBUTE_Id, + XFA_ATTRIBUTE_To, + XFA_ATTRIBUTE_LineThrough, + XFA_ATTRIBUTE_HAlign, + XFA_ATTRIBUTE_Typeface, + XFA_ATTRIBUTE_BeforeTarget, + XFA_ATTRIBUTE_Name, + XFA_ATTRIBUTE_Next, + XFA_ATTRIBUTE_DataRowCount, + XFA_ATTRIBUTE_Break, + XFA_ATTRIBUTE_VScrollPolicy, + XFA_ATTRIBUTE_FontHorizontalScale, + XFA_ATTRIBUTE_TextIndent, + XFA_ATTRIBUTE_Context, + XFA_ATTRIBUTE_TrayOut, + XFA_ATTRIBUTE_Cap, + XFA_ATTRIBUTE_Max, + XFA_ATTRIBUTE_Min, + XFA_ATTRIBUTE_Ref, + XFA_ATTRIBUTE_Rid, + XFA_ATTRIBUTE_Url, + XFA_ATTRIBUTE_Use, + XFA_ATTRIBUTE_LeftInset, + XFA_ATTRIBUTE_Widows, + XFA_ATTRIBUTE_Level, + XFA_ATTRIBUTE_BottomInset, + XFA_ATTRIBUTE_OverflowTarget, + XFA_ATTRIBUTE_AllowMacro, + XFA_ATTRIBUTE_PagePosition, + XFA_ATTRIBUTE_ColumnWidths, + XFA_ATTRIBUTE_OverflowLeader, + XFA_ATTRIBUTE_Action, + XFA_ATTRIBUTE_NonRepudiation, + XFA_ATTRIBUTE_Rate, + XFA_ATTRIBUTE_AllowRichText, + XFA_ATTRIBUTE_Role, + XFA_ATTRIBUTE_OverflowTrailer, + XFA_ATTRIBUTE_Operation, + XFA_ATTRIBUTE_Timeout, + XFA_ATTRIBUTE_TopInset, + XFA_ATTRIBUTE_Access, + XFA_ATTRIBUTE_CommandType, + XFA_ATTRIBUTE_Format, + XFA_ATTRIBUTE_DataPrep, + XFA_ATTRIBUTE_WidgetData, + XFA_ATTRIBUTE_Abbr, + XFA_ATTRIBUTE_MarginRight, + XFA_ATTRIBUTE_DataDescription, + XFA_ATTRIBUTE_EncipherOnly, + XFA_ATTRIBUTE_KerningMode, + XFA_ATTRIBUTE_Rotate, + XFA_ATTRIBUTE_WordCharacterCount, + XFA_ATTRIBUTE_Type, + XFA_ATTRIBUTE_Reserve, + XFA_ATTRIBUTE_TextLocation, + XFA_ATTRIBUTE_Priority, + XFA_ATTRIBUTE_Underline, + XFA_ATTRIBUTE_ModuleWidth, + XFA_ATTRIBUTE_Hyphenate, + XFA_ATTRIBUTE_Listen, + XFA_ATTRIBUTE_Delimiter, + XFA_ATTRIBUTE_ContentType, + XFA_ATTRIBUTE_StartNew, + XFA_ATTRIBUTE_EofAction, + XFA_ATTRIBUTE_AllowNeutral, + XFA_ATTRIBUTE_Connection, + XFA_ATTRIBUTE_BaselineShift, + XFA_ATTRIBUTE_OverlinePeriod, + XFA_ATTRIBUTE_FracDigits, + XFA_ATTRIBUTE_Orientation, + XFA_ATTRIBUTE_TimeStamp, + XFA_ATTRIBUTE_PrintCheckDigit, + XFA_ATTRIBUTE_MarginLeft, + XFA_ATTRIBUTE_Stroke, + XFA_ATTRIBUTE_ModuleHeight, + XFA_ATTRIBUTE_TransferEncoding, + XFA_ATTRIBUTE_Usage, + XFA_ATTRIBUTE_Presence, + XFA_ATTRIBUTE_RadixOffset, + XFA_ATTRIBUTE_Preserve, + XFA_ATTRIBUTE_AliasNode, + XFA_ATTRIBUTE_MultiLine, + XFA_ATTRIBUTE_Version, + XFA_ATTRIBUTE_StartChar, + XFA_ATTRIBUTE_ScriptTest, + XFA_ATTRIBUTE_StartAngle, + XFA_ATTRIBUTE_CursorType, + XFA_ATTRIBUTE_DigitalSignature, + XFA_ATTRIBUTE_CodeType, + XFA_ATTRIBUTE_Output, + XFA_ATTRIBUTE_BookendTrailer, + XFA_ATTRIBUTE_ImagingBBox, + XFA_ATTRIBUTE_ExcludeInitialCap, + XFA_ATTRIBUTE_Force, + XFA_ATTRIBUTE_CrlSign, + XFA_ATTRIBUTE_Previous, + XFA_ATTRIBUTE_PushCharacterCount, + XFA_ATTRIBUTE_NullTest, + XFA_ATTRIBUTE_RunAt, + XFA_ATTRIBUTE_SpaceBelow, + XFA_ATTRIBUTE_SweepAngle, + XFA_ATTRIBUTE_NumberOfCells, + XFA_ATTRIBUTE_LetterSpacing, + XFA_ATTRIBUTE_LockType, + XFA_ATTRIBUTE_PasswordChar, + XFA_ATTRIBUTE_VAlign, + XFA_ATTRIBUTE_SourceBelow, + XFA_ATTRIBUTE_Inverted, + XFA_ATTRIBUTE_Mark, + XFA_ATTRIBUTE_MaxH, + XFA_ATTRIBUTE_MaxW, + XFA_ATTRIBUTE_Truncate, + XFA_ATTRIBUTE_MinH, + XFA_ATTRIBUTE_MinW, + XFA_ATTRIBUTE_Initial, + XFA_ATTRIBUTE_Mode, + XFA_ATTRIBUTE_Layout, + XFA_ATTRIBUTE_Server, + XFA_ATTRIBUTE_EmbedPDF, + XFA_ATTRIBUTE_OddOrEven, + XFA_ATTRIBUTE_TabDefault, + XFA_ATTRIBUTE_Contains, + XFA_ATTRIBUTE_RightInset, + XFA_ATTRIBUTE_MaxChars, + XFA_ATTRIBUTE_Open, + XFA_ATTRIBUTE_Relation, + XFA_ATTRIBUTE_WideNarrowRatio, + XFA_ATTRIBUTE_Relevant, + XFA_ATTRIBUTE_SignatureType, + XFA_ATTRIBUTE_LineThroughPeriod, + XFA_ATTRIBUTE_Shape, + XFA_ATTRIBUTE_TabStops, + XFA_ATTRIBUTE_OutputBelow, + XFA_ATTRIBUTE_Short, + XFA_ATTRIBUTE_FontVerticalScale, + XFA_ATTRIBUTE_Thickness, + XFA_ATTRIBUTE_CommitOn, + XFA_ATTRIBUTE_RemainCharacterCount, + XFA_ATTRIBUTE_KeyAgreement, + XFA_ATTRIBUTE_ErrorCorrectionLevel, + XFA_ATTRIBUTE_UpsMode, + XFA_ATTRIBUTE_MergeMode, + XFA_ATTRIBUTE_Circular, + XFA_ATTRIBUTE_PsName, + XFA_ATTRIBUTE_Trailer, + XFA_ATTRIBUTE_UnicodeRange, + XFA_ATTRIBUTE_ExecuteType, + XFA_ATTRIBUTE_DuplexImposition, + XFA_ATTRIBUTE_TrayIn, + XFA_ATTRIBUTE_BindingNode, + XFA_ATTRIBUTE_BofAction, + XFA_ATTRIBUTE_Save, + XFA_ATTRIBUTE_TargetType, + XFA_ATTRIBUTE_KeyEncipherment, + XFA_ATTRIBUTE_CredentialServerPolicy, + XFA_ATTRIBUTE_Size, + XFA_ATTRIBUTE_InitialNumber, + XFA_ATTRIBUTE_Slope, + XFA_ATTRIBUTE_CSpace, + XFA_ATTRIBUTE_ColSpan, + XFA_ATTRIBUTE_Binding, + XFA_ATTRIBUTE_Checksum, + XFA_ATTRIBUTE_CharEncoding, + XFA_ATTRIBUTE_Bind, + XFA_ATTRIBUTE_TextEntry, + XFA_ATTRIBUTE_Archive, + XFA_ATTRIBUTE_Uuid, + XFA_ATTRIBUTE_Posture, + XFA_ATTRIBUTE_After, + XFA_ATTRIBUTE_Orphans, + XFA_ATTRIBUTE_QualifiedName, + XFA_ATTRIBUTE_Usehref, + XFA_ATTRIBUTE_Locale, + XFA_ATTRIBUTE_Weight, + XFA_ATTRIBUTE_UnderlinePeriod, + XFA_ATTRIBUTE_Data, + XFA_ATTRIBUTE_Desc, + XFA_ATTRIBUTE_Numbered, + XFA_ATTRIBUTE_DataColumnCount, + XFA_ATTRIBUTE_Overline, + XFA_ATTRIBUTE_UrlPolicy, + XFA_ATTRIBUTE_AnchorType, + XFA_ATTRIBUTE_LabelRef, + XFA_ATTRIBUTE_BookendLeader, + XFA_ATTRIBUTE_MaxLength, + XFA_ATTRIBUTE_AccessKey, + XFA_ATTRIBUTE_CursorLocation, + XFA_ATTRIBUTE_DelayedOpen, + XFA_ATTRIBUTE_Target, + XFA_ATTRIBUTE_DataEncipherment, + XFA_ATTRIBUTE_AfterTarget, + XFA_ATTRIBUTE_Leader, + XFA_ATTRIBUTE_Picker, + XFA_ATTRIBUTE_From, + XFA_ATTRIBUTE_BaseProfile, + XFA_ATTRIBUTE_Aspect, + XFA_ATTRIBUTE_RowColumnRatio, + XFA_ATTRIBUTE_LineHeight, + XFA_ATTRIBUTE_Highlight, + XFA_ATTRIBUTE_ValueRef, + XFA_ATTRIBUTE_MaxEntries, + XFA_ATTRIBUTE_DataLength, + XFA_ATTRIBUTE_Activity, + XFA_ATTRIBUTE_Input, + XFA_ATTRIBUTE_Value, + XFA_ATTRIBUTE_BlankOrNotBlank, + XFA_ATTRIBUTE_AddRevocationInfo, + XFA_ATTRIBUTE_GenericFamily, + XFA_ATTRIBUTE_Hand, + XFA_ATTRIBUTE_Href, + XFA_ATTRIBUTE_TextEncoding, + XFA_ATTRIBUTE_LeadDigits, + XFA_ATTRIBUTE_Permissions, + XFA_ATTRIBUTE_SpaceAbove, + XFA_ATTRIBUTE_CodeBase, + XFA_ATTRIBUTE_Stock, + XFA_ATTRIBUTE_IsNull, + XFA_ATTRIBUTE_RestoreState, + XFA_ATTRIBUTE_ExcludeAllCaps, + XFA_ATTRIBUTE_FormatTest, + XFA_ATTRIBUTE_HScrollPolicy, + XFA_ATTRIBUTE_Join, + XFA_ATTRIBUTE_KeyCertSign, + XFA_ATTRIBUTE_Radius, + XFA_ATTRIBUTE_SourceAbove, + XFA_ATTRIBUTE_Override, + XFA_ATTRIBUTE_ClassId, + XFA_ATTRIBUTE_Disable, + XFA_ATTRIBUTE_Scope, + XFA_ATTRIBUTE_Match, + XFA_ATTRIBUTE_Placement, + XFA_ATTRIBUTE_Before, + XFA_ATTRIBUTE_WritingScript, + XFA_ATTRIBUTE_EndChar, + XFA_ATTRIBUTE_Lock, + XFA_ATTRIBUTE_Long, + XFA_ATTRIBUTE_Intact, + XFA_ATTRIBUTE_XdpContent, + XFA_ATTRIBUTE_DecipherOnly, +}; +enum XFA_ELEMENT { + XFA_ELEMENT_Ps, + XFA_ELEMENT_To, + XFA_ELEMENT_Ui, + XFA_ELEMENT_RecordSet, + XFA_ELEMENT_SubsetBelow, + XFA_ELEMENT_SubformSet, + XFA_ELEMENT_AdobeExtensionLevel, + XFA_ELEMENT_Typeface, + XFA_ELEMENT_Break, + XFA_ELEMENT_FontInfo, + XFA_ELEMENT_NumberPattern, + XFA_ELEMENT_DynamicRender, + XFA_ELEMENT_PrintScaling, + XFA_ELEMENT_CheckButton, + XFA_ELEMENT_DatePatterns, + XFA_ELEMENT_SourceSet, + XFA_ELEMENT_Amd, + XFA_ELEMENT_Arc, + XFA_ELEMENT_Day, + XFA_ELEMENT_Era, + XFA_ELEMENT_Jog, + XFA_ELEMENT_Log, + XFA_ELEMENT_Map, + XFA_ELEMENT_Mdp, + XFA_ELEMENT_BreakBefore, + XFA_ELEMENT_Oid, + XFA_ELEMENT_Pcl, + XFA_ELEMENT_Pdf, + XFA_ELEMENT_Ref, + XFA_ELEMENT_Uri, + XFA_ELEMENT_Xdc, + XFA_ELEMENT_Xdp, + XFA_ELEMENT_Xfa, + XFA_ELEMENT_Xsl, + XFA_ELEMENT_Zpl, + XFA_ELEMENT_Cache, + XFA_ELEMENT_Margin, + XFA_ELEMENT_KeyUsage, + XFA_ELEMENT_Exclude, + XFA_ELEMENT_ChoiceList, + XFA_ELEMENT_Level, + XFA_ELEMENT_LabelPrinter, + XFA_ELEMENT_CalendarSymbols, + XFA_ELEMENT_Para, + XFA_ELEMENT_Part, + XFA_ELEMENT_Pdfa, + XFA_ELEMENT_Filter, + XFA_ELEMENT_Present, + XFA_ELEMENT_Pagination, + XFA_ELEMENT_Encoding, + XFA_ELEMENT_Event, + XFA_ELEMENT_Whitespace, + XFA_ELEMENT_DefaultUi, + XFA_ELEMENT_DataModel, + XFA_ELEMENT_Barcode, + XFA_ELEMENT_TimePattern, + XFA_ELEMENT_BatchOutput, + XFA_ELEMENT_Enforce, + XFA_ELEMENT_CurrencySymbols, + XFA_ELEMENT_AddSilentPrint, + XFA_ELEMENT_Rename, + XFA_ELEMENT_Operation, + XFA_ELEMENT_Typefaces, + XFA_ELEMENT_SubjectDNs, + XFA_ELEMENT_Issuers, + XFA_ELEMENT_SignaturePseudoModel, + XFA_ELEMENT_WsdlConnection, + XFA_ELEMENT_Debug, + XFA_ELEMENT_Delta, + XFA_ELEMENT_EraNames, + XFA_ELEMENT_ModifyAnnots, + XFA_ELEMENT_StartNode, + XFA_ELEMENT_Button, + XFA_ELEMENT_Format, + XFA_ELEMENT_Border, + XFA_ELEMENT_Area, + XFA_ELEMENT_Hyphenation, + XFA_ELEMENT_Text, + XFA_ELEMENT_Time, + XFA_ELEMENT_Type, + XFA_ELEMENT_Overprint, + XFA_ELEMENT_Certificates, + XFA_ELEMENT_EncryptionMethods, + XFA_ELEMENT_SetProperty, + XFA_ELEMENT_PrinterName, + XFA_ELEMENT_StartPage, + XFA_ELEMENT_PageOffset, + XFA_ELEMENT_DateTime, + XFA_ELEMENT_Comb, + XFA_ELEMENT_Pattern, + XFA_ELEMENT_IfEmpty, + XFA_ELEMENT_SuppressBanner, + XFA_ELEMENT_OutputBin, + XFA_ELEMENT_Field, + XFA_ELEMENT_Agent, + XFA_ELEMENT_OutputXSL, + XFA_ELEMENT_AdjustData, + XFA_ELEMENT_AutoSave, + XFA_ELEMENT_ContentArea, + XFA_ELEMENT_EventPseudoModel, + XFA_ELEMENT_WsdlAddress, + XFA_ELEMENT_Solid, + XFA_ELEMENT_DateTimeSymbols, + XFA_ELEMENT_EncryptionLevel, + XFA_ELEMENT_Edge, + XFA_ELEMENT_Stipple, + XFA_ELEMENT_Attributes, + XFA_ELEMENT_VersionControl, + XFA_ELEMENT_Meridiem, + XFA_ELEMENT_ExclGroup, + XFA_ELEMENT_ToolTip, + XFA_ELEMENT_Compress, + XFA_ELEMENT_Reason, + XFA_ELEMENT_Execute, + XFA_ELEMENT_ContentCopy, + XFA_ELEMENT_DateTimeEdit, + XFA_ELEMENT_Config, + XFA_ELEMENT_Image, + XFA_ELEMENT_SharpxHTML, + XFA_ELEMENT_NumberOfCopies, + XFA_ELEMENT_BehaviorOverride, + XFA_ELEMENT_TimeStamp, + XFA_ELEMENT_Month, + XFA_ELEMENT_ViewerPreferences, + XFA_ELEMENT_ScriptModel, + XFA_ELEMENT_Decimal, + XFA_ELEMENT_Subform, + XFA_ELEMENT_Select, + XFA_ELEMENT_Window, + XFA_ELEMENT_LocaleSet, + XFA_ELEMENT_Handler, + XFA_ELEMENT_HostPseudoModel, + XFA_ELEMENT_Presence, + XFA_ELEMENT_Record, + XFA_ELEMENT_Embed, + XFA_ELEMENT_Version, + XFA_ELEMENT_Command, + XFA_ELEMENT_Copies, + XFA_ELEMENT_Staple, + XFA_ELEMENT_SubmitFormat, + XFA_ELEMENT_Boolean, + XFA_ELEMENT_Message, + XFA_ELEMENT_Output, + XFA_ELEMENT_PsMap, + XFA_ELEMENT_ExcludeNS, + XFA_ELEMENT_Assist, + XFA_ELEMENT_Picture, + XFA_ELEMENT_Traversal, + XFA_ELEMENT_SilentPrint, + XFA_ELEMENT_WebClient, + XFA_ELEMENT_LayoutPseudoModel, + XFA_ELEMENT_Producer, + XFA_ELEMENT_Corner, + XFA_ELEMENT_MsgId, + XFA_ELEMENT_Color, + XFA_ELEMENT_Keep, + XFA_ELEMENT_Query, + XFA_ELEMENT_Insert, + XFA_ELEMENT_ImageEdit, + XFA_ELEMENT_Validate, + XFA_ELEMENT_DigestMethods, + XFA_ELEMENT_NumberPatterns, + XFA_ELEMENT_PageSet, + XFA_ELEMENT_Integer, + XFA_ELEMENT_SoapAddress, + XFA_ELEMENT_Equate, + XFA_ELEMENT_FormFieldFilling, + XFA_ELEMENT_PageRange, + XFA_ELEMENT_Update, + XFA_ELEMENT_ConnectString, + XFA_ELEMENT_Mode, + XFA_ELEMENT_Layout, + XFA_ELEMENT_Sharpxml, + XFA_ELEMENT_XsdConnection, + XFA_ELEMENT_Traverse, + XFA_ELEMENT_Encodings, + XFA_ELEMENT_Template, + XFA_ELEMENT_Acrobat, + XFA_ELEMENT_ValidationMessaging, + XFA_ELEMENT_Signing, + XFA_ELEMENT_DataWindow, + XFA_ELEMENT_Script, + XFA_ELEMENT_AddViewerPreferences, + XFA_ELEMENT_AlwaysEmbed, + XFA_ELEMENT_PasswordEdit, + XFA_ELEMENT_NumericEdit, + XFA_ELEMENT_EncryptionMethod, + XFA_ELEMENT_Change, + XFA_ELEMENT_PageArea, + XFA_ELEMENT_SubmitUrl, + XFA_ELEMENT_Oids, + XFA_ELEMENT_Signature, + XFA_ELEMENT_ADBE_JSConsole, + XFA_ELEMENT_Caption, + XFA_ELEMENT_Relevant, + XFA_ELEMENT_FlipLabel, + XFA_ELEMENT_ExData, + XFA_ELEMENT_DayNames, + XFA_ELEMENT_SoapAction, + XFA_ELEMENT_DefaultTypeface, + XFA_ELEMENT_Manifest, + XFA_ELEMENT_Overflow, + XFA_ELEMENT_Linear, + XFA_ELEMENT_CurrencySymbol, + XFA_ELEMENT_Delete, + XFA_ELEMENT_Deltas, + XFA_ELEMENT_DigestMethod, + XFA_ELEMENT_InstanceManager, + XFA_ELEMENT_EquateRange, + XFA_ELEMENT_Medium, + XFA_ELEMENT_TextEdit, + XFA_ELEMENT_TemplateCache, + XFA_ELEMENT_CompressObjectStream, + XFA_ELEMENT_DataValue, + XFA_ELEMENT_AccessibleContent, + XFA_ELEMENT_NodeList, + XFA_ELEMENT_IncludeXDPContent, + XFA_ELEMENT_XmlConnection, + XFA_ELEMENT_ValidateApprovalSignatures, + XFA_ELEMENT_SignData, + XFA_ELEMENT_Packets, + XFA_ELEMENT_DatePattern, + XFA_ELEMENT_DuplexOption, + XFA_ELEMENT_Base, + XFA_ELEMENT_Bind, + XFA_ELEMENT_Compression, + XFA_ELEMENT_User, + XFA_ELEMENT_Rectangle, + XFA_ELEMENT_EffectiveOutputPolicy, + XFA_ELEMENT_ADBE_JSDebugger, + XFA_ELEMENT_Acrobat7, + XFA_ELEMENT_Interactive, + XFA_ELEMENT_Locale, + XFA_ELEMENT_CurrentPage, + XFA_ELEMENT_Data, + XFA_ELEMENT_Date, + XFA_ELEMENT_Desc, + XFA_ELEMENT_Encrypt, + XFA_ELEMENT_Draw, + XFA_ELEMENT_Encryption, + XFA_ELEMENT_MeridiemNames, + XFA_ELEMENT_Messaging, + XFA_ELEMENT_Speak, + XFA_ELEMENT_DataGroup, + XFA_ELEMENT_Common, + XFA_ELEMENT_Sharptext, + XFA_ELEMENT_PaginationOverride, + XFA_ELEMENT_Reasons, + XFA_ELEMENT_SignatureProperties, + XFA_ELEMENT_Threshold, + XFA_ELEMENT_AppearanceFilter, + XFA_ELEMENT_Fill, + XFA_ELEMENT_Font, + XFA_ELEMENT_Form, + XFA_ELEMENT_MediumInfo, + XFA_ELEMENT_Certificate, + XFA_ELEMENT_Password, + XFA_ELEMENT_RunScripts, + XFA_ELEMENT_Trace, + XFA_ELEMENT_Float, + XFA_ELEMENT_RenderPolicy, + XFA_ELEMENT_LogPseudoModel, + XFA_ELEMENT_Destination, + XFA_ELEMENT_Value, + XFA_ELEMENT_Bookend, + XFA_ELEMENT_ExObject, + XFA_ELEMENT_OpenAction, + XFA_ELEMENT_NeverEmbed, + XFA_ELEMENT_BindItems, + XFA_ELEMENT_Calculate, + XFA_ELEMENT_Print, + XFA_ELEMENT_Extras, + XFA_ELEMENT_Proto, + XFA_ELEMENT_DSigData, + XFA_ELEMENT_Creator, + XFA_ELEMENT_Connect, + XFA_ELEMENT_Permissions, + XFA_ELEMENT_ConnectionSet, + XFA_ELEMENT_Submit, + XFA_ELEMENT_Range, + XFA_ELEMENT_Linearized, + XFA_ELEMENT_Packet, + XFA_ELEMENT_RootElement, + XFA_ELEMENT_PlaintextMetadata, + XFA_ELEMENT_NumberSymbols, + XFA_ELEMENT_PrintHighQuality, + XFA_ELEMENT_Driver, + XFA_ELEMENT_IncrementalLoad, + XFA_ELEMENT_SubjectDN, + XFA_ELEMENT_CompressLogicalStructure, + XFA_ELEMENT_IncrementalMerge, + XFA_ELEMENT_Radial, + XFA_ELEMENT_Variables, + XFA_ELEMENT_TimePatterns, + XFA_ELEMENT_EffectiveInputPolicy, + XFA_ELEMENT_NameAttr, + XFA_ELEMENT_Conformance, + XFA_ELEMENT_Transform, + XFA_ELEMENT_LockDocument, + XFA_ELEMENT_BreakAfter, + XFA_ELEMENT_Line, + XFA_ELEMENT_List, + XFA_ELEMENT_Source, + XFA_ELEMENT_Occur, + XFA_ELEMENT_PickTrayByPDFSize, + XFA_ELEMENT_MonthNames, + XFA_ELEMENT_Severity, + XFA_ELEMENT_GroupParent, + XFA_ELEMENT_DocumentAssembly, + XFA_ELEMENT_NumberSymbol, + XFA_ELEMENT_Tagged, + XFA_ELEMENT_Items, +}; +#define XFA_ELEMENT_UNKNOWN ((XFA_ELEMENT)-1) +struct XFA_ELEMENTINFO { + uint32_t uHash; + const FX_WCHAR* pName; + XFA_ELEMENT eName; + uint32_t dwPackets; + uint32_t eObjectType; +}; +int32_t XFA_GetElementCount(); +const XFA_ELEMENTINFO* XFA_GetElementByName(const CFX_WideStringC& wsName); +const XFA_ELEMENTINFO* XFA_GetElementByID(XFA_ELEMENT eName); +enum XFA_ATTRIBUTETYPE { + XFA_ATTRIBUTETYPE_NOTSURE, + XFA_ATTRIBUTETYPE_Enum, + XFA_ATTRIBUTETYPE_Cdata, + XFA_ATTRIBUTETYPE_Boolean, + XFA_ATTRIBUTETYPE_Integer, + XFA_ATTRIBUTETYPE_Measure, +}; +struct XFA_ATTRIBUTEINFO { + uint32_t uHash; + const FX_WCHAR* pName; + XFA_ATTRIBUTE eName; + XFA_ATTRIBUTETYPE eType; + uint32_t dwPackets; + void* pDefValue; +}; +int32_t XFA_GetAttributeCount(); +const XFA_ATTRIBUTEINFO* XFA_GetAttributeByName(const CFX_WideStringC& wsName); +const XFA_ATTRIBUTEINFO* XFA_GetAttributeByID(XFA_ATTRIBUTE eName); +FX_BOOL XFA_GetAttributeDefaultValue(void*& pValue, + XFA_ELEMENT eElement, + XFA_ATTRIBUTE eAttribute, + XFA_ATTRIBUTETYPE eType, + uint32_t dwPacket); +XFA_ATTRIBUTEENUM XFA_GetAttributeDefaultValue_Enum(XFA_ELEMENT eElement, + XFA_ATTRIBUTE eAttribute, + uint32_t dwPacket); +CFX_WideStringC XFA_GetAttributeDefaultValue_Cdata(XFA_ELEMENT eElement, + XFA_ATTRIBUTE eAttribute, + uint32_t dwPacket); +FX_BOOL XFA_GetAttributeDefaultValue_Boolean(XFA_ELEMENT eElement, + XFA_ATTRIBUTE eAttribute, + uint32_t dwPacket); +int32_t XFA_GetAttributeDefaultValue_Integer(XFA_ELEMENT eElement, + XFA_ATTRIBUTE eAttribute, + uint32_t dwPacket); +CXFA_Measurement XFA_GetAttributeDefaultValue_Measure(XFA_ELEMENT eElement, + XFA_ATTRIBUTE eAttribute, + uint32_t dwPacket); +struct XFA_ELEMENTHIERARCHY { + uint16_t wStart; + uint16_t wCount; +}; + +struct XFA_SCRIPTHIERARCHY { + uint16_t wMethodStart; + uint16_t wMethodCount; + uint16_t wAttributeStart; + uint16_t wAttributeCount; + int16_t wParentIndex; +}; + +typedef XFA_SCRIPTHIERARCHY const* XFA_LPCSCRIPTHIERARCHY; +const uint16_t* XFA_GetElementChildren(XFA_ELEMENT eElement, int32_t& iCount); +const uint8_t* XFA_GetElementAttributes(XFA_ELEMENT eElement, int32_t& iCount); +const XFA_ELEMENTINFO* XFA_GetChildOfElement(XFA_ELEMENT eElement, + XFA_ELEMENT eChild, + uint32_t dwPacket); +const XFA_ATTRIBUTEINFO* XFA_GetAttributeOfElement(XFA_ELEMENT eElement, + XFA_ATTRIBUTE eAttribute, + uint32_t dwPacket); +#define XFA_PROPERTYFLAG_OneOf 0x01 +#define XFA_PROPERTYFLAG_DefaultOneOf 0x02 +struct XFA_PROPERTY { + uint16_t eName; + uint8_t uOccur; + uint8_t uFlags; +}; +const XFA_PROPERTY* XFA_GetElementProperties(XFA_ELEMENT eElement, + int32_t& iCount); +const XFA_PROPERTY* XFA_GetPropertyOfElement(XFA_ELEMENT eElement, + XFA_ELEMENT eProperty, + uint32_t dwPacket); +struct XFA_ATTRIBUTEENUMINFO { + uint32_t uHash; + const FX_WCHAR* pName; + XFA_ATTRIBUTEENUM eName; +}; +const XFA_ATTRIBUTEENUMINFO* XFA_GetAttributeEnumByName( + const CFX_WideStringC& wsName); +const XFA_ATTRIBUTEENUMINFO* XFA_GetAttributeEnumByID(XFA_ATTRIBUTEENUM eName); +enum XFA_UNIT { + XFA_UNIT_Unknown, + XFA_UNIT_Percent, + XFA_UNIT_Angle, + XFA_UNIT_Em, + XFA_UNIT_Pt, + XFA_UNIT_In, + XFA_UNIT_Pc, + XFA_UNIT_Cm, + XFA_UNIT_Mm, + XFA_UNIT_Mp, +}; +class CXFA_Measurement { + public: + void Set(const CFX_WideStringC& wsMeasure); + void Set(FX_FLOAT fValue, XFA_UNIT eUnit) { + m_fValue = fValue; + m_eUnit = eUnit; + } + + XFA_UNIT GetUnit() const { return m_eUnit; } + FX_FLOAT GetValue() const { return m_fValue; } + FX_BOOL ToString(CFX_WideString& wsMeasure) const; + FX_BOOL ToUnit(XFA_UNIT eUnit, FX_FLOAT& fValue) const; + FX_FLOAT ToUnit(XFA_UNIT eUnit) const { + FX_FLOAT f; + return ToUnit(eUnit, f) ? f : 0; + } + CXFA_Measurement() { Set(-1, XFA_UNIT_Unknown); } + CXFA_Measurement(const CFX_WideStringC& wsMeasure) { Set(wsMeasure); } + CXFA_Measurement(FX_FLOAT fValue, XFA_UNIT eUnit) { Set(fValue, eUnit); } + static XFA_UNIT GetUnit(const CFX_WideStringC& wsUnit); + + protected: + FX_FLOAT m_fValue; + XFA_UNIT m_eUnit; +}; +class CFXJSE_Arguments; +class CXFA_Object; +typedef void (CXFA_Object::*XFA_METHOD_CALLBACK)(CFXJSE_Arguments* pArguments); +struct XFA_METHODINFO { + uint32_t uHash; + const FX_WCHAR* pName; + XFA_METHOD_CALLBACK lpfnCallback; +}; +int32_t XFA_GetMethodCount(); +const XFA_METHODINFO* XFA_GetMethodByName(XFA_ELEMENT eElement, + const CFX_WideStringC& wsMethodName); +typedef void (CXFA_Object::*XFA_ATTRIBUTE_CALLBACK)(FXJSE_HVALUE hValue, + FX_BOOL bSetting, + XFA_ATTRIBUTE eAttribute); +enum XFA_SCRIPT_TYPE { + XFA_SCRIPT_Basic, + XFA_SCRIPT_Object, +}; +struct XFA_SCRIPTATTRIBUTEINFO { + uint32_t uHash; + const FX_WCHAR* pName; + XFA_ATTRIBUTE_CALLBACK lpfnCallback; + int32_t eAttribute; + uint16_t eValueType; +}; +const XFA_SCRIPTATTRIBUTEINFO* XFA_GetScriptAttributeByName( + XFA_ELEMENT eElement, + const CFX_WideStringC& wsAttributeName); + +#endif // XFA_FXFA_INCLUDE_FXFA_BASIC_H_ diff --git a/xfa/fxfa/include/fxfa_widget.h b/xfa/fxfa/include/fxfa_widget.h new file mode 100644 index 0000000000..0f1de8526b --- /dev/null +++ b/xfa/fxfa/include/fxfa_widget.h @@ -0,0 +1,128 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_INCLUDE_FXFA_WIDGET_H_ +#define XFA_FXFA_INCLUDE_FXFA_WIDGET_H_ + +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxge/include/fx_dib.h" +#include "xfa/fxfa/parser/cxfa_box.h" +#include "xfa/fxfa/parser/cxfa_event.h" +#include "xfa/fxfa/parser/cxfa_image.h" +#include "xfa/fxfa/parser/cxfa_margin.h" +#include "xfa/fxfa/parser/cxfa_script.h" +#include "xfa/fxfa/parser/cxfa_value.h" +#include "xfa/fxfa/parser/cxfa_widgetdata.h" + +class CXFA_Node; +class CXFA_FFDocView; +class CXFA_FFDoc; +class CXFA_FFApp; +class CXFA_EventParam; +class CXFA_FFWidget; +class CXFA_TextLayout; +class CXFA_WidgetLayoutData; +class IFX_Font; +class IXFA_AppProvider; + +class CXFA_WidgetAcc : public CXFA_WidgetData { + public: + CXFA_WidgetAcc(CXFA_FFDocView* pDocView, CXFA_Node* pNode); + ~CXFA_WidgetAcc(); + + FX_BOOL GetName(CFX_WideString& wsName, int32_t iNameType = 0); + FX_BOOL ProcessValueChanged(); + + public: + void ResetData(); + + void SetImageEdit(const CFX_WideStringC& wsContentType, + const CFX_WideStringC& wsHref, + const CFX_WideStringC& wsData); + + CXFA_WidgetAcc* GetExclGroup(); + CXFA_FFDocView* GetDocView(); + CXFA_FFDoc* GetDoc(); + CXFA_FFApp* GetApp(); + IXFA_AppProvider* GetAppProvider(); + + int32_t ProcessEvent(int32_t iActivity, CXFA_EventParam* pEventParam); + int32_t ProcessEvent(CXFA_Event& event, CXFA_EventParam* pEventParam); + int32_t ProcessCalculate(); + int32_t ProcessValidate(int32_t iFlags = 0); + int32_t ExecuteScript(CXFA_Script script, + CXFA_EventParam* pEventParam, + FXJSE_HVALUE* pRetValue = NULL); + + CXFA_FFWidget* GetNextWidget(CXFA_FFWidget* pWidget); + void StartWidgetLayout(FX_FLOAT& fCalcWidth, FX_FLOAT& fCalcHeight); + FX_BOOL FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight); + FX_BOOL LoadCaption(); + void LoadText(); + FX_BOOL LoadImageImage(); + FX_BOOL LoadImageEditImage(); + void GetImageDpi(int32_t& iImageXDpi, int32_t& iImageYDpi); + void GetImageEditDpi(int32_t& iImageXDpi, int32_t& iImageYDpi); + CXFA_TextLayout* GetCaptionTextLayout(); + CXFA_TextLayout* GetTextLayout(); + CFX_DIBitmap* GetImageImage(); + CFX_DIBitmap* GetImageEditImage(); + void SetImageImage(CFX_DIBitmap* newImage); + void SetImageEditImage(CFX_DIBitmap* newImage); + void UpdateUIDisplay(CXFA_FFWidget* pExcept = NULL); + void NotifyEvent(uint32_t dwEvent, + CXFA_FFWidget* pWidget = NULL, + void* pParam = NULL, + void* pAdditional = NULL); + + CXFA_Node* GetDatasets(); + IFX_Font* GetFDEFont(); + FX_FLOAT GetFontSize(); + FX_ARGB GetTextColor(); + FX_FLOAT GetLineHeight(); + CXFA_WidgetLayoutData* GetWidgetLayoutData(); + + protected: + void ProcessScriptTestValidate(CXFA_Validate validate, + int32_t iRet, + FXJSE_HVALUE pRetValue, + FX_BOOL bVersionFlag); + int32_t ProcessFormatTestValidate(CXFA_Validate validate, + FX_BOOL bVersionFlag); + int32_t ProcessNullTestValidate(CXFA_Validate validate, + int32_t iFlags, + FX_BOOL bVersionFlag); + void GetValidateCaptionName(CFX_WideString& wsCaptionName, + FX_BOOL bVersionFlag); + void GetValidateMessage(IXFA_AppProvider* pAppProvider, + CFX_WideString& wsMessage, + FX_BOOL bError, + FX_BOOL bVersionFlag); + void CalcCaptionSize(CFX_SizeF& szCap); + FX_BOOL CalculateFieldAutoSize(CFX_SizeF& size); + FX_BOOL CalculateWidgetAutoSize(CFX_SizeF& size); + FX_BOOL CalculateTextEditAutoSize(CFX_SizeF& size); + FX_BOOL CalculateCheckButtonAutoSize(CFX_SizeF& size); + FX_BOOL CalculatePushButtonAutoSize(CFX_SizeF& size); + FX_BOOL CalculateImageEditAutoSize(CFX_SizeF& size); + FX_BOOL CalculateImageAutoSize(CFX_SizeF& size); + FX_BOOL CalculateTextAutoSize(CFX_SizeF& size); + FX_FLOAT CalculateWidgetAutoHeight(FX_FLOAT fHeightCalc); + FX_FLOAT CalculateWidgetAutoWidth(FX_FLOAT fWidthCalc); + FX_FLOAT GetWidthWithoutMargin(FX_FLOAT fWidthCalc); + FX_FLOAT GetHeightWithoutMargin(FX_FLOAT fHeightCalc); + void CalculateTextContentSize(CFX_SizeF& size); + void CalculateAccWidthAndHeight(XFA_ELEMENT eUIType, + FX_FLOAT& fWidth, + FX_FLOAT& fCalcHeight); + void InitLayoutData(); + void StartTextLayout(FX_FLOAT& fCalcWidth, FX_FLOAT& fCalcHeight); + CXFA_FFDocView* m_pDocView; + CXFA_WidgetLayoutData* m_pLayoutData; + uint32_t m_nRecursionDepth; +}; + +#endif // XFA_FXFA_INCLUDE_FXFA_WIDGET_H_ diff --git a/xfa/fxfa/include/xfa_checksum.h b/xfa/fxfa/include/xfa_checksum.h new file mode 100644 index 0000000000..6c24b2a5af --- /dev/null +++ b/xfa/fxfa/include/xfa_checksum.h @@ -0,0 +1,74 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_INCLUDE_XFA_CHECKSUM_H_ +#define XFA_FXFA_INCLUDE_XFA_CHECKSUM_H_ + +#include "xfa/fgas/xml/fgas_sax.h" +#include "xfa/fxfa/include/fxfa.h" + +class CXFA_SAXReaderHandler; +class CXFA_ChecksumContext; + +class CXFA_SAXContext { + public: + CXFA_SAXContext() : m_eNode(FX_SAXNODE_Unknown) {} + CFX_ByteTextBuf m_TextBuf; + CFX_ByteString m_bsTagName; + FX_SAXNODE m_eNode; +}; +class CXFA_SAXReaderHandler : public IFX_SAXReaderHandler { + public: + CXFA_SAXReaderHandler(CXFA_ChecksumContext* pContext); + virtual ~CXFA_SAXReaderHandler(); + virtual void* OnTagEnter(const CFX_ByteStringC& bsTagName, + FX_SAXNODE eType, + uint32_t dwStartPos); + virtual void OnTagAttribute(void* pTag, + const CFX_ByteStringC& bsAttri, + const CFX_ByteStringC& bsValue); + virtual void OnTagBreak(void* pTag); + virtual void OnTagData(void* pTag, + FX_SAXNODE eType, + const CFX_ByteStringC& bsData, + uint32_t dwStartPos); + virtual void OnTagClose(void* pTag, uint32_t dwEndPos); + virtual void OnTagEnd(void* pTag, + const CFX_ByteStringC& bsTagName, + uint32_t dwEndPos); + + virtual void OnTargetData(void* pTag, + FX_SAXNODE eType, + const CFX_ByteStringC& bsData, + uint32_t dwStartPos); + + protected: + void UpdateChecksum(FX_BOOL bCheckSpace); + CXFA_ChecksumContext* m_pContext; + CXFA_SAXContext m_SAXContext; +}; + +class CXFA_ChecksumContext { + public: + CXFA_ChecksumContext(); + ~CXFA_ChecksumContext(); + + void Release() { delete this; } + FX_BOOL StartChecksum(); + FX_BOOL UpdateChecksum(IFX_FileRead* pSrcFile, + FX_FILESIZE offset = 0, + size_t size = 0); + void FinishChecksum(); + void GetChecksum(CFX_ByteString& bsChecksum); + void Update(const CFX_ByteStringC& bsText); + + protected: + IFX_SAXReader* m_pSAXReader; + uint8_t* m_pByteContext; + CFX_ByteString m_bsChecksum; +}; + +#endif // XFA_FXFA_INCLUDE_XFA_CHECKSUM_H_ diff --git a/xfa/fxfa/include/xfa_ffapp.h b/xfa/fxfa/include/xfa_ffapp.h new file mode 100644 index 0000000000..cad4e88e58 --- /dev/null +++ b/xfa/fxfa/include/xfa_ffapp.h @@ -0,0 +1,78 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_INCLUDE_XFA_FFAPP_H_ +#define XFA_FXFA_INCLUDE_XFA_FFAPP_H_ + +#include "core/fpdfapi/fpdf_parser/include/cpdf_stream.h" +#include "core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h" +#include "xfa/fgas/font/fgas_font.h" +#include "xfa/fwl/core/fwl_sdadapterimp.h" +#include "xfa/fwl/core/ifwl_adapternative.h" +#include "xfa/fwl/core/ifwl_app.h" +#include "xfa/fxfa/include/fxfa.h" + +class CXFA_DefFontMgr; +class CXFA_FWLAdapterWidgetMgr; +class CXFA_FWLTheme; +class CXFA_FFDocHandler; +class CXFA_FontMgr; + +class CXFA_FileRead : public IFX_FileRead { + public: + explicit CXFA_FileRead(const CFX_ArrayTemplate<CPDF_Stream*>& streams); + + virtual FX_FILESIZE GetSize(); + virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size); + + virtual void Release() { delete this; } + + protected: + CFX_ObjectArray<CPDF_StreamAcc> m_Data; +}; + +class CXFA_FFApp : public IFWL_AdapterNative { + public: + CXFA_FFApp(IXFA_AppProvider* pProvider); + ~CXFA_FFApp() override; + + CXFA_FFDocHandler* GetDocHandler(); + CXFA_FFDoc* CreateDoc(IXFA_DocProvider* pProvider, + IFX_FileRead* pStream, + FX_BOOL bTakeOverFile); + CXFA_FFDoc* CreateDoc(IXFA_DocProvider* pProvider, CPDF_Document* pPDFDoc); + IXFA_AppProvider* GetAppProvider() { return m_pProvider; } + void SetDefaultFontMgr(CXFA_DefFontMgr* pFontMgr); + + // IFWL_AdapterNative: + IFWL_AdapterWidgetMgr* GetWidgetMgr( + IFWL_WidgetMgrDelegate* pDelegate) override; + IFWL_AdapterThreadMgr* GetThreadMgr() override; + IFWL_AdapterTimerMgr* GetTimerMgr() override; + + CXFA_FontMgr* GetXFAFontMgr(); + IFX_FontMgr* GetFDEFontMgr(); + CXFA_FWLTheme* GetFWLTheme(); + IFWL_WidgetMgrDelegate* GetWidgetMgrDelegate() { + return m_pWidgetMgrDelegate; + } + + protected: + CXFA_FFDocHandler* m_pDocHandler; + IFWL_App* m_pFWLApp; + CXFA_FWLTheme* m_pFWLTheme; + IXFA_AppProvider* m_pProvider; + CXFA_FontMgr* m_pFontMgr; +#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ + IFX_FontSourceEnum* m_pFontSource; +#endif + CXFA_FWLAdapterWidgetMgr* m_pAdapterWidgetMgr; + IFWL_WidgetMgrDelegate* m_pWidgetMgrDelegate; + IFX_FontMgr* m_pFDEFontMgr; + CFWL_SDAdapterThreadMgr* m_pAdapterThreadMgr; +}; + +#endif // XFA_FXFA_INCLUDE_XFA_FFAPP_H_ diff --git a/xfa/fxfa/include/xfa_ffdoc.h b/xfa/fxfa/include/xfa_ffdoc.h new file mode 100644 index 0000000000..9d9af3d9bc --- /dev/null +++ b/xfa/fxfa/include/xfa_ffdoc.h @@ -0,0 +1,65 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_INCLUDE_XFA_FFDOC_H_ +#define XFA_FXFA_INCLUDE_XFA_FFDOC_H_ + +#include "xfa/fxfa/include/fxfa.h" +#include "xfa/fxfa/parser/xfa_document.h" + +class CXFA_ChecksumContext; +class CXFA_FFApp; +class CXFA_FFNotify; +class CXFA_FFDocView; + +struct FX_IMAGEDIB_AND_DPI { + CFX_DIBSource* pDibSource; + int32_t iImageXDpi; + int32_t iImageYDpi; +}; + +class CXFA_FFDoc { + public: + CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocProvider* pDocProvider); + ~CXFA_FFDoc(); + IXFA_DocProvider* GetDocProvider() { return m_pDocProvider; } + uint32_t GetDocType(); + int32_t StartLoad(); + int32_t DoLoad(IFX_Pause* pPause = NULL); + void StopLoad(); + CXFA_FFDocView* CreateDocView(uint32_t dwView = 0); + FX_BOOL OpenDoc(IFX_FileRead* pStream, FX_BOOL bTakeOverFile); + FX_BOOL OpenDoc(CPDF_Document* pPDFDoc); + FX_BOOL CloseDoc(); + void SetDocType(uint32_t dwType); + CXFA_Document* GetXFADoc() { return m_pDocument; } + CXFA_FFApp* GetApp() { return m_pApp; } + CXFA_FFDocView* GetDocView(CXFA_LayoutProcessor* pLayout); + CXFA_FFDocView* GetDocView(); + CPDF_Document* GetPDFDoc(); + CFX_DIBitmap* GetPDFNamedImage(const CFX_WideStringC& wsName, + int32_t& iImageXDpi, + int32_t& iImageYDpi); + CFDE_XMLElement* GetPackageData(const CFX_WideStringC& wsPackage); + FX_BOOL SavePackage(const CFX_WideStringC& wsPackage, + IFX_FileWrite* pFile, + CXFA_ChecksumContext* pCSContext = NULL); + FX_BOOL ImportData(IFX_FileRead* pStream, FX_BOOL bXDP = TRUE); + + protected: + IXFA_DocProvider* m_pDocProvider; + CXFA_Document* m_pDocument; + IFX_FileRead* m_pStream; + CXFA_FFApp* m_pApp; + CXFA_FFNotify* m_pNotify; + CPDF_Document* m_pPDFDoc; + CFX_MapPtrToPtr m_mapNamedImages; + CFX_MapPtrToPtr m_mapTypeToDocView; + uint32_t m_dwDocType; + FX_BOOL m_bOwnStream; +}; + +#endif // XFA_FXFA_INCLUDE_XFA_FFDOC_H_ diff --git a/xfa/fxfa/include/xfa_ffdochandler.h b/xfa/fxfa/include/xfa_ffdochandler.h new file mode 100644 index 0000000000..9cd9b0e632 --- /dev/null +++ b/xfa/fxfa/include/xfa_ffdochandler.h @@ -0,0 +1,31 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_INCLUDE_XFA_FFDOCHANDLER_H_ +#define XFA_FXFA_INCLUDE_XFA_FFDOCHANDLER_H_ + +#include "xfa/fxfa/include/fxfa.h" + +class CXFA_ChecksumContext; + +class CXFA_FFDocHandler { + public: + CXFA_FFDocHandler(); + ~CXFA_FFDocHandler(); + + FXJSE_HVALUE GetXFAScriptObject(CXFA_FFDoc* hDoc); + XFA_ATTRIBUTEENUM GetRestoreState(CXFA_FFDoc* hDoc); + + FX_BOOL RunDocScript(CXFA_FFDoc* hDoc, + XFA_SCRIPTTYPE eScriptType, + const CFX_WideStringC& wsScript, + FXJSE_HVALUE hRetValue, + FXJSE_HVALUE hThisObject); + + protected: +}; + +#endif // XFA_FXFA_INCLUDE_XFA_FFDOCHANDLER_H_ diff --git a/xfa/fxfa/include/xfa_ffdocview.h b/xfa/fxfa/include/xfa_ffdocview.h new file mode 100644 index 0000000000..27ef8e96d4 --- /dev/null +++ b/xfa/fxfa/include/xfa_ffdocview.h @@ -0,0 +1,172 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_INCLUDE_XFA_FFDOCVIEW_H_ +#define XFA_FXFA_INCLUDE_XFA_FFDOCVIEW_H_ + +#include "xfa/fxfa/include/xfa_ffdoc.h" + +class CXFA_FFWidgetHandler; +class CXFA_FFDoc; +class CXFA_FFWidget; +class CXFA_WidgetAccIterator; + +extern const XFA_ATTRIBUTEENUM gs_EventActivity[]; +enum XFA_DOCVIEW_LAYOUTSTATUS { + XFA_DOCVIEW_LAYOUTSTATUS_None, + XFA_DOCVIEW_LAYOUTSTATUS_Start, + XFA_DOCVIEW_LAYOUTSTATUS_FormInitialize, + XFA_DOCVIEW_LAYOUTSTATUS_FormInitCalculate, + XFA_DOCVIEW_LAYOUTSTATUS_FormInitValidate, + XFA_DOCVIEW_LAYOUTSTATUS_FormFormReady, + XFA_DOCVIEW_LAYOUTSTATUS_Doing, + XFA_DOCVIEW_LAYOUTSTATUS_PagesetInitialize, + XFA_DOCVIEW_LAYOUTSTATUS_PagesetInitCalculate, + XFA_DOCVIEW_LAYOUTSTATUS_PagesetInitValidate, + XFA_DOCVIEW_LAYOUTSTATUS_PagesetFormReady, + XFA_DOCVIEW_LAYOUTSTATUS_LayoutReady, + XFA_DOCVIEW_LAYOUTSTATUS_DocReady, + XFA_DOCVIEW_LAYOUTSTATUS_End +}; +class CXFA_FFDocView { + public: + CXFA_FFDocView(CXFA_FFDoc* pDoc); + ~CXFA_FFDocView(); + + CXFA_FFDoc* GetDoc() { return m_pDoc; } + int32_t StartLayout(int32_t iStartPage = 0); + int32_t DoLayout(IFX_Pause* pPause = NULL); + void StopLayout(); + int32_t GetLayoutStatus(); + void UpdateDocView(); + int32_t CountPageViews(); + CXFA_FFPageView* GetPageView(int32_t nIndex); + + void ResetWidgetData(CXFA_WidgetAcc* pWidgetAcc = NULL); + int32_t ProcessWidgetEvent(CXFA_EventParam* pParam, + CXFA_WidgetAcc* pWidgetAcc = NULL); + CXFA_FFWidgetHandler* GetWidgetHandler(); + IXFA_WidgetIterator* CreateWidgetIterator(); + CXFA_WidgetAccIterator* CreateWidgetAccIterator( + XFA_WIDGETORDER eOrder = XFA_WIDGETORDER_PreOrder); + CXFA_FFWidget* GetFocusWidget(); + void KillFocus(); + FX_BOOL SetFocus(CXFA_FFWidget* hWidget); + CXFA_FFWidget* GetWidgetByName(const CFX_WideStringC& wsName, + CXFA_FFWidget* pRefWidget = NULL); + CXFA_WidgetAcc* GetWidgetAccByName(const CFX_WideStringC& wsName, + CXFA_WidgetAcc* pRefWidgetAcc = NULL); + CXFA_LayoutProcessor* GetXFALayout() const; + void OnPageEvent(CXFA_ContainerLayoutItem* pSender, + XFA_PAGEEVENT eEvent, + int32_t iPageIndex); + void LockUpdate(); + void UnlockUpdate(); + FX_BOOL IsUpdateLocked(); + void ClearInvalidateList(); + void AddInvalidateRect(CXFA_FFWidget* pWidget, const CFX_RectF& rtInvalidate); + void AddInvalidateRect(CXFA_FFPageView* pPageView, + const CFX_RectF& rtInvalidate); + void RunInvalidate(); + void RunDocClose(); + void DestroyDocView(); + + FX_BOOL InitValidate(CXFA_Node* pNode); + FX_BOOL RunValidate(); + + void SetChangeMark(); + + void AddValidateWidget(CXFA_WidgetAcc* pWidget); + void AddCalculateNodeNotify(CXFA_Node* pNodeChange); + void AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc); + int32_t RunCalculateWidgets(); + FX_BOOL IsStaticNotify(); + FX_BOOL RunLayout(); + void RunSubformIndexChange(); + void AddNewFormNode(CXFA_Node* pNode); + void AddIndexChangedSubform(CXFA_Node* pNode); + CXFA_WidgetAcc* GetFocusWidgetAcc(); + void SetFocusWidgetAcc(CXFA_WidgetAcc* pWidgetAcc); + void DeleteLayoutItem(CXFA_FFWidget* pWidget); + int32_t ExecEventActivityByDeepFirst(CXFA_Node* pFormNode, + XFA_EVENTTYPE eEventType, + FX_BOOL bIsFormReady = FALSE, + FX_BOOL bRecursive = TRUE, + CXFA_Node* pExclude = NULL); + FX_BOOL m_bLayoutEvent; + CFX_WideStringArray m_arrNullTestMsg; + CXFA_FFWidget* m_pListFocusWidget; + FX_BOOL m_bInLayoutStatus; + + protected: + FX_BOOL RunEventLayoutReady(); + void RunBindItems(); + FX_BOOL InitCalculate(CXFA_Node* pNode); + void InitLayout(CXFA_Node* pNode); + void RunCalculateRecursive(int32_t& iIndex); + void ShowNullTestMsg(); + FX_BOOL ResetSingleWidgetAccData(CXFA_WidgetAcc* pWidgetAcc); + CXFA_Node* GetRootSubform(); + + CXFA_FFDoc* m_pDoc; + CXFA_FFWidgetHandler* m_pWidgetHandler; + CXFA_LayoutProcessor* m_pXFADocLayout; + CXFA_WidgetAcc* m_pFocusAcc; + CXFA_FFWidget* m_pFocusWidget; + CXFA_FFWidget* m_pOldFocusWidget; + CFX_MapPtrToPtr m_mapPageInvalidate; + CFX_PtrArray m_ValidateAccs; + CFX_PtrArray m_bindItems; + CFX_PtrArray m_CalculateAccs; + + CFX_PtrArray m_NewAddedNodes; + CFX_PtrArray m_IndexChangedSubforms; + XFA_DOCVIEW_LAYOUTSTATUS m_iStatus; + int32_t m_iLock; + friend class CXFA_FFNotify; +}; +class CXFA_FFDocWidgetIterator : public IXFA_WidgetIterator { + public: + CXFA_FFDocWidgetIterator(CXFA_FFDocView* pDocView, CXFA_Node* pTravelRoot); + virtual ~CXFA_FFDocWidgetIterator(); + + virtual void Release() { delete this; } + + virtual void Reset(); + virtual CXFA_FFWidget* MoveToFirst(); + virtual CXFA_FFWidget* MoveToLast(); + virtual CXFA_FFWidget* MoveToNext(); + virtual CXFA_FFWidget* MoveToPrevious(); + virtual CXFA_FFWidget* GetCurrentWidget(); + virtual FX_BOOL SetCurrentWidget(CXFA_FFWidget* hWidget); + + protected: + CXFA_ContainerIterator m_ContentIterator; + CXFA_FFDocView* m_pDocView; + CXFA_FFWidget* m_pCurWidget; +}; +class CXFA_WidgetAccIterator { + public: + CXFA_WidgetAccIterator(CXFA_FFDocView* pDocView, CXFA_Node* pTravelRoot); + ~CXFA_WidgetAccIterator(); + + void Release() { delete this; } + void Reset(); + CXFA_WidgetAcc* MoveToFirst(); + CXFA_WidgetAcc* MoveToLast(); + CXFA_WidgetAcc* MoveToNext(); + CXFA_WidgetAcc* MoveToPrevious(); + CXFA_WidgetAcc* GetCurrentWidgetAcc(); + FX_BOOL SetCurrentWidgetAcc(CXFA_WidgetAcc* hWidget); + void SkipTree(); + + protected: + CXFA_ContainerIterator m_ContentIterator; + CXFA_FFDocView* m_pDocView; + CXFA_WidgetAcc* m_pCurWidgetAcc; +}; + +#endif // XFA_FXFA_INCLUDE_XFA_FFDOCVIEW_H_ diff --git a/xfa/fxfa/include/xfa_ffpageview.h b/xfa/fxfa/include/xfa_ffpageview.h new file mode 100644 index 0000000000..56d1a7312c --- /dev/null +++ b/xfa/fxfa/include/xfa_ffpageview.h @@ -0,0 +1,113 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_INCLUDE_XFA_FFPAGEVIEW_H_ +#define XFA_FXFA_INCLUDE_XFA_FFPAGEVIEW_H_ + +#include "xfa/fxfa/parser/xfa_doclayout.h" + +class CXFA_FFWidget; +class CXFA_FFDocView; +class CXFA_FFPageView : public CXFA_ContainerLayoutItem { + public: + CXFA_FFPageView(CXFA_FFDocView* pDocView, CXFA_Node* pPageArea); + ~CXFA_FFPageView() override; + + CXFA_FFDocView* GetDocView(); + int32_t GetPageViewIndex(); + void GetPageViewRect(CFX_RectF& rtPage); + void GetDisplayMatrix(CFX_Matrix& mt, + const CFX_Rect& rtDisp, + int32_t iRotate); + int32_t LoadPageView(IFX_Pause* pPause = NULL); + void UnloadPageView(); + CXFA_FFWidget* GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy); + IXFA_WidgetIterator* CreateWidgetIterator( + uint32_t dwTraverseWay = XFA_TRAVERSEWAY_Form, + uint32_t dwWidgetFilter = XFA_WIDGETFILTER_Visible | + XFA_WIDGETFILTER_Viewable | + XFA_WIDGETFILTER_AllType); + + FX_BOOL IsPageViewLoaded(); + + protected: + CXFA_FFDocView* m_pDocView; + FX_BOOL m_bLoaded; +}; +typedef CXFA_NodeIteratorTemplate<CXFA_LayoutItem, + CXFA_TraverseStrategy_LayoutItem> + CXFA_LayoutItemIterator; +class CXFA_FFPageWidgetIterator : public IXFA_WidgetIterator { + public: + CXFA_FFPageWidgetIterator(CXFA_FFPageView* pPageView, uint32_t dwFilter); + virtual ~CXFA_FFPageWidgetIterator(); + + void Release() override { delete this; } + + void Reset() override; + CXFA_FFWidget* MoveToFirst() override; + CXFA_FFWidget* MoveToLast() override; + CXFA_FFWidget* MoveToNext() override; + CXFA_FFWidget* MoveToPrevious() override; + CXFA_FFWidget* GetCurrentWidget() override; + FX_BOOL SetCurrentWidget(CXFA_FFWidget* hWidget) override; + + protected: + CXFA_FFWidget* GetWidget(CXFA_LayoutItem* pLayoutItem); + + CXFA_FFPageView* m_pPageView; + CXFA_FFWidget* m_hCurWidget; + uint32_t m_dwFilter; + FX_BOOL m_bIgnorerelevant; + CXFA_LayoutItemIterator m_sIterator; +}; +typedef CFX_ArrayTemplate<CXFA_FFWidget*> CXFA_WidgetArray; +class CXFA_TabParam { + public: + CXFA_TabParam() : m_pWidget(NULL) {} + ~CXFA_TabParam() {} + + CXFA_FFWidget* m_pWidget; + CXFA_WidgetArray m_Children; +}; +class CXFA_FFTabOrderPageWidgetIterator : public IXFA_WidgetIterator { + public: + CXFA_FFTabOrderPageWidgetIterator(CXFA_FFPageView* pPageView, + uint32_t dwFilter); + virtual ~CXFA_FFTabOrderPageWidgetIterator(); + + void Release() override; + + void Reset() override; + CXFA_FFWidget* MoveToFirst() override; + CXFA_FFWidget* MoveToLast() override; + CXFA_FFWidget* MoveToNext() override; + CXFA_FFWidget* MoveToPrevious() override; + CXFA_FFWidget* GetCurrentWidget() override; + FX_BOOL SetCurrentWidget(CXFA_FFWidget* hWidget) override; + + protected: + CXFA_FFWidget* GetTraverseWidget(CXFA_FFWidget* pWidget); + CXFA_FFWidget* FindWidgetByName(const CFX_WideStringC& wsWidgetName, + CXFA_FFWidget* pRefWidget); + void CreateTabOrderWidgetArray(); + void CreateSpaceOrderWidgetArray(CXFA_WidgetArray& WidgetArray); + CXFA_FFWidget* GetWidget(CXFA_LayoutItem* pLayoutItem); + void OrderContainer(CXFA_LayoutItemIterator* sIterator, + CXFA_LayoutItem* pContainerItem, + CXFA_TabParam* pContainer, + FX_BOOL& bCurrentItem, + FX_BOOL& bContentArea, + FX_BOOL bMarsterPage = FALSE); + + CXFA_WidgetArray m_TabOrderWidgetArray; + CXFA_FFPageView* m_pPageView; + uint32_t m_dwFilter; + int32_t m_iCurWidget; + FX_BOOL m_bIgnorerelevant; +}; + +#endif // XFA_FXFA_INCLUDE_XFA_FFPAGEVIEW_H_ diff --git a/xfa/fxfa/include/xfa_ffwidget.h b/xfa/fxfa/include/xfa_ffwidget.h new file mode 100644 index 0000000000..0c0ba75791 --- /dev/null +++ b/xfa/fxfa/include/xfa_ffwidget.h @@ -0,0 +1,182 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_INCLUDE_XFA_FFWIDGET_H_ +#define XFA_FXFA_INCLUDE_XFA_FFWIDGET_H_ + +#include <vector> + +#include "core/fxcodec/include/fx_codec_def.h" +#include "core/fxge/include/fx_ge.h" +#include "xfa/fxfa/include/fxfa.h" +#include "xfa/fxfa/parser/xfa_doclayout.h" + +class CXFA_FFPageView; +class CXFA_FFDocView; +class CXFA_FFDoc; +class CXFA_FFApp; + +inline FX_FLOAT XFA_UnitPx2Pt(FX_FLOAT fPx, FX_FLOAT fDpi) { + return fPx * 72.0f / fDpi; +} +#define XFA_FLOAT_PERCISION 0.001f +enum XFA_WIDGETITEM { + XFA_WIDGETITEM_Parent, + XFA_WIDGETITEM_FirstChild, + XFA_WIDGETITEM_NextSibling, + XFA_WIDGETITEM_PrevSibling, +}; +class CXFA_CalcData { + public: + CXFA_CalcData() : m_iRefCount(0) {} + ~CXFA_CalcData() { m_Globals.RemoveAll(); } + CFX_PtrArray m_Globals; + int32_t m_iRefCount; +}; +class CXFA_FFWidget : public CFX_PrivateData, public CXFA_ContentLayoutItem { + public: + CXFA_FFWidget(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); + virtual ~CXFA_FFWidget(); + CXFA_FFPageView* GetPageView(); + void SetPageView(CXFA_FFPageView* pPageView); + void GetWidgetRect(CFX_RectF& rtWidget); + CFX_RectF ReCacheWidgetRect(); + uint32_t GetStatus(); + void ModifyStatus(uint32_t dwAdded, uint32_t dwRemoved); + virtual FX_BOOL GetBBox(CFX_RectF& rtBox, + uint32_t dwStatus, + FX_BOOL bDrawFocus = FALSE); + CXFA_WidgetAcc* GetDataAcc(); + FX_BOOL GetToolTip(CFX_WideString& wsToolTip); + virtual void RenderWidget(CFX_Graphics* pGS, + CFX_Matrix* pMatrix = NULL, + uint32_t dwStatus = 0, + int32_t iRotate = 0); + + virtual FX_BOOL IsLoaded(); + virtual FX_BOOL LoadWidget(); + virtual void UnloadWidget(); + virtual FX_BOOL PerformLayout(); + virtual FX_BOOL UpdateFWLData(); + virtual void UpdateWidgetProperty(); + virtual FX_BOOL OnMouseEnter(); + virtual FX_BOOL OnMouseExit(); + virtual FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); + virtual FX_BOOL OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); + virtual FX_BOOL OnLButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); + virtual FX_BOOL OnMouseMove(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); + virtual FX_BOOL OnMouseWheel(uint32_t dwFlags, + int16_t zDelta, + FX_FLOAT fx, + FX_FLOAT fy); + virtual FX_BOOL OnRButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); + virtual FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); + virtual FX_BOOL OnRButtonDblClk(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); + + virtual FX_BOOL OnSetFocus(CXFA_FFWidget* pOldWidget); + virtual FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget); + virtual FX_BOOL OnKeyDown(uint32_t dwKeyCode, uint32_t dwFlags); + virtual FX_BOOL OnKeyUp(uint32_t dwKeyCode, uint32_t dwFlags); + virtual FX_BOOL OnChar(uint32_t dwChar, uint32_t dwFlags); + virtual uint32_t OnHitTest(FX_FLOAT fx, FX_FLOAT fy); + virtual FX_BOOL OnSetCursor(FX_FLOAT fx, FX_FLOAT fy); + virtual FX_BOOL CanUndo() { return FALSE; } + virtual FX_BOOL CanRedo() { return FALSE; } + virtual FX_BOOL Undo() { return FALSE; } + virtual FX_BOOL Redo() { return FALSE; } + virtual FX_BOOL CanCopy() { return FALSE; } + virtual FX_BOOL CanCut() { return FALSE; } + virtual FX_BOOL CanPaste() { return FALSE; } + virtual FX_BOOL CanSelectAll() { return FALSE; } + virtual FX_BOOL CanDelete() { return CanCut(); } + virtual FX_BOOL CanDeSelect() { return CanCopy(); } + virtual FX_BOOL Copy(CFX_WideString& wsCopy) { return FALSE; } + virtual FX_BOOL Cut(CFX_WideString& wsCut) { return FALSE; } + virtual FX_BOOL Paste(const CFX_WideString& wsPaste) { return FALSE; } + virtual FX_BOOL SelectAll() { return FALSE; } + virtual FX_BOOL Delete() { return FALSE; } + virtual FX_BOOL DeSelect() { return FALSE; } + virtual FX_BOOL GetSuggestWords(CFX_PointF pointf, + std::vector<CFX_ByteString>& sSuggest) { + return FALSE; + } + virtual FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, + const CFX_ByteStringC& bsReplace) { + return FALSE; + } + CXFA_FFDocView* GetDocView(); + void SetDocView(CXFA_FFDocView* pDocView) { m_pDocView = pDocView; } + CXFA_FFDoc* GetDoc(); + CXFA_FFApp* GetApp(); + IXFA_AppProvider* GetAppProvider(); + void InvalidateWidget(const CFX_RectF* pRect = NULL); + void AddInvalidateRect(const CFX_RectF* pRect = NULL); + FX_BOOL GetCaptionText(CFX_WideString& wsCap); + FX_BOOL IsFocused(); + void Rotate2Normal(FX_FLOAT& fx, FX_FLOAT& fy); + void GetRotateMatrix(CFX_Matrix& mt); + FX_BOOL IsLayoutRectEmpty(); + CXFA_FFWidget* GetParent(); + FX_BOOL IsAncestorOf(CXFA_FFWidget* pWidget); + + protected: + virtual FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy); + void DrawBorder(CFX_Graphics* pGS, + CXFA_Box box, + const CFX_RectF& rtBorder, + CFX_Matrix* pMatrix, + uint32_t dwFlags = 0); + void GetMinMaxWidth(FX_FLOAT fMinWidth, FX_FLOAT fMaxWidth); + void GetMinMaxHeight(FX_FLOAT fMinHeight, FX_FLOAT fMaxHeight); + void GetRectWithoutRotate(CFX_RectF& rtWidget); + FX_BOOL IsMatchVisibleStatus(uint32_t dwStatus); + + void EventKillFocus(); + FX_BOOL IsButtonDown(); + void SetButtonDown(FX_BOOL bSet); + CXFA_FFDocView* m_pDocView; + CXFA_FFPageView* m_pPageView; + CXFA_WidgetAcc* m_pDataAcc; + CFX_RectF m_rtWidget; +}; +int32_t XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics, + int32_t iStrokeType, + int32_t iCapType); +CFX_GraphStateData::LineCap XFA_LineCapToFXGE(int32_t iLineCap); +void XFA_DrawImage(CFX_Graphics* pGS, + const CFX_RectF& rtImage, + CFX_Matrix* pMatrix, + CFX_DIBitmap* pDIBitmap, + int32_t iAspect, + int32_t iImageXDpi, + int32_t iImageYDpi, + int32_t iHorzAlign = XFA_ATTRIBUTEENUM_Left, + int32_t iVertAlign = XFA_ATTRIBUTEENUM_Top); +CFX_DIBitmap* XFA_LoadImageData(CXFA_FFDoc* pDoc, + CXFA_Image* pImage, + FX_BOOL& bNameImage, + int32_t& iImageXDpi, + int32_t& iImageYDpi); +CFX_DIBitmap* XFA_LoadImageFromBuffer(IFX_FileRead* pImageFileRead, + FXCODEC_IMAGE_TYPE type, + int32_t& iImageXDpi, + int32_t& iImageYDpi); +FXCODEC_IMAGE_TYPE XFA_GetImageType(const CFX_WideString& wsType); +FX_CHAR* XFA_Base64Encode(const uint8_t* buf, int32_t buf_len); +void XFA_RectWidthoutMargin(CFX_RectF& rt, + const CXFA_Margin& mg, + FX_BOOL bUI = FALSE); +CXFA_FFWidget* XFA_GetWidgetFromLayoutItem(CXFA_LayoutItem* pLayoutItem); +FX_BOOL XFA_IsCreateWidget(XFA_ELEMENT iType); +#define XFA_DRAWBOX_ForceRound 1 +#define XFA_DRAWBOX_Lowered3D 2 +void XFA_DrawBox(CXFA_Box box, + CFX_Graphics* pGS, + const CFX_RectF& rtWidget, + CFX_Matrix* pMatrix, + uint32_t dwFlags = 0); + +#endif // XFA_FXFA_INCLUDE_XFA_FFWIDGET_H_ diff --git a/xfa/fxfa/include/xfa_ffwidgethandler.h b/xfa/fxfa/include/xfa_ffwidgethandler.h new file mode 100644 index 0000000000..f6cd2170a5 --- /dev/null +++ b/xfa/fxfa/include/xfa_ffwidgethandler.h @@ -0,0 +1,127 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_INCLUDE_XFA_FFWIDGETHANDLER_H_ +#define XFA_FXFA_INCLUDE_XFA_FFWIDGETHANDLER_H_ + +#include <vector> + +#include "xfa/fxfa/include/fxfa.h" +#include "xfa/fxfa/parser/xfa_document.h" + +class CXFA_FFDocView; + +class CXFA_FFWidgetHandler { + public: + CXFA_FFWidgetHandler(CXFA_FFDocView* pDocView); + ~CXFA_FFWidgetHandler(); + + CXFA_FFWidget* CreateWidget(CXFA_FFWidget* hParent, + XFA_WIDGETTYPE eType, + CXFA_FFWidget* hBefore = NULL); + + FX_BOOL OnMouseEnter(CXFA_FFWidget* hWidget); + FX_BOOL OnMouseExit(CXFA_FFWidget* hWidget); + FX_BOOL OnLButtonDown(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy); + FX_BOOL OnLButtonUp(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy); + FX_BOOL OnLButtonDblClk(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy); + FX_BOOL OnMouseMove(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy); + FX_BOOL OnMouseWheel(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + int16_t zDelta, + FX_FLOAT fx, + FX_FLOAT fy); + FX_BOOL OnRButtonDown(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy); + FX_BOOL OnRButtonUp(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy); + FX_BOOL OnRButtonDblClk(CXFA_FFWidget* hWidget, + uint32_t dwFlags, + FX_FLOAT fx, + FX_FLOAT fy); + + FX_BOOL OnKeyDown(CXFA_FFWidget* hWidget, + uint32_t dwKeyCode, + uint32_t dwFlags); + FX_BOOL OnKeyUp(CXFA_FFWidget* hWidget, uint32_t dwKeyCode, uint32_t dwFlags); + FX_BOOL OnChar(CXFA_FFWidget* hWidget, uint32_t dwChar, uint32_t dwFlags); + uint32_t OnHitTest(CXFA_FFWidget* hWidget, FX_FLOAT fx, FX_FLOAT fy); + FX_BOOL OnSetCursor(CXFA_FFWidget* hWidget, FX_FLOAT fx, FX_FLOAT fy); + void RenderWidget(CXFA_FFWidget* hWidget, + CFX_Graphics* pGS, + CFX_Matrix* pMatrix = NULL, + FX_BOOL bHighlight = FALSE); + FX_BOOL HasEvent(CXFA_WidgetAcc* pWidgetAcc, XFA_EVENTTYPE eEventType); + int32_t ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, CXFA_EventParam* pParam); + + protected: + CXFA_Node* CreateWidgetFormItem(XFA_WIDGETTYPE eType, + CXFA_Node* pParent, + CXFA_Node* pBefore) const; + + CXFA_Node* CreatePushButton(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateCheckButton(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateExclGroup(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateRadioButton(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateDatetimeEdit(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateDecimalField(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateNumericField(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateSignature(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateTextEdit(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateDropdownList(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateListBox(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateImageField(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreatePasswordEdit(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateField(XFA_ELEMENT eElement, + CXFA_Node* pParent, + CXFA_Node* pBefore) const; + CXFA_Node* CreateArc(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateRectangle(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateImage(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateLine(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateText(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateDraw(XFA_ELEMENT eElement, + CXFA_Node* pParent, + CXFA_Node* pBefore) const; + + CXFA_Node* CreateSubform(CXFA_Node* pParent, CXFA_Node* pBefore) const; + CXFA_Node* CreateFormItem(XFA_ELEMENT eElement, + CXFA_Node* pParent, + CXFA_Node* pBefore) const; + CXFA_Node* CreateCopyNode(XFA_ELEMENT eElement, + CXFA_Node* pParent, + CXFA_Node* pBefore = NULL) const; + CXFA_Node* CreateTemplateNode(XFA_ELEMENT eElement, + CXFA_Node* pParent, + CXFA_Node* pBefore) const; + CXFA_Node* CreateFontNode(CXFA_Node* pParent) const; + CXFA_Node* CreateMarginNode(CXFA_Node* pParent, + uint32_t dwFlags, + FX_FLOAT fInsets[4]) const; + CXFA_Node* CreateValueNode(XFA_ELEMENT eValue, CXFA_Node* pParent) const; + CXFA_Document* GetObjFactory() const; + CXFA_Document* GetXFADoc() const; + + CXFA_FFDocView* m_pDocView; +}; + +#endif // XFA_FXFA_INCLUDE_XFA_FFWIDGETHANDLER_H_ diff --git a/xfa/fxfa/include/xfa_fontmgr.h b/xfa/fxfa/include/xfa_fontmgr.h new file mode 100644 index 0000000000..cab3cfb219 --- /dev/null +++ b/xfa/fxfa/include/xfa_fontmgr.h @@ -0,0 +1,99 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_INCLUDE_XFA_FONTMGR_H_ +#define XFA_FXFA_INCLUDE_XFA_FONTMGR_H_ + +#include <map> + +#include "core/fxcrt/include/fx_ext.h" +#include "core/fxcrt/include/fx_system.h" +#include "xfa/fgas/font/fgas_font.h" +#include "xfa/fxfa/include/fxfa.h" + +class CPDF_Font; + +struct XFA_FONTINFO { + uint32_t dwFontNameHash; + const FX_WCHAR* pPsName; + const FX_WCHAR* pReplaceFont; + uint16_t dwStyles; + uint16_t wCodePage; +}; + +class CXFA_DefFontMgr { + public: + CXFA_DefFontMgr() {} + ~CXFA_DefFontMgr(); + + IFX_Font* GetFont(CXFA_FFDoc* hDoc, + const CFX_WideStringC& wsFontFamily, + uint32_t dwFontStyles, + uint16_t wCodePage = 0xFFFF); + IFX_Font* GetDefaultFont(CXFA_FFDoc* hDoc, + const CFX_WideStringC& wsFontFamily, + uint32_t dwFontStyles, + uint16_t wCodePage = 0xFFFF); + + protected: + CFX_PtrArray m_CacheFonts; +}; + +class CXFA_PDFFontMgr : public IFX_FontProvider { + public: + CXFA_PDFFontMgr(CXFA_FFDoc* pDoc); + ~CXFA_PDFFontMgr(); + IFX_Font* GetFont(const CFX_WideStringC& wsFontFamily, + uint32_t dwFontStyles, + CPDF_Font** pPDFFont, + FX_BOOL bStrictMatch = TRUE); + FX_BOOL GetCharWidth(IFX_Font* pFont, + FX_WCHAR wUnicode, + int32_t& iWidth, + FX_BOOL bCharCode); + CFX_MapPtrToPtr m_FDE2PDFFont; + + protected: + IFX_Font* FindFont(CFX_ByteString strFamilyName, + FX_BOOL bBold, + FX_BOOL bItalic, + CPDF_Font** pPDFFont, + FX_BOOL bStrictMatch = TRUE); + CFX_ByteString PsNameToFontName(const CFX_ByteString& strPsName, + FX_BOOL bBold, + FX_BOOL bItalic); + FX_BOOL PsNameMatchDRFontName(const CFX_ByteStringC& bsPsName, + FX_BOOL bBold, + FX_BOOL bItalic, + const CFX_ByteString& bsDRFontName, + FX_BOOL bStrictMatch = TRUE); + + CXFA_FFDoc* m_pDoc; + std::map<CFX_ByteString, IFX_Font*> m_FontMap; +}; + +class CXFA_FontMgr { + public: + CXFA_FontMgr(); + ~CXFA_FontMgr(); + IFX_Font* GetFont(CXFA_FFDoc* hDoc, + const CFX_WideStringC& wsFontFamily, + uint32_t dwFontStyles, + uint16_t wCodePage = 0xFFFF); + void LoadDocFonts(CXFA_FFDoc* hDoc); + void ReleaseDocFonts(CXFA_FFDoc* hDoc); + + void SetDefFontMgr(CXFA_DefFontMgr* pFontMgr); + + protected: + void DelAllMgrMap(); + + CFX_MapPtrToPtr m_PDFFontMgrArray; + CXFA_DefFontMgr* m_pDefFontMgr; + std::map<CFX_ByteString, IFX_Font*> m_FontMap; +}; + +#endif // XFA_FXFA_INCLUDE_XFA_FONTMGR_H_ diff --git a/xfa/fxfa/include/xfa_rendercontext.h b/xfa/fxfa/include/xfa_rendercontext.h new file mode 100644 index 0000000000..cd7949d78b --- /dev/null +++ b/xfa/fxfa/include/xfa_rendercontext.h @@ -0,0 +1,36 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FXFA_INCLUDE_XFA_RENDERCONTEXT_H_ +#define XFA_FXFA_INCLUDE_XFA_RENDERCONTEXT_H_ + +#include "xfa/fxfa/include/fxfa.h" + +class CXFA_RenderContext { + public: + CXFA_RenderContext(); + ~CXFA_RenderContext(); + + void Release() { delete this; } + int32_t StartRender(CXFA_FFPageView* pPageView, + CFX_Graphics* pGS, + const CFX_Matrix& matrix, + const CXFA_RenderOptions& options); + int32_t DoRender(IFX_Pause* pPause = NULL); + void StopRender(); + + protected: + IXFA_WidgetIterator* m_pWidgetIterator; + CXFA_FFWidget* m_pWidget; + CXFA_FFPageView* m_pPageView; + CFX_Graphics* m_pGS; + CFX_Matrix m_matrix; + CXFA_RenderOptions m_options; + uint32_t m_dwStatus; + CFX_RectF m_rtClipRect; +}; + +#endif // XFA_FXFA_INCLUDE_XFA_RENDERCONTEXT_H_ |