Chromium Code Reviews| 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 uint32_t elementNameHash, | |
| 53 const CFX_WideStringC& elementName); | |
| 52 ~CXFA_Object() override; | 54 ~CXFA_Object() override; |
| 53 | 55 |
| 54 CXFA_Document* GetDocument() const { return m_pDocument; } | 56 CXFA_Document* GetDocument() const { return m_pDocument; } |
| 55 XFA_ObjectType GetObjectType() const { return m_objectType; } | 57 XFA_ObjectType GetObjectType() const { return m_objectType; } |
| 56 | 58 |
| 57 bool IsNode() const { | 59 bool IsNode() const { |
| 58 return m_objectType == XFA_ObjectType::Node || | 60 return m_objectType == XFA_ObjectType::Node || |
| 59 m_objectType == XFA_ObjectType::NodeC || | 61 m_objectType == XFA_ObjectType::NodeC || |
| 60 m_objectType == XFA_ObjectType::NodeV || | 62 m_objectType == XFA_ObjectType::NodeV || |
| 61 m_objectType == XFA_ObjectType::ModelNode || | 63 m_objectType == XFA_ObjectType::ModelNode || |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 77 return m_objectType == XFA_ObjectType::VariablesThis; | 79 return m_objectType == XFA_ObjectType::VariablesThis; |
| 78 } | 80 } |
| 79 | 81 |
| 80 CXFA_Node* AsNode(); | 82 CXFA_Node* AsNode(); |
| 81 CXFA_NodeList* AsNodeList(); | 83 CXFA_NodeList* AsNodeList(); |
| 82 | 84 |
| 83 const CXFA_Node* AsNode() const; | 85 const CXFA_Node* AsNode() const; |
| 84 const CXFA_NodeList* AsNodeList() const; | 86 const CXFA_NodeList* AsNodeList() const; |
| 85 | 87 |
| 86 XFA_Element GetElementType() const; | 88 XFA_Element GetElementType() const; |
| 87 CFX_WideStringC GetClassName() const; | 89 const CFX_WideStringC GetClassName() const; |
|
Lei Zhang
2016/06/28 15:12:03
Is the const useful?
dsinclair
2016/06/28 15:42:09
Probably not, removed.
| |
| 88 uint32_t GetClassHashCode() const; | 90 uint32_t GetClassHashCode() const; |
| 89 void Script_ObjectClass_ClassName(CFXJSE_Value* pValue, | 91 void Script_ObjectClass_ClassName(CFXJSE_Value* pValue, |
| 90 FX_BOOL bSetting, | 92 FX_BOOL bSetting, |
| 91 XFA_ATTRIBUTE eAttribute); | 93 XFA_ATTRIBUTE eAttribute); |
| 92 void ThrowException(int32_t iStringID, ...); | 94 void ThrowException(int32_t iStringID, ...); |
| 93 | 95 |
| 94 protected: | 96 protected: |
| 95 CXFA_Document* const m_pDocument; | 97 CXFA_Document* const m_pDocument; |
| 96 const XFA_ObjectType m_objectType; | 98 const XFA_ObjectType m_objectType; |
| 97 const XFA_Element m_elementType; | 99 const XFA_Element m_elementType; |
| 100 | |
| 101 const uint32_t m_elementNameHash; | |
| 102 const CFX_WideStringC m_elementName; | |
| 98 }; | 103 }; |
| 99 using CXFA_ObjArray = CFX_ArrayTemplate<CXFA_Object*>; | 104 using CXFA_ObjArray = CFX_ArrayTemplate<CXFA_Object*>; |
| 100 | 105 |
| 101 #define XFA_NODEFILTER_Children 0x01 | 106 #define XFA_NODEFILTER_Children 0x01 |
| 102 #define XFA_NODEFILTER_Properties 0x02 | 107 #define XFA_NODEFILTER_Properties 0x02 |
| 103 #define XFA_NODEFILTER_OneOfProperty 0x04 | 108 #define XFA_NODEFILTER_OneOfProperty 0x04 |
| 104 #define XFA_CLONEFLAG_Content 0x01 | 109 #define XFA_CLONEFLAG_Content 0x01 |
| 105 enum XFA_NODEITEM { | 110 enum XFA_NODEITEM { |
| 106 XFA_NODEITEM_Parent, | 111 XFA_NODEITEM_Parent, |
| 107 XFA_NODEITEM_FirstChild, | 112 XFA_NODEITEM_FirstChild, |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 612 void Script_Script_Stateless(CFXJSE_Value* pValue, | 617 void Script_Script_Stateless(CFXJSE_Value* pValue, |
| 613 FX_BOOL bSetting, | 618 FX_BOOL bSetting, |
| 614 XFA_ATTRIBUTE eAttribute); | 619 XFA_ATTRIBUTE eAttribute); |
| 615 | 620 |
| 616 protected: | 621 protected: |
| 617 friend class CXFA_Document; | 622 friend class CXFA_Document; |
| 618 | 623 |
| 619 CXFA_Node(CXFA_Document* pDoc, | 624 CXFA_Node(CXFA_Document* pDoc, |
| 620 uint16_t ePacket, | 625 uint16_t ePacket, |
| 621 XFA_ObjectType oType, | 626 XFA_ObjectType oType, |
| 622 XFA_Element eType); | 627 XFA_Element eType, |
| 628 uint32_t elementNameHash, | |
| 629 const CFX_WideStringC& elementName); | |
| 623 ~CXFA_Node() override; | 630 ~CXFA_Node() override; |
| 624 | 631 |
| 625 bool HasFlag(XFA_NodeFlag dwFlag) const; | 632 bool HasFlag(XFA_NodeFlag dwFlag) const; |
| 626 CXFA_Node* Deprecated_GetPrevSibling(); | 633 CXFA_Node* Deprecated_GetPrevSibling(); |
| 627 FX_BOOL SetValue(XFA_ATTRIBUTE eAttr, | 634 FX_BOOL SetValue(XFA_ATTRIBUTE eAttr, |
| 628 XFA_ATTRIBUTETYPE eType, | 635 XFA_ATTRIBUTETYPE eType, |
| 629 void* pValue, | 636 void* pValue, |
| 630 bool bNotify); | 637 bool bNotify); |
| 631 FX_BOOL GetValue(XFA_ATTRIBUTE eAttr, | 638 FX_BOOL GetValue(XFA_ATTRIBUTE eAttr, |
| 632 XFA_ATTRIBUTETYPE eType, | 639 XFA_ATTRIBUTETYPE eType, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 801 | 808 |
| 802 inline CXFA_Node* ToNode(CXFA_Object* pObj) { | 809 inline CXFA_Node* ToNode(CXFA_Object* pObj) { |
| 803 return pObj ? pObj->AsNode() : nullptr; | 810 return pObj ? pObj->AsNode() : nullptr; |
| 804 } | 811 } |
| 805 | 812 |
| 806 inline const CXFA_Node* ToNode(const CXFA_Object* pObj) { | 813 inline const CXFA_Node* ToNode(const CXFA_Object* pObj) { |
| 807 return pObj ? pObj->AsNode() : nullptr; | 814 return pObj ? pObj->AsNode() : nullptr; |
| 808 } | 815 } |
| 809 | 816 |
| 810 #endif // XFA_FXFA_PARSER_XFA_OBJECT_H_ | 817 #endif // XFA_FXFA_PARSER_XFA_OBJECT_H_ |
| OLD | NEW |