Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cxfa_document_builder.h
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
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_BUILDER_H_
8#define XFA_FXFA_PARSER_CXFA_DOCUMENT_BUILDER_H_
9
10#include "core/fxcrt/unowned_ptr.h"
11#include "v8/include/cppgc/macros.h"
12#include "xfa/fxfa/fxfa_basic.h"
13
14class CFX_XMLDocument;
15class CFX_XMLNode;
16class CXFA_Document;
17class CXFA_Node;
18class CFX_XMLInstruction;
19
21 CPPGC_STACK_ALLOCATED(); // Allow Raw/Unowned pointers.
22
23 public:
24 explicit CXFA_DocumentBuilder(CXFA_Document* pNodeFactory);
26
28 bool BuildDocument(CFX_XMLDocument* pXML, XFA_PacketType ePacketID);
29 void ConstructXFANode(CXFA_Node* pXFANode, CFX_XMLNode* pXMLNode);
30 CXFA_Node* GetRootNode() const;
31
32 private:
33 CXFA_Node* ParseAsXDPPacket(CFX_XMLNode* pXMLDocumentNode,
34 XFA_PacketType ePacketID);
35 CXFA_Node* ParseAsXDPPacket_XDP(CFX_XMLNode* pXMLDocumentNode);
36 CXFA_Node* ParseAsXDPPacket_Config(CFX_XMLNode* pXMLDocumentNode);
37 CXFA_Node* ParseAsXDPPacket_Template(CFX_XMLNode* pXMLDocumentNode);
38 CXFA_Node* ParseAsXDPPacket_Form(CFX_XMLNode* pXMLDocumentNode);
39 CXFA_Node* ParseAsXDPPacket_Data(CFX_XMLNode* pXMLDocumentNode);
40 CXFA_Node* ParseAsXDPPacket_LocaleConnectionSourceSet(
41 CFX_XMLNode* pXMLDocumentNode,
42 XFA_PacketType packet_type,
43 XFA_Element element);
44 CXFA_Node* ParseAsXDPPacket_Xdc(CFX_XMLNode* pXMLDocumentNode);
45 CXFA_Node* ParseAsXDPPacket_User(CFX_XMLNode* pXMLDocumentNode);
46 CXFA_Node* DataLoader(CXFA_Node* pXFANode, CFX_XMLNode* pXMLDoc);
47 CXFA_Node* NormalLoader(CXFA_Node* pXFANode,
48 CFX_XMLNode* pXMLDoc,
49 XFA_PacketType ePacketID,
50 bool bUseAttribute);
51 void ParseContentNode(CXFA_Node* pXFANode,
52 CFX_XMLNode* pXMLNode,
53 XFA_PacketType ePacketID);
54 void ParseDataValue(CXFA_Node* pXFANode,
55 CFX_XMLNode* pXMLNode,
56 XFA_PacketType ePacketID);
57 void ParseDataGroup(CXFA_Node* pXFANode,
58 CFX_XMLNode* pXMLNode,
59 XFA_PacketType ePacketID);
60 void ParseInstruction(CXFA_Node* pXFANode,
61 CFX_XMLInstruction* pXMLInstruction,
62 XFA_PacketType ePacketID);
63
64 UnownedPtr<CXFA_Document> node_factory_; // OK, stack-only.
65 UnownedPtr<CXFA_Node> root_node_; // OK, stack-only.
67 size_t execute_recursion_depth_ = 0;
68};
69
70#endif // XFA_FXFA_PARSER_CXFA_DOCUMENT_BUILDER_H_
#define PARA(a, b, c, d)
Definition cjx_node.cpp:53
friend class EventParamScope
void AppendNodesFrom(CFX_XMLDocument *other)
virtual void Save(const RetainPtr< IFX_RetainableWriteStream > &pXMLStream)=0
virtual CFX_XMLNode * Clone(CFX_XMLDocument *doc)=0
virtual Type GetType() const =0
static CJS_Result Success()
Definition cjs_result.h:27
static CJS_Result Failure(JSMessage id)
Definition cjs_result.h:34
~CJX_Node() override
bool DynamicTypeIs(TypeTag eType) const override
Definition cjx_node.cpp:112
CJX_Node(CXFA_Node *node)
Definition cjx_node.cpp:106
XFA_EventError execSingleEventByName(WideStringView wsEventName, XFA_Element eType)
Definition cjx_node.cpp:468
WideString GetAttributeByString(WideStringView attr) const
void DefineMethods(pdfium::span< const CJX_MethodSpec > methods)
WideString GetContent(bool bScriptModify) const
void ThrowInvalidPropertyException(v8::Isolate *pIsolate) const
CXFA_Document * GetDocument() const
void SetAttributeByString(WideStringView wsAttr, const WideString &wsValue)
WideString GetCData(XFA_Attribute eAttr) const
CXFA_Node * GetXFANode() const
bool DynamicTypeIs(TypeTag eType) const override
Definition cjx_tree.cpp:36
bool BuildDocument(CFX_XMLDocument *pXML, XFA_PacketType ePacketID)
void ConstructXFANode(CXFA_Node *pXFANode, CFX_XMLNode *pXMLNode)
CXFA_DocumentBuilder(CXFA_Document *pNodeFactory)
CFX_XMLNode * Build(CFX_XMLDocument *pXML)
CXFA_Node * GetRootNode() const
XFA_EventError ExecEventByDeepFirst(CXFA_Node *pFormNode, XFA_EVENTTYPE eEventType, bool bIsFormReady, bool bRecursive)
CFX_XMLNode * GetXMLMappingNode() const
Definition cxfa_node.h:184
void RemoveChildAndNotify(CXFA_Node *pNode, bool bNotify)
void InsertChildAndNotify(CXFA_Node *pNode, CXFA_Node *pBeforeNode)
void SetFlag(XFA_NodeFlag dwFlag)
void SetXMLMappingNode(CFX_XMLNode *node)
Definition cxfa_node.h:183
void SetInitializedFlagAndNotify()
XFA_Element GetElementType() const
Definition cxfa_object.h:91
bool IsEmpty() const
Definition bytestring.h:119
bool IsEmpty() const
Definition widestring.h:118
WideString(const WideString &other)
static WideString FromASCII(ByteStringView str)
XFA_EVENTTYPE
@ XFA_EVENT_PostOpen
@ XFA_EVENT_Click
@ XFA_EVENT_MouseDown
@ XFA_EVENT_MouseEnter
@ XFA_EVENT_Initialize
@ XFA_EVENT_PreOpen
@ XFA_EVENT_PreSign
@ XFA_EVENT_Exit
@ XFA_EVENT_Change
@ XFA_EVENT_Calculate
@ XFA_EVENT_PostSign
@ XFA_EVENT_MouseUp
@ XFA_EVENT_Validate
@ XFA_EVENT_IndexChange
@ XFA_EVENT_Full
@ XFA_EVENT_MouseExit
@ XFA_EVENT_Enter
XFA_NodeFlag
Definition cxfa_node.h:77
XFA_EventError
Definition fxfa.h:54
XFA_Attribute
Definition fxfa_basic.h:67
XFA_Element
Definition fxfa_basic.h:75
XFA_PacketType
Definition fxfa_basic.h:44
JSMessage
bool XFA_RecognizeRichText(CFX_XMLElement *pRichTextXMLNode)