Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
cjx_treelist.cpp
Go to the documentation of this file.
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
#
include
"fxjs/xfa/cjx_treelist.h"
8
9
#
include
"core/fxcrt/span.h"
10
#
include
"fxjs/js_resources.h"
11
#
include
"fxjs/xfa/cfxjse_engine.h"
12
#
include
"fxjs/xfa/cfxjse_value.h"
13
#
include
"v8/include/v8-object.h"
14
#
include
"xfa/fxfa/parser/cxfa_document.h"
15
#
include
"xfa/fxfa/parser/cxfa_node.h"
16
#
include
"xfa/fxfa/parser/cxfa_treelist.h"
17
18
const
CJX_MethodSpec
CJX_TreeList::MethodSpecs[] = {
19
{
"namedItem"
, namedItem_static}};
20
21
CJX_TreeList::CJX_TreeList(
CXFA_TreeList
* list) :
CJX_List
(list) {
22
DefineMethods(MethodSpecs);
23
}
24
25
CJX_TreeList::~
CJX_TreeList
() =
default
;
26
27
bool
CJX_TreeList::
DynamicTypeIs
(
TypeTag
eType)
const
{
28
return
eType == static_type__ || ParentType__
::
DynamicTypeIs
(eType);
29
}
30
31
CXFA_TreeList
* CJX_TreeList::GetXFATreeList() {
32
return
ToTreeList(
GetXFAObject
());
33
}
34
35
CJS_Result
CJX_TreeList::namedItem(
CFXJSE_Engine
* runtime,
36
pdfium::span<v8::Local<v8::Value>> params) {
37
if
(params.size() != 1)
38
return
CJS_Result
::
Failure
(
JSMessage
::
kParamError
)
;
39
40
CXFA_Node
* pNode = GetXFATreeList()
->
NamedItem
(
41
runtime->ToWideString(params[0]).AsStringView()
)
;
42
if
(!pNode)
43
return
CJS_Result
::
Success
(
)
;
44
45
return
CJS_Result
::
Success
(
runtime->GetOrCreateJSBindingFromMap(pNode)
)
;
46
}
CFXJSE_Engine::EventParamScope
friend class EventParamScope
Definition
cfxjse_engine.h:127
CJS_Result
Definition
cjs_result.h:15
CJS_Result::Success
static CJS_Result Success()
Definition
cjs_result.h:28
CJS_Result::Failure
static CJS_Result Failure(JSMessage id)
Definition
cjs_result.h:35
CJX_List
Definition
cjx_list.h:15
CJX_List::DynamicTypeIs
bool DynamicTypeIs(TypeTag eType) const override
Definition
cjx_list.cpp:32
CJX_Object::GetXFAObject
CXFA_Object * GetXFAObject() const
Definition
cjx_object.h:113
CJX_Object::TypeTag
TypeTag
Definition
cjx_object.h:49
CJX_TreeList::~CJX_TreeList
~CJX_TreeList() override
CJX_TreeList::DynamicTypeIs
bool DynamicTypeIs(TypeTag eType) const override
Definition
cjx_treelist.cpp:27
CXFA_Node
Definition
cxfa_node.h:94
CXFA_TreeList
Definition
cxfa_treelist.h:15
CXFA_TreeList::NamedItem
CXFA_Node * NamedItem(WideStringView wsName)
Definition
cxfa_treelist.cpp:24
JSMessage
JSMessage
Definition
js_resources.h:12
JSMessage::kParamError
@ kParamError
Definition
js_resources.h:14
CJX_MethodSpec
Definition
cjx_object.h:40
qtwebengine
src
3rdparty
chromium
third_party
pdfium
fxjs
xfa
cjx_treelist.cpp
Generated on
for Qt by
1.18.0