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
cxfa_checkbutton.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
"xfa/fxfa/parser/cxfa_checkbutton.h"
8
9
#
include
"fxjs/xfa/cjx_node.h"
10
#
include
"xfa/fxfa/parser/cxfa_document.h"
11
12
namespace
{
13
14
const
CXFA_Node
::
PropertyData
kCheckButtonPropertyData[] = {
15
{
XFA_Element
::Margin, 1, {}},
16
{
XFA_Element
::Border, 1, {}},
17
{
XFA_Element
::Extras, 1, {}},
18
};
19
20
const
CXFA_Node
::
AttributeData
kCheckButtonAttributeData[] = {
21
{
XFA_Attribute
::Id,
XFA_AttributeType
::
CData
,
nullptr
},
22
{
XFA_Attribute
::Use,
XFA_AttributeType
::
CData
,
nullptr
},
23
{
XFA_Attribute
::AllowNeutral,
XFA_AttributeType
::
Boolean
, (
void
*)0},
24
{
XFA_Attribute
::Mark,
XFA_AttributeType
::
Enum
,
25
(
void
*)
XFA_AttributeValue
::Default},
26
{
XFA_Attribute
::Shape,
XFA_AttributeType
::
Enum
,
27
(
void
*)
XFA_AttributeValue
::Square},
28
{
XFA_Attribute
::Size,
XFA_AttributeType
::
Measure
, (
void
*)L"10pt"},
29
{
XFA_Attribute
::Usehref,
XFA_AttributeType
::
CData
,
nullptr
},
30
};
31
32
}
// namespace
33
34
// static
35
CXFA_CheckButton* CXFA_CheckButton::
FromNode
(
CXFA_Node
* pNode) {
36
return
pNode && pNode->GetElementType() == XFA_Element::CheckButton
37
?
static_cast
<CXFA_CheckButton*>(pNode)
38
:
nullptr
;
39
}
40
41
CXFA_CheckButton::CXFA_CheckButton(CXFA_Document* doc,
XFA_PacketType
packet)
42
: CXFA_Node(doc,
43
packet,
44
{XFA_XDPPACKET::kTemplate, XFA_XDPPACKET::kForm},
45
XFA_ObjectType::Node,
46
XFA_Element::CheckButton,
47
kCheckButtonPropertyData,
48
kCheckButtonAttributeData,
49
cppgc::MakeGarbageCollected<CJX_Node>(
50
doc->GetHeap()->GetAllocationHandle(),
51
this
)) {}
52
53
CXFA_CheckButton::~
CXFA_CheckButton
() =
default
;
54
55
XFA_FFWidgetType
CXFA_CheckButton::
GetDefaultFFWidgetType
()
const
{
56
return
XFA_FFWidgetType
::
kCheckButton
;
57
}
58
59
bool
CXFA_CheckButton::
IsRound
() {
60
return
JSObject()->GetEnum(
XFA_Attribute
::Shape) ==
XFA_AttributeValue
::Round;
61
}
62
63
XFA_AttributeValue
CXFA_CheckButton::
GetMark
() {
64
return
JSObject()->GetEnum(
XFA_Attribute
::Mark);
65
}
66
67
bool
CXFA_CheckButton::
IsAllowNeutral
() {
68
return
JSObject()->GetBoolean(
XFA_Attribute
::AllowNeutral);
69
}
CXFA_CheckButton::GetDefaultFFWidgetType
XFA_FFWidgetType GetDefaultFFWidgetType() const override
Definition
cxfa_checkbutton.cpp:55
CXFA_CheckButton::IsAllowNeutral
bool IsAllowNeutral()
Definition
cxfa_checkbutton.cpp:67
CXFA_CheckButton::FromNode
static CXFA_CheckButton * FromNode(CXFA_Node *pNode)
Definition
cxfa_checkbutton.cpp:35
CXFA_CheckButton::GetMark
XFA_AttributeValue GetMark()
Definition
cxfa_checkbutton.cpp:63
CXFA_CheckButton::IsRound
bool IsRound()
Definition
cxfa_checkbutton.cpp:59
CXFA_CheckButton::~CXFA_CheckButton
~CXFA_CheckButton() override
CXFA_Node
Definition
cxfa_node.h:94
XFA_FFWidgetType
XFA_FFWidgetType
Definition
cxfa_ffwidget_type.h:10
XFA_FFWidgetType::kCheckButton
@ kCheckButton
Definition
cxfa_ffwidget_type.h:14
XFA_AttributeType
XFA_AttributeType
Definition
fxfa_basic.h:83
XFA_AttributeType::Measure
@ Measure
Definition
fxfa_basic.h:88
XFA_AttributeType::Boolean
@ Boolean
Definition
fxfa_basic.h:86
XFA_AttributeType::Enum
@ Enum
Definition
fxfa_basic.h:84
XFA_AttributeType::CData
@ CData
Definition
fxfa_basic.h:85
XFA_Attribute
XFA_Attribute
Definition
fxfa_basic.h:67
XFA_Element
XFA_Element
Definition
fxfa_basic.h:75
XFA_AttributeValue
XFA_AttributeValue
Definition
fxfa_basic.h:60
XFA_PacketType
XFA_PacketType
Definition
fxfa_basic.h:44
CXFA_Node::AttributeData
Definition
cxfa_node.h:110
CXFA_Node::PropertyData
Definition
cxfa_node.h:96
qtwebengine
src
3rdparty
chromium
third_party
pdfium
xfa
fxfa
parser
cxfa_checkbutton.cpp
Generated on
for Qt by
1.18.0