OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_FXFA_PARSER_XFA_OBJECT_H_ | 7 #ifndef XFA_FXFA_PARSER_XFA_OBJECT_H_ |
8 #define XFA_FXFA_PARSER_XFA_OBJECT_H_ | 8 #define XFA_FXFA_PARSER_XFA_OBJECT_H_ |
9 | 9 |
10 #include <unordered_set> | 10 #include <unordered_set> |
(...skipping 30 matching lines...) Expand all Loading... |
41 XFA_NodeFlag_SkipDataBinding = 1 << 5, | 41 XFA_NodeFlag_SkipDataBinding = 1 << 5, |
42 XFA_NodeFlag_OwnXMLNode = 1 << 6, | 42 XFA_NodeFlag_OwnXMLNode = 1 << 6, |
43 XFA_NodeFlag_UnusedNode = 1 << 7, | 43 XFA_NodeFlag_UnusedNode = 1 << 7, |
44 XFA_NodeFlag_LayoutGeneratedNode = 1 << 8 | 44 XFA_NodeFlag_LayoutGeneratedNode = 1 << 8 |
45 }; | 45 }; |
46 | 46 |
47 class CXFA_Object : public CFXJSE_HostObject { | 47 class CXFA_Object : public CFXJSE_HostObject { |
48 public: | 48 public: |
49 CXFA_Object(CXFA_Document* pDocument, | 49 CXFA_Object(CXFA_Document* pDocument, |
50 XFA_ObjectType objectType, | 50 XFA_ObjectType objectType, |
51 XFA_Element eType); | 51 XFA_Element eType, |
| 52 const CFX_WideStringC& elementName); |
52 ~CXFA_Object() override; | 53 ~CXFA_Object() override; |
53 | 54 |
54 CXFA_Document* GetDocument() const { return m_pDocument; } | 55 CXFA_Document* GetDocument() const { return m_pDocument; } |
55 XFA_ObjectType GetObjectType() const { return m_objectType; } | 56 XFA_ObjectType GetObjectType() const { return m_objectType; } |
56 | 57 |
57 bool IsNode() const { | 58 bool IsNode() const { |
58 return m_objectType == XFA_ObjectType::Node || | 59 return m_objectType == XFA_ObjectType::Node || |
59 m_objectType == XFA_ObjectType::NodeC || | 60 m_objectType == XFA_ObjectType::NodeC || |
60 m_objectType == XFA_ObjectType::NodeV || | 61 m_objectType == XFA_ObjectType::NodeV || |
61 m_objectType == XFA_ObjectType::ModelNode || | 62 m_objectType == XFA_ObjectType::ModelNode || |
(...skipping 26 matching lines...) Expand all Loading... |
88 uint32_t GetClassHashCode() const; | 89 uint32_t GetClassHashCode() const; |
89 void Script_ObjectClass_ClassName(CFXJSE_Value* pValue, | 90 void Script_ObjectClass_ClassName(CFXJSE_Value* pValue, |
90 FX_BOOL bSetting, | 91 FX_BOOL bSetting, |
91 XFA_ATTRIBUTE eAttribute); | 92 XFA_ATTRIBUTE eAttribute); |
92 void ThrowException(int32_t iStringID, ...); | 93 void ThrowException(int32_t iStringID, ...); |
93 | 94 |
94 protected: | 95 protected: |
95 CXFA_Document* const m_pDocument; | 96 CXFA_Document* const m_pDocument; |
96 const XFA_ObjectType m_objectType; | 97 const XFA_ObjectType m_objectType; |
97 const XFA_Element m_elementType; | 98 const XFA_Element m_elementType; |
| 99 |
| 100 const uint32_t m_elementNameHash; |
| 101 const CFX_WideStringC m_elementName; |
98 }; | 102 }; |
99 using CXFA_ObjArray = CFX_ArrayTemplate<CXFA_Object*>; | 103 using CXFA_ObjArray = CFX_ArrayTemplate<CXFA_Object*>; |
100 | 104 |
101 #define XFA_NODEFILTER_Children 0x01 | 105 #define XFA_NODEFILTER_Children 0x01 |
102 #define XFA_NODEFILTER_Properties 0x02 | 106 #define XFA_NODEFILTER_Properties 0x02 |
103 #define XFA_NODEFILTER_OneOfProperty 0x04 | 107 #define XFA_NODEFILTER_OneOfProperty 0x04 |
104 #define XFA_CLONEFLAG_Content 0x01 | 108 #define XFA_CLONEFLAG_Content 0x01 |
105 enum XFA_NODEITEM { | 109 enum XFA_NODEITEM { |
106 XFA_NODEITEM_Parent, | 110 XFA_NODEITEM_Parent, |
107 XFA_NODEITEM_FirstChild, | 111 XFA_NODEITEM_FirstChild, |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 void Script_Script_Stateless(CFXJSE_Value* pValue, | 616 void Script_Script_Stateless(CFXJSE_Value* pValue, |
613 FX_BOOL bSetting, | 617 FX_BOOL bSetting, |
614 XFA_ATTRIBUTE eAttribute); | 618 XFA_ATTRIBUTE eAttribute); |
615 | 619 |
616 protected: | 620 protected: |
617 friend class CXFA_Document; | 621 friend class CXFA_Document; |
618 | 622 |
619 CXFA_Node(CXFA_Document* pDoc, | 623 CXFA_Node(CXFA_Document* pDoc, |
620 uint16_t ePacket, | 624 uint16_t ePacket, |
621 XFA_ObjectType oType, | 625 XFA_ObjectType oType, |
622 XFA_Element eType); | 626 XFA_Element eType, |
| 627 const CFX_WideStringC& elementName); |
623 ~CXFA_Node() override; | 628 ~CXFA_Node() override; |
624 | 629 |
625 bool HasFlag(XFA_NodeFlag dwFlag) const; | 630 bool HasFlag(XFA_NodeFlag dwFlag) const; |
626 CXFA_Node* Deprecated_GetPrevSibling(); | 631 CXFA_Node* Deprecated_GetPrevSibling(); |
627 FX_BOOL SetValue(XFA_ATTRIBUTE eAttr, | 632 FX_BOOL SetValue(XFA_ATTRIBUTE eAttr, |
628 XFA_ATTRIBUTETYPE eType, | 633 XFA_ATTRIBUTETYPE eType, |
629 void* pValue, | 634 void* pValue, |
630 bool bNotify); | 635 bool bNotify); |
631 FX_BOOL GetValue(XFA_ATTRIBUTE eAttr, | 636 FX_BOOL GetValue(XFA_ATTRIBUTE eAttr, |
632 XFA_ATTRIBUTETYPE eType, | 637 XFA_ATTRIBUTETYPE eType, |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 | 806 |
802 inline CXFA_Node* ToNode(CXFA_Object* pObj) { | 807 inline CXFA_Node* ToNode(CXFA_Object* pObj) { |
803 return pObj ? pObj->AsNode() : nullptr; | 808 return pObj ? pObj->AsNode() : nullptr; |
804 } | 809 } |
805 | 810 |
806 inline const CXFA_Node* ToNode(const CXFA_Object* pObj) { | 811 inline const CXFA_Node* ToNode(const CXFA_Object* pObj) { |
807 return pObj ? pObj->AsNode() : nullptr; | 812 return pObj ? pObj->AsNode() : nullptr; |
808 } | 813 } |
809 | 814 |
810 #endif // XFA_FXFA_PARSER_XFA_OBJECT_H_ | 815 #endif // XFA_FXFA_PARSER_XFA_OBJECT_H_ |
OLD | NEW |