Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdf_aaction.cpp
Go to the documentation of this file.
1
// Copyright 2016 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
"core/fpdfdoc/cpdf_aaction.h"
8
9
#
include
<
iterator
>
10
#
include
<
utility
>
11
12
#
include
"core/fpdfapi/parser/cpdf_dictionary.h"
13
14
namespace
{
15
16
constexpr
const
char
* kAATypes[] = {
17
"E"
,
// kCursorEnter
18
"X"
,
// kCursorExit
19
"D"
,
// kButtonDown
20
"U"
,
// kButtonUp
21
"Fo"
,
// kGetFocus
22
"Bl"
,
// kLoseFocus
23
"PO"
,
// kPageOpen
24
"PC"
,
// kPageClose
25
"PV"
,
// kPageVisible
26
"PI"
,
// kPageInvisible
27
"O"
,
// kOpenPage
28
"C"
,
// kClosePage
29
"K"
,
// kKeyStroke
30
"F"
,
// kFormat
31
"V"
,
// kValidate
32
"C"
,
// kCalculate
33
"WC"
,
// kCloseDocument
34
"WS"
,
// kSaveDocument
35
"DS"
,
// kDocumentSaved
36
"WP"
,
// kPrintDocument
37
"DP"
,
// kDocumentPrinted
38
};
39
40
// |kAATypes| should have one less element than enum AActionType due to
41
// |kDocumentOpen|, which is an artificial type.
42
static_assert
(
std
::size(kAATypes) ==
CPDF_AAction
::
kNumberOfActions
- 1,
43
"kAATypes count mismatch"
);
44
45
}
// namespace
46
47
CPDF_AAction
::
CPDF_AAction
(
RetainPtr
<
const
CPDF_Dictionary> pDict)
48
:
m_pDict
(
std
::
move
(
pDict
)) {}
49
50
CPDF_AAction
::
CPDF_AAction
(
const
CPDF_AAction
& that) =
default
;
51
52
CPDF_AAction
::~
CPDF_AAction
() =
default
;
53
54
bool
CPDF_AAction
::
ActionExist
(
AActionType
eType)
const
{
55
return
m_pDict && m_pDict->KeyExist(kAATypes[eType]);
56
}
57
58
CPDF_Action
CPDF_AAction
::
GetAction
(
AActionType
eType)
const
{
59
return
CPDF_Action(m_pDict ? m_pDict->GetDictFor(kAATypes[eType]) :
nullptr
);
60
}
61
62
// static
63
bool
CPDF_AAction
::
IsUserInput
(
AActionType
type) {
64
switch
(type) {
65
case
kButtonUp
:
66
case
kButtonDown
:
67
case
kKeyStroke
:
68
return
true
;
69
default
:
70
return
false
;
71
}
72
}
CPDF_AAction
Definition
cpdf_aaction.h:14
CPDF_AAction::ActionExist
bool ActionExist(AActionType eType) const
Definition
cpdf_aaction.cpp:54
CPDF_AAction::AActionType
AActionType
Definition
cpdf_aaction.h:16
CPDF_AAction::kButtonDown
@ kButtonDown
Definition
cpdf_aaction.h:19
CPDF_AAction::kKeyStroke
@ kKeyStroke
Definition
cpdf_aaction.h:29
CPDF_AAction::kNumberOfActions
@ kNumberOfActions
Definition
cpdf_aaction.h:39
CPDF_AAction::kButtonUp
@ kButtonUp
Definition
cpdf_aaction.h:20
CPDF_AAction::CPDF_AAction
CPDF_AAction(const CPDF_AAction &that)
CPDF_AAction::CPDF_AAction
CPDF_AAction(RetainPtr< const CPDF_Dictionary > pDict)
Definition
cpdf_aaction.cpp:47
CPDF_AAction::GetAction
CPDF_Action GetAction(AActionType eType) const
Definition
cpdf_aaction.cpp:58
CPDF_AAction::~CPDF_AAction
~CPDF_AAction()
CPDF_AAction::IsUserInput
static bool IsUserInput(AActionType type)
Definition
cpdf_aaction.cpp:63
CPDF_Action
Definition
cpdf_action.h:21
fxcrt::RetainPtr
Definition
retain_ptr.h:29
std
Definition
qfloat16.h:493
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fpdfdoc
cpdf_aaction.cpp
Generated on Wed Nov 13 2024 00:57:05 for Qt by
1.12.0