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_draw.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_draw.h"
8
9
#
include
"core/fxcrt/check.h"
10
#
include
"fxjs/fxv8.h"
11
#
include
"fxjs/xfa/cfxjse_value.h"
12
#
include
"v8/include/v8-primitive.h"
13
#
include
"v8/include/v8-value.h"
14
#
include
"xfa/fxfa/parser/cxfa_draw.h"
15
16
CJX_Draw::CJX_Draw(CXFA_Draw* node) :
CJX_Container
(node) {}
17
18
CJX_Draw::~
CJX_Draw
() =
default
;
19
20
bool
CJX_Draw::
DynamicTypeIs
(
TypeTag
eType)
const
{
21
return
eType == static_type__ || ParentType__
::
DynamicTypeIs
(eType);
22
}
23
24
void
CJX_Draw::rawValue(
v8
::Isolate* pIsolate,
25
v8::Local<v8::Value>* pValue,
26
bool
bSetting,
27
XFA_Attribute
eAttribute) {
28
defaultValue(pIsolate, pValue, bSetting, eAttribute);
29
}
30
31
void
CJX_Draw::defaultValue(
v8
::Isolate* pIsolate,
32
v8::Local<v8::Value>* pValue,
33
bool
bSetting,
34
XFA_Attribute
eAttribute) {
35
if
(!bSetting) {
36
ByteString
content =
GetContent
(
true
).ToUTF8();
37
*pValue = content.IsEmpty()
38
? fxv8::NewNullHelper(pIsolate).As<v8::Value>()
39
: fxv8::NewStringHelper(pIsolate, content.AsStringView())
40
.As<v8::Value>();
41
return
;
42
}
43
44
if
(!pValue || !
fxv8
::
IsString
(
*pValue
)
)
45
return
;
46
47
DCHECK
(GetXFANode()->IsWidgetReady());
48
if
(
GetXFANode
()->GetFFWidgetType() !=
XFA_FFWidgetType
::
kText
)
49
return
;
50
51
WideString
wsNewValue = fxv8::ReentrantToWideStringHelper(pIsolate, *pValue);
52
SetContent
(wsNewValue, wsNewValue,
true
,
true
,
true
);
53
}
ByteString
fxcrt::ByteString ByteString
Definition
bytestring.h:180
DCHECK
#define DCHECK
Definition
check.h:33
CJX_Container
Definition
cjx_container.h:15
CJX_Container::DynamicTypeIs
bool DynamicTypeIs(TypeTag eType) const override
Definition
cjx_container.cpp:29
CJX_Draw::DynamicTypeIs
bool DynamicTypeIs(TypeTag eType) const override
Definition
cjx_draw.cpp:20
CJX_Draw::~CJX_Draw
~CJX_Draw() override
CJX_Object::GetContent
WideString GetContent(bool bScriptModify) const
Definition
cjx_object.cpp:693
CJX_Object::TypeTag
TypeTag
Definition
cjx_object.h:49
CJX_Object::GetXFANode
CXFA_Node * GetXFANode() const
Definition
cjx_object.cpp:136
CJX_Object::SetContent
void SetContent(const WideString &wsContent, const WideString &wsXMLValue, bool bNotify, bool bScriptModify, bool bSyncData)
Definition
cjx_object.cpp:532
XFA_FFWidgetType
XFA_FFWidgetType
Definition
cxfa_ffwidget_type.h:10
XFA_FFWidgetType::kText
@ kText
Definition
cxfa_ffwidget_type.h:25
XFA_Attribute
XFA_Attribute
Definition
fxfa_basic.h:67
fxv8
Definition
fxv8.h:22
fxv8::IsString
bool IsString(v8::Local< v8::Value > value)
Definition
fxv8.cpp:32
v8
Definition
fxv8_unittest.h:15
WideString
fxcrt::WideString WideString
Definition
widestring.h:207
qtwebengine
src
3rdparty
chromium
third_party
pdfium
fxjs
xfa
cjx_draw.cpp
Generated on
for Qt by
1.18.0