summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_node.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-07 22:33:43 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-07 22:33:43 +0000
commit93bb725b62f9779534c9444c1e1319fe8c28912e (patch)
treeaf0c758c1129dc076cbf67a89f1c23e4703e02bd /xfa/fxfa/parser/cxfa_node.h
parentce6979f8d064507300fe0b3a856687fb958c9a5c (diff)
downloadpdfium-93bb725b62f9779534c9444c1e1319fe8c28912e.tar.xz
[xfa] Move JS method information to files.chromium/3288
This CL moves the XFA SOM JS Method information out of the c-array and into individual CJX class files. Change-Id: I401046a06aacaf1f04e5a51eb899e479de012e15 Reviewed-on: https://pdfium-review.googlesource.com/20450 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_node.h')
-rw-r--r--xfa/fxfa/parser/cxfa_node.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h
index ab9f5e2806..9508daeec9 100644
--- a/xfa/fxfa/parser/cxfa_node.h
+++ b/xfa/fxfa/parser/cxfa_node.h
@@ -80,6 +80,8 @@ class CXFA_Node : public CXFA_Object {
bool HasPropertyFlags(XFA_Element property, uint8_t flags) const;
uint8_t PropertyOccuranceCount(XFA_Element property) const;
+ void SendAttributeChangeMessage(XFA_Attribute eAttribute, bool bScriptModify);
+
bool HasAttribute(XFA_Attribute attr) const;
XFA_Attribute GetAttribute(size_t i) const;
XFA_AttributeType GetAttributeType(XFA_Attribute type) const;
@@ -114,7 +116,27 @@ class CXFA_Node : public CXFA_Object {
bool IsLayoutGeneratedNode() const {
return HasFlag(XFA_NodeFlag_LayoutGeneratedNode);
}
+
+ void SetBindingNodes(std::vector<UnownedPtr<CXFA_Node>> nodes) {
+ binding_nodes_ = std::move(nodes);
+ }
+ std::vector<UnownedPtr<CXFA_Node>>* GetBindingNodes() {
+ return &binding_nodes_;
+ }
+ void SetBindingNode(CXFA_Node* node) {
+ binding_nodes_.clear();
+ if (node)
+ binding_nodes_.emplace_back(node);
+ }
+ CXFA_Node* GetBindingNode() const {
+ if (binding_nodes_.empty())
+ return nullptr;
+ return binding_nodes_[0].Get();
+ }
+ // TODO(dsinclair): This should not be needed. Nodes should get un-bound when
+ // they're deleted instead of us pointing to bad objects.
void ReleaseBindingNodes();
+
bool BindsFormItems() const { return HasFlag(XFA_NodeFlag_BindFormItems); }
bool HasRemovedChildren() const {
return HasFlag(XFA_NodeFlag_HasRemovedChildren);
@@ -168,7 +190,6 @@ class CXFA_Node : public CXFA_Object {
CXFA_Node* GetNextSameClassSibling(XFA_Element eType) const;
int32_t GetNodeSameNameIndex() const;
int32_t GetNodeSameClassIndex() const;
- void GetSOMExpression(WideString& wsSOMExpression);
CXFA_Node* GetInstanceMgrOfSubform();
CXFA_Node* GetOccurNode();
@@ -188,6 +209,15 @@ class CXFA_Node : public CXFA_Object {
XFA_Element eType,
const PropertyData* properties,
const AttributeData* attributes,
+ const WideStringView& elementName,
+ std::unique_ptr<CJX_Object> js_node);
+ CXFA_Node(CXFA_Document* pDoc,
+ XFA_PacketType ePacket,
+ uint32_t validPackets,
+ XFA_ObjectType oType,
+ XFA_Element eType,
+ const PropertyData* properties,
+ const AttributeData* attributes,
const WideStringView& elementName);
private:
@@ -212,6 +242,7 @@ class CXFA_Node : public CXFA_Object {
uint16_t m_uNodeFlags;
uint32_t m_dwNameHash;
CXFA_Node* m_pAuxNode;
+ std::vector<UnownedPtr<CXFA_Node>> binding_nodes_;
};
#endif // XFA_FXFA_PARSER_CXFA_NODE_H_