Replace XFA_HDOC with IXFA_Doc*
[pdfium.git] / fpdfsdk / include / fpdfxfa / fpdfxfa_doc.h
index 954162e..dc15ec4 100644 (file)
@@ -4,8 +4,8 @@
  \r
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
 \r
-#ifndef _FPDFXFA_DOC_H_\r
-#define _FPDFXFA_DOC_H_\r
+#ifndef FPDFXFA_DOC_H_\r
+#define FPDFXFA_DOC_H_\r
 \r
 class CPDFXFA_App;\r
 class CPDFXFA_Document;\r
@@ -25,7 +25,7 @@ public:
        FX_BOOL                         LoadXFADoc();\r
        CPDFXFA_App*            GetApp() {return m_pApp;}\r
        CPDF_Document*          GetPDFDoc() { return m_pPDFDoc; }\r
-       XFA_HDOC                        GetXFADoc() { return m_pXFADoc; }\r
+       IXFA_Doc*                       GetXFADoc() { return m_pXFADoc; }\r
        IXFA_DocView*       GetXFADocView() { return m_pXFADocView; }\r
 \r
        int                                     GetPageCount();\r
@@ -40,8 +40,8 @@ public:
        void                            FXRect2PDFRect(const CFX_RectF& fxRectF, CPDF_Rect& pdfRect);\r
 \r
 public:\r
-       virtual void            SetChangeMark(XFA_HDOC hDoc);\r
-       virtual FX_BOOL         GetChangeMark(XFA_HDOC hDoc);\r
+       virtual void            SetChangeMark(IXFA_Doc* hDoc);\r
+       virtual FX_BOOL         GetChangeMark(IXFA_Doc* hDoc);\r
        //used in dynamic xfa, dwFlags refer to XFA_INVALIDATE_XXX macros.\r
        virtual void            InvalidateRect(IXFA_PageView* pPageView, const CFX_RectF& rt, FX_DWORD dwFlags = 0);\r
        //used in static xfa, dwFlags refer to XFA_INVALIDATE_XXX macros.\r
@@ -62,37 +62,37 @@ public:
        virtual FX_BOOL         RenderCustomWidget(XFA_HWIDGET hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix, const CFX_RectF& rtUI){return FALSE;}\r
 \r
        //host method\r
-       virtual FX_INT32        CountPages(XFA_HDOC hDoc);\r
-       virtual FX_INT32        GetCurrentPage(XFA_HDOC hDoc);\r
-       virtual void            SetCurrentPage(XFA_HDOC hDoc, FX_INT32 iCurPage);\r
-       virtual FX_BOOL         IsCalculationsEnabled(XFA_HDOC hDoc);\r
-       virtual void            SetCalculationsEnabled(XFA_HDOC hDoc, FX_BOOL bEnabled);\r
-       virtual void            GetTitle(XFA_HDOC hDoc, CFX_WideString &wsTitle);\r
-       virtual void            SetTitle(XFA_HDOC hDoc, FX_WSTR wsTitle);\r
-       virtual void            ExportData(XFA_HDOC hDoc, FX_WSTR wsFilePath, FX_BOOL bXDP = TRUE);\r
-       virtual void            ImportData(XFA_HDOC hDoc, FX_WSTR wsFilePath);\r
-       virtual void            GotoURL(XFA_HDOC hDoc, FX_WSTR bsURL, FX_BOOL bAppend = TRUE);\r
-       virtual FX_BOOL         IsValidationsEnabled(XFA_HDOC hDoc);\r
-       virtual void            SetValidationsEnabled(XFA_HDOC hDoc, FX_BOOL bEnabled);\r
-       virtual void            SetFocusWidget(XFA_HDOC hDoc, XFA_HWIDGET hWidget);\r
-       virtual void            Print(XFA_HDOC hDoc, FX_INT32 nStartPage, FX_INT32 nEndPage, FX_DWORD dwOptions);\r
+       virtual FX_INT32        CountPages(IXFA_Doc* hDoc);\r
+       virtual FX_INT32        GetCurrentPage(IXFA_Doc* hDoc);\r
+       virtual void            SetCurrentPage(IXFA_Doc* hDoc, FX_INT32 iCurPage);\r
+       virtual FX_BOOL         IsCalculationsEnabled(IXFA_Doc* hDoc);\r
+       virtual void            SetCalculationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled);\r
+       virtual void            GetTitle(IXFA_Doc* hDoc, CFX_WideString &wsTitle);\r
+       virtual void            SetTitle(IXFA_Doc* hDoc, FX_WSTR wsTitle);\r
+       virtual void            ExportData(IXFA_Doc* hDoc, FX_WSTR wsFilePath, FX_BOOL bXDP = TRUE);\r
+       virtual void            ImportData(IXFA_Doc* hDoc, FX_WSTR wsFilePath);\r
+       virtual void            GotoURL(IXFA_Doc* hDoc, FX_WSTR bsURL, FX_BOOL bAppend = TRUE);\r
+       virtual FX_BOOL         IsValidationsEnabled(IXFA_Doc* hDoc);\r
+       virtual void            SetValidationsEnabled(IXFA_Doc* hDoc, FX_BOOL bEnabled);\r
+       virtual void            SetFocusWidget(IXFA_Doc* hDoc, XFA_HWIDGET hWidget);\r
+       virtual void            Print(IXFA_Doc* hDoc, FX_INT32 nStartPage, FX_INT32 nEndPage, FX_DWORD dwOptions);\r
 \r
        //LayoutPseudo method\r
