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_object.cpp
Go to the documentation of this file.
1// Copyright 2016 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#include "xfa/fxfa/parser/cxfa_object.h"
8
9#include "core/fxcrt/fx_extension.h"
10#include "fxjs/xfa/cfxjse_engine.h"
11#include "fxjs/xfa/cfxjse_value.h"
12#include "fxjs/xfa/cjx_object.h"
13#include "xfa/fxfa/cxfa_ffnotify.h"
14#include "xfa/fxfa/parser/cxfa_document.h"
15#include "xfa/fxfa/parser/cxfa_node.h"
16#include "xfa/fxfa/parser/cxfa_thisproxy.h"
17#include "xfa/fxfa/parser/cxfa_treelist.h"
18#include "xfa/fxfa/parser/xfa_basic_data.h"
19
20CXFA_Object::CXFA_Object(CXFA_Document* pDocument,
21 XFA_ObjectType objectType,
22 XFA_Element elementType,
23 CJX_Object* jsObject)
24 : m_objectType(objectType),
25 m_elementType(elementType),
30
31CXFA_Object::~CXFA_Object() = default;
32
33void CXFA_Object::Trace(cppgc::Visitor* visitor) const {
34 visitor->Trace(m_pDocument);
35 visitor->Trace(m_pJSObject);
36}
37
39 CXFA_Node* pNode = AsNode();
40 return pNode ? pNode->GetNameExpression() : WideString();
41}
42
44 return IsList() ? static_cast<CXFA_List*>(this) : nullptr;
45}
46
48 return IsNode() ? static_cast<CXFA_Node*>(this) : nullptr;
49}
50
52 return IsTreeList() ? static_cast<CXFA_TreeList*>(this) : nullptr;
53}
54
55CXFA_ThisProxy* CXFA_Object::AsThisProxy() {
56 return IsThisProxy() ? static_cast<CXFA_ThisProxy*>(this) : nullptr;
57}
58
60 return pObj ? pObj->AsList() : nullptr;
61}
62
64 return pObj ? pObj->AsNode() : nullptr;
65}
66
68 return pObj ? pObj->AsTreeList() : nullptr;
69}
70
71CXFA_ThisProxy* ToThisProxy(CXFA_Object* pObj) {
72 return pObj ? pObj->AsThisProxy() : nullptr;
73}
WideString GetNameExpression()
WideString GetSOMExpression()
bool IsThisProxy() const
Definition cxfa_object.h:74
CXFA_Node * AsNode()
virtual ~CXFA_Object()
bool IsTreeList() const
Definition cxfa_object.h:65
const XFA_Element m_elementType
const XFA_ObjectType m_objectType
CXFA_TreeList * AsTreeList()
virtual void Trace(cppgc::Visitor *visitor) const
bool IsNode() const
Definition cxfa_object.h:55
CXFA_List * AsList()
CXFA_Object(CXFA_Document *pDocument, XFA_ObjectType objectType, XFA_Element eType, CJX_Object *jsObject)
CXFA_ThisProxy * AsThisProxy()
bool IsList() const
Definition cxfa_object.h:51
CXFA_ThisProxy * ToThisProxy(CXFA_Object *pObj)
CXFA_TreeList * ToTreeList(CXFA_Object *pObj)
XFA_ObjectType
Definition cxfa_object.h:21
CXFA_Node * ToNode(CXFA_Object *pObj)
CXFA_List * ToList(CXFA_Object *pObj)
XFA_Element
Definition fxfa_basic.h:75
Definition heap.h:12