xref: /aosp_15_r20/external/pdfium/fxjs/xfa/cjx_tree.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2017 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 FXJS_XFA_CJX_TREE_H_
8 #define FXJS_XFA_CJX_TREE_H_
9 
10 #include "fxjs/xfa/cfxjse_engine.h"
11 #include "fxjs/xfa/cjx_object.h"
12 #include "fxjs/xfa/jse_define.h"
13 
14 class CXFA_Object;
15 class CXFA_Node;
16 
17 class CJX_Tree : public CJX_Object {
18  public:
19   CONSTRUCT_VIA_MAKE_GARBAGE_COLLECTED;
20   ~CJX_Tree() override;
21 
22   // CJX_Object:
23   bool DynamicTypeIs(TypeTag eType) const override;
24 
25   JSE_METHOD(resolveNode);
26   JSE_METHOD(resolveNodes);
27 
28   JSE_PROP(all);
29   JSE_PROP(classAll);
30   JSE_PROP(classIndex);
31   JSE_PROP(index);
32   JSE_PROP(nodes);
33   JSE_PROP(parent);
34   JSE_PROP(somExpression);
35 
36  protected:
37   explicit CJX_Tree(CXFA_Object* obj);
38 
39  private:
40   using Type__ = CJX_Tree;
41   using ParentType__ = CJX_Object;
42 
43   static const TypeTag static_type__ = TypeTag::Tree;
44   static const CJX_MethodSpec MethodSpecs[];
45 
46   v8::Local<v8::Value> ResolveNodeList(v8::Isolate* pIsolate,
47                                        WideString wsExpression,
48                                        Mask<XFA_ResolveFlag> dwFlag,
49                                        CXFA_Node* refNode);
50 };
51 
52 #endif  // FXJS_XFA_CJX_TREE_H_
53