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_bookmark.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_bookmark.h"
8
9
#
include
<
algorithm
>
10
#
include
<
utility
>
11
12
#
include
"core/fpdfapi/parser/cpdf_array.h"
13
#
include
"core/fpdfapi/parser/cpdf_dictionary.h"
14
#
include
"core/fpdfapi/parser/cpdf_string.h"
15
#
include
"core/fxge/dib/fx_dib.h"
16
17
CPDF_Bookmark
::
CPDF_Bookmark
() =
default
;
18
19
CPDF_Bookmark
::
CPDF_Bookmark
(
const
CPDF_Bookmark
& that) =
default
;
20
21
CPDF_Bookmark
::
CPDF_Bookmark
(
RetainPtr
<
const
CPDF_Dictionary
> pDict)
22
:
m_pDict
(
std
::
move
(
pDict
)) {}
23
24
CPDF_Bookmark
::~
CPDF_Bookmark
() =
default
;
25
26
WideString
CPDF_Bookmark
::
GetTitle
()
const
{
27
if
(!m_pDict) {
28
return
WideString
(
)
;
29
}
30
RetainPtr
<
const
CPDF_String> pString =
31
ToString(m_pDict->GetDirectObjectFor(
"Title"
));
32
if
(!pString) {
33
return
WideString
(
)
;
34
}
35
WideString
title = pString->GetUnicodeText();
36
WideString
result;
37
result.Reserve(title.GetLength());
38
for
(
const
wchar_t
wc : title) {
39
result += std::max(wc,
static_cast
<
wchar_t
>(0x20));
40
}
41
return
result;
42
}
43
44
CPDF_Dest
CPDF_Bookmark
::
GetDest
(
CPDF_Document
* pDocument)
const
{
45
if
(!m_pDict)
46
return
CPDF_Dest(
nullptr
);
47
return
CPDF_Dest
::
Create
(pDocument, m_pDict->GetDirectObjectFor(
"Dest"
));
48
}
49
50
CPDF_Action
CPDF_Bookmark
::
GetAction
()
const
{
51
return
CPDF_Action(m_pDict ? m_pDict->GetDictFor(
"A"
) :
nullptr
);
52
}
53
54
int
CPDF_Bookmark
::
GetCount
()
const
{
55
return
m_pDict->GetIntegerFor(
"Count"
);
56
}
CPDF_Action
Definition
cpdf_action.h:21
CPDF_Bookmark
Definition
cpdf_bookmark.h:18
CPDF_Bookmark::GetCount
int GetCount() const
Definition
cpdf_bookmark.cpp:54
CPDF_Bookmark::~CPDF_Bookmark
~CPDF_Bookmark()
CPDF_Bookmark::GetTitle
WideString GetTitle() const
Definition
cpdf_bookmark.cpp:26
CPDF_Bookmark::CPDF_Bookmark
CPDF_Bookmark(RetainPtr< const CPDF_Dictionary > pDict)
Definition
cpdf_bookmark.cpp:21
CPDF_Bookmark::GetAction
CPDF_Action GetAction() const
Definition
cpdf_bookmark.cpp:50
CPDF_Bookmark::CPDF_Bookmark
CPDF_Bookmark(const CPDF_Bookmark &that)
CPDF_Bookmark::CPDF_Bookmark
CPDF_Bookmark()
CPDF_Bookmark::GetDest
CPDF_Dest GetDest(CPDF_Document *pDocument) const
Definition
cpdf_bookmark.cpp:44
CPDF_Dest
Definition
cpdf_dest.h:18
CPDF_Dest::Create
static CPDF_Dest Create(CPDF_Document *pDoc, RetainPtr< const CPDF_Object > pDest)
Definition
cpdf_dest.cpp:41
CPDF_Dictionary::DictMap
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
Definition
cpdf_dictionary.h:31
CPDF_Document
Definition
cpdf_document.h:29
fxcrt::RetainPtr
Definition
retain_ptr.h:28
fxcrt::WideString::WideString
WideString()=default
WideString
fxcrt::WideString WideString
Definition
widestring.h:207
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fpdfdoc
cpdf_bookmark.cpp
Generated on
for Qt by
1.18.0