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
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
<
array
>
10
#
include
<
iterator
>
11
#
include
<
utility
>
12
13
#
include
"core/fpdfapi/parser/cpdf_dictionary.h"
14
15
namespace
{
16
17
// |kAATypes| should have one less element than enum AActionType due to
18
// |kDocumentOpen|, which is an artificial type.
19
constexpr
const
std
::array<
const
char
*,
CPDF_AAction
::
kNumberOfActions
- 1>
20
kAATypes = {{
21
"E"
,
// kCursorEnter
22
"X"
,
// kCursorExit
23
"D"
,
// kButtonDown
24
"U"
,
// kButtonUp
25
"Fo"
,
// kGetFocus
26
"Bl"
,
// kLoseFocus
27
"PO"
,
// kPageOpen
28
"PC"
,
// kPageClose
29
"PV"
,
// kPageVisible
30
"PI"
,
// kPageInvisible
31
"O"
,
// kOpenPage
32
"C"
,
// kClosePage
33
"K"
,
// kKeyStroke
34
"F"
,
// kFormat
35
"V"
,
// kValidate
36
"C"
,
// kCalculate
37
"WC"
,
// kCloseDocument
38
"WS"
,
// kSaveDocument
39
"DS"
,
// kDocumentSaved
40
"WP"
,
// kPrintDocument
41
"DP"
,
// kDocumentPrinted
42
}};
43
44
}
// namespace
45
46
CPDF_AAction
::
CPDF_AAction
(
RetainPtr
<
const
CPDF_Dictionary
> pDict)
47
:
m_pDict
(
std
::
move
(
pDict
)) {}
48
49
CPDF_AAction
::
CPDF_AAction
(
const
CPDF_AAction
& that) =
default
;
50
51
CPDF_AAction
::~
CPDF_AAction
() =
default
;
52
53
bool
CPDF_AAction
::
ActionExist
(
AActionType
eType)
const
{
54
return
m_pDict && m_pDict->KeyExist(kAATypes[eType]);
55
}
56
57
CPDF_Action
CPDF_AAction
::
GetAction
(
AActionType
eType)
const
{
58
return
CPDF_Action(m_pDict ? m_pDict->GetDictFor(kAATypes[eType]) :
nullptr
);
59
}
60
61
// static
62
bool
CPDF_AAction
::
IsUserInput
(
AActionType
type) {
63
switch
(type) {
64
case
kButtonUp
:
65
case
kButtonDown
:
66
case
kKeyStroke
:
67
return
true
;
68
default
:
69
return
false
;
70
}
71
}
CPDF_AAction
Definition
cpdf_aaction.h:14
CPDF_AAction::ActionExist
bool ActionExist(AActionType eType) const
Definition
cpdf_aaction.cpp:53
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:46
CPDF_AAction::GetAction
CPDF_Action GetAction(AActionType eType) const
Definition
cpdf_aaction.cpp:57
CPDF_AAction::~CPDF_AAction
~CPDF_AAction()
CPDF_AAction::IsUserInput
static bool IsUserInput(AActionType type)
Definition
cpdf_aaction.cpp:62
CPDF_Action
Definition
cpdf_action.h:21
CPDF_Dictionary::DictMap
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
Definition
cpdf_dictionary.h:31
fxcrt::RetainPtr
Definition
retain_ptr.h:28
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fpdfdoc
cpdf_aaction.cpp
Generated on
for Qt by
1.18.0