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_template.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_template.h"
8
9
#
include
"core/fxcrt/span.h"
10
#
include
"fxjs/cfx_v8.h"
11
#
include
"fxjs/js_resources.h"
12
#
include
"fxjs/xfa/cfxjse_value.h"
13
#
include
"v8/include/v8-primitive.h"
14
#
include
"xfa/fxfa/parser/cxfa_document.h"
15
#
include
"xfa/fxfa/parser/cxfa_template.h"
16
17
const
CJX_MethodSpec
CJX_Template::MethodSpecs[] = {
18
{
"execCalculate"
, execCalculate_static},
19
{
"execInitialize"
, execInitialize_static},
20
{
"execValidate"
, execValidate_static},
21
{
"formNodes"
, formNodes_static},
22
{
"recalculate"
, recalculate_static},
23
{
"remerge"
, remerge_static}};
24
25
CJX_Template::CJX_Template(CXFA_Template* tmpl) :
CJX_Model
(tmpl) {
26
DefineMethods(MethodSpecs);
27
}
28
29
CJX_Template::~
CJX_Template
() =
default
;
30
31
bool
CJX_Template::
DynamicTypeIs
(
TypeTag
eType)
const
{
32
return
eType == static_type__ || ParentType__
::
DynamicTypeIs
(eType);
33
}
34
35
CJS_Result
CJX_Template::formNodes(
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
return
CJS_Result
::
Success
(
runtime->NewBoolean(
true
)
)
;
41
}
42
43
CJS_Result
CJX_Template::remerge(
CFXJSE_Engine
* runtime,
44
pdfium::span<v8::Local<v8::Value>> params) {
45
if
(!params.empty())
46
return
CJS_Result
::
Failure
(
JSMessage
::
kParamError
)
;
47
48
GetDocument
()->DoDataRemerge();
49
return
CJS_Result
::
Success
(
)
;
50
}
51
52
CJS_Result
CJX_Template::execInitialize(
53
CFXJSE_Engine
* runtime,
54
pdfium::span<v8::Local<v8::Value>> params) {
55
if
(!params.empty())
56
return
CJS_Result
::
Failure
(
JSMessage
::
kParamError
)
;
57
58
return
CJS_Result
::
Success
(
59
runtime->NewBoolean(
GetXFANode
()->IsWidgetReady())
)
;
60
}
61
62
CJS_Result
CJX_Template::recalculate(
63
CFXJSE_Engine
* runtime,
64
pdfium::span<v8::Local<v8::Value>> params) {
65
if
(params.size() != 1)
66
return
CJS_Result
::
Failure
(
JSMessage
::
kParamError
)
;
67
68
return
CJS_Result
::
Success
(
runtime->NewBoolean(
true
)
)
;
69
}
70
71
CJS_Result
CJX_Template::execCalculate(
72
CFXJSE_Engine
* runtime,
73
pdfium::span<v8::Local<v8::Value>> params) {
74
if
(!params.empty())
75
return
CJS_Result
::
Failure
(
JSMessage
::
kParamError
)
;
76
77
return
CJS_Result
::
Success
(
78
runtime->NewBoolean(
GetXFANode
()->IsWidgetReady())
)
;
79
}
80
81
CJS_Result
CJX_Template::execValidate(
82
CFXJSE_Engine
* runtime,
83
pdfium::span<v8::Local<v8::Value>> params) {
84
if
(!params.empty())
85
return
CJS_Result
::
Failure
(
JSMessage
::
kParamError
)
;
86
87
return
CJS_Result
::
Success
(
88
runtime->NewBoolean(
GetXFANode
()->IsWidgetReady())
)
;
89
}
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_Model
Definition
cjx_model.h:15
CJX_Model::DynamicTypeIs
bool DynamicTypeIs(TypeTag eType) const override
Definition
cjx_model.cpp:29
CJX_Object::GetDocument
CXFA_Document * GetDocument() const
Definition
cjx_object.cpp:132
CJX_Object::TypeTag
TypeTag
Definition
cjx_object.h:49
CJX_Object::GetXFANode
CXFA_Node * GetXFANode() const
Definition
cjx_object.cpp:136
CJX_Template::DynamicTypeIs
bool DynamicTypeIs(TypeTag eType) const override
Definition
cjx_template.cpp:31
CJX_Template::~CJX_Template
~CJX_Template() override
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_template.cpp
Generated on
for Qt by
1.18.0