Home | History | Annotate | Download | only in common
      1 // Copyright 2014 PDFium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
      6 
      7 #ifndef _XFA_PARSER_H
      8 #define _XFA_PARSER_H
      9 class IFX_Stream;
     10 class IXFA_Parser {
     11  public:
     12   static IXFA_Parser* Create(IXFA_ObjFactory* pFactory,
     13                              FX_BOOL bDocumentParser = FALSE);
     14   virtual ~IXFA_Parser() {}
     15   virtual void Release() = 0;
     16   virtual int32_t StartParse(IFX_FileRead* pStream,
     17                              XFA_XDPPACKET ePacketID = XFA_XDPPACKET_XDP) = 0;
     18   virtual int32_t DoParse(IFX_Pause* pPause = NULL) = 0;
     19   virtual int32_t ParseXMLData(const CFX_WideString& wsXML,
     20                                IFDE_XMLNode*& pXMLNode,
     21                                IFX_Pause* pPause = NULL) = 0;
     22   virtual void ConstructXFANode(CXFA_Node* pXFANode,
     23                                 IFDE_XMLNode* pXMLNode) = 0;
     24   virtual IXFA_ObjFactory* GetFactory() const = 0;
     25   virtual CXFA_Node* GetRootNode() const = 0;
     26   virtual IFDE_XMLDoc* GetXMLDoc() const = 0;
     27   virtual void CloseParser() = 0;
     28 };
     29 class IXFA_DocParser : public IXFA_Parser {
     30  public:
     31   static IXFA_DocParser* Create(IXFA_Notify* pNotify);
     32   virtual CXFA_Document* GetDocument() const = 0;
     33   virtual IXFA_Notify* GetNotify() const = 0;
     34 };
     35 #endif
     36