1 // Copyright 2016 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_FXFA_PARSER_CXFA_DOCUMENT_PARSER_H_ 8 #define XFA_FXFA_PARSER_CXFA_DOCUMENT_PARSER_H_ 9 10 #include <memory> 11 12 #include "xfa/fxfa/parser/cxfa_simple_parser.h" 13 14 class CFX_XMLDoc; 15 class CXFA_Document; 16 class CXFA_FFNotify; 17 class CXFA_Notify; 18 class IFX_SeekableStream; 19 20 class CXFA_DocumentParser { 21 public: 22 explicit CXFA_DocumentParser(CXFA_FFNotify* pNotify); 23 ~CXFA_DocumentParser(); 24 25 int32_t StartParse(const RetainPtr<IFX_SeekableStream>& pStream, 26 XFA_PacketType ePacketID); 27 int32_t DoParse(); 28 29 CFX_XMLDoc* GetXMLDoc() const; 30 CXFA_FFNotify* GetNotify() const; 31 CXFA_Document* GetDocument() const; 32 33 private: 34 UnownedPtr<CXFA_FFNotify> const m_pNotify; 35 std::unique_ptr<CXFA_Document> m_pDocument; 36 CXFA_SimpleParser m_nodeParser; 37 }; 38 39 #endif // XFA_FXFA_PARSER_CXFA_DOCUMENT_PARSER_H_ 40