-       virtual FX_INT32                        AbsPageCountInBatch(XFA_HDOC hDoc){return 0;}\r
-       virtual FX_INT32                        AbsPageInBatch(XFA_HDOC hDoc, XFA_HWIDGET hWidget){return 0;}\r
-       virtual FX_INT32                        SheetCountInBatch(XFA_HDOC hDoc){return 0;}\r
-       virtual FX_INT32                        SheetInBatch(XFA_HDOC hDoc, XFA_HWIDGET hWidget){return 0;}\r
+       virtual FX_INT32                        AbsPageCountInBatch(IXFA_Doc* hDoc){return 0;}\r
+       virtual FX_INT32                        AbsPageInBatch(IXFA_Doc* hDoc, XFA_HWIDGET hWidget){return 0;}\r
+       virtual FX_INT32                        SheetCountInBatch(IXFA_Doc* hDoc){return 0;}\r
+       virtual FX_INT32                        SheetInBatch(IXFA_Doc* hDoc, XFA_HWIDGET hWidget){return 0;}\r
 \r
        //SignaturePseudoModel method\r
        //TODO:\r
-       virtual FX_INT32                        Verify(XFA_HDOC hDoc, CXFA_Node* pSigNode, FX_BOOL bUsed = TRUE/*, SecurityHandler* pHandler, SignatureInfo &info*/) {return 0;}\r
-       virtual FX_BOOL                         Sign(XFA_HDOC hDoc, CXFA_NodeList* pNodeList, FX_WSTR wsExpression, FX_WSTR wsXMLIdent, FX_WSTR wsValue = FX_WSTRC(L"open"), FX_BOOL bUsed = TRUE/*, SecurityHandler* pHandler = NULL, SignatureInfo &info*/) {return 0;}\r
-       virtual CXFA_NodeList*          Enumerate(XFA_HDOC hDoc) {return 0;}\r
-       virtual FX_BOOL                         Clear(XFA_HDOC hDoc, CXFA_Node* pSigNode, FX_BOOL bCleared = TRUE) {return 0;}\r
+       virtual FX_INT32                        Verify(IXFA_Doc* hDoc, CXFA_Node* pSigNode, FX_BOOL bUsed = TRUE/*, SecurityHandler* pHandler, SignatureInfo &info*/) {return 0;}\r
+       virtual FX_BOOL                         Sign(IXFA_Doc* hDoc, CXFA_NodeList* pNodeList, FX_WSTR wsExpression, FX_WSTR wsXMLIdent, FX_WSTR wsValue = FX_WSTRC(L"open"), FX_BOOL bUsed = TRUE/*, SecurityHandler* pHandler = NULL, SignatureInfo &info*/) {return 0;}\r
+       virtual CXFA_NodeList*          Enumerate(IXFA_Doc* hDoc) {return 0;}\r
+       virtual FX_BOOL                         Clear(IXFA_Doc* hDoc, CXFA_Node* pSigNode, FX_BOOL bCleared = TRUE) {return 0;}\r
 \r
        //Get document path\r
-       virtual void            GetURL(XFA_HDOC hDoc, CFX_WideString &wsDocURL);\r
-       virtual FX_ARGB         GetHighlightColor(XFA_HDOC hDoc);\r
+       virtual void            GetURL(IXFA_Doc* hDoc, CFX_WideString &wsDocURL);\r
+       virtual FX_ARGB         GetHighlightColor(IXFA_Doc* hDoc);\r
        virtual void            AddDoRecord(XFA_HWIDGET hWidget);\r
        /** \r
         *Submit data to email, http, ftp.      \r
@@ -103,25 +103,25 @@ public:
         * @param[in] pXDPContent Controls what subset of the data is submitted, used only when the format property is xdp.\r
         * @param[in] bEmbedPDF, specifies whether PDF is embedded in the submitted content or not.\r
         */\r
-       virtual FX_BOOL         SubmitData(XFA_HDOC hDoc, CXFA_Submit submit);\r
+       virtual FX_BOOL         SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit);\r
 \r
-       virtual FX_BOOL         CheckWord(XFA_HDOC hDoc, FX_BSTR sWord){return FALSE;}\r
-       virtual FX_BOOL         GetSuggestWords(XFA_HDOC hDoc, FX_BSTR sWord, CFX_ByteStringArray& sSuggest){return FALSE;}\r
+       virtual FX_BOOL         CheckWord(IXFA_Doc* hDoc, FX_BSTR sWord){return FALSE;}\r
+       virtual FX_BOOL         GetSuggestWords(IXFA_Doc* hDoc, FX_BSTR sWord, CFX_ByteStringArray& sSuggest){return FALSE;}\r
 \r
        //Get PDF javascript object, set the object to hValue.\r
-       virtual FX_BOOL         GetPDFScriptObject(XFA_HDOC hDoc, FX_BSTR utf8Name, FXJSE_HVALUE hValue);\r
+       virtual FX_BOOL         GetPDFScriptObject(IXFA_Doc* hDoc, FX_BSTR utf8Name, FXJSE_HVALUE hValue);\r
 \r
-       virtual FX_BOOL         GetGlobalProperty(XFA_HDOC hDoc, FX_BSTR szPropName, FXJSE_HVALUE hValue);\r
-       virtual FX_BOOL         SetGlobalProperty(XFA_HDOC hDoc, FX_BSTR szPropName, FXJSE_HVALUE hValue);\r
-       virtual CPDF_Document*  OpenPDF(XFA_HDOC hDoc, IFX_FileRead* pFile, FX_BOOL bTakeOverFile){return NULL;}\r
+       virtual FX_BOOL         GetGlobalProperty(IXFA_Doc* hDoc, FX_BSTR szPropName, FXJSE_HVALUE hValue);\r
+       virtual FX_BOOL         SetGlobalProperty(IXFA_Doc* hDoc, FX_BSTR szPropName, FXJSE_HVALUE hValue);\r
+       virtual CPDF_Document*  OpenPDF(IXFA_Doc* hDoc, IFX_FileRead* pFile, FX_BOOL bTakeOverFile){return NULL;}\r
 \r
-       virtual IFX_FileRead*   OpenLinkedFile(XFA_HDOC hDoc, const CFX_WideString& wsLink);\r
+       virtual IFX_FileRead*   OpenLinkedFile(IXFA_Doc* hDoc, const CFX_WideString& wsLink);\r
 \r
        FX_BOOL         _GetHValueByName(FX_BSTR utf8Name, FXJSE_HVALUE hValue, IFXJS_Runtime* runTime);\r
        FX_BOOL         _OnBeforeNotifySumbit();\r
        void            _OnAfterNotifySumbit();\r
        FX_BOOL         _NotifySubmit(FX_BOOL bPrevOrPost);\r
-       FX_BOOL         _SubmitData(XFA_HDOC hDoc, CXFA_Submit submit);\r
+       FX_BOOL         _SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit);\r
        FX_BOOL         _MailToInfo(CFX_WideString& csURL, CFX_WideString& csToAddress, CFX_WideString& csCCAddress, CFX_WideString& csBCCAddress, CFX_WideString& csSubject, CFX_WideString& csMsg);\r
        FX_BOOL         _ExportSubmitFile(FPDF_FILEHANDLER* ppFileHandler, int fileType, FPDF_DWORD encodeType, FPDF_DWORD flag = 0x01111111);\r
        void            _ToXFAContentFlags(CFX_WideString csSrcContent, FPDF_DWORD& flag);\r
@@ -138,7 +138,7 @@ private:
                                }\r
 \r
        CPDF_Document* m_pPDFDoc;\r
-       XFA_HDOC  m_pXFADoc;\r
+       IXFA_Doc*  m_pXFADoc;\r
        IXFA_DocView* m_pXFADocView;\r
        CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList;\r
 \r
@@ -154,4 +154,4 @@ private:
        int                     m_iDocType;\r
 };\r
 \r
-#endif \r
+#endif  // FPDFXFA_DOC_H_\r