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_bookmarktree.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_bookmarktree.h"
8
9
#
include
<
utility
>
10
11
#
include
"core/fpdfapi/parser/cpdf_dictionary.h"
12
#
include
"core/fpdfapi/parser/cpdf_document.h"
13
14
CPDF_BookmarkTree
::
CPDF_BookmarkTree
(
const
CPDF_Document
* doc)
15
:
document_
(
doc
) {}
16
17
CPDF_BookmarkTree
::~
CPDF_BookmarkTree
() =
default
;
18
19
CPDF_Bookmark
CPDF_BookmarkTree
::
GetFirstChild
(
20
const
CPDF_Bookmark
& parent)
const
{
21
const
CPDF_Dictionary* parent_dict = parent
.
GetDict
(
)
;
22
if
(parent_dict)
23
return
CPDF_Bookmark
(parent_dict
->
GetDictFor
(
"First"
));
24
25
const
CPDF_Dictionary* root = document_->GetRoot();
26
if
(!root)
27
return
CPDF_Bookmark
(
)
;
28
29
RetainPtr
<
const
CPDF_Dictionary> outlines = root->GetDictFor(
"Outlines"
);
30
return
outlines ?
CPDF_Bookmark
(outlines->GetDictFor(
"First"
))
31
:
CPDF_Bookmark
(
)
;
32
}
33
34
CPDF_Bookmark
CPDF_BookmarkTree
::
GetNextSibling
(
35
const
CPDF_Bookmark
& bookmark)
const
{
36
const
CPDF_Dictionary* dict = bookmark
.
GetDict
(
)
;
37
if
(!dict)
38
return
CPDF_Bookmark
(
)
;
39
40
RetainPtr
<
const
CPDF_Dictionary> next = dict->GetDictFor(
"Next"
);
41
return
next != dict ?
CPDF_Bookmark
(
std
::move(next)) :
CPDF_Bookmark
(
)
;
42
}
CPDF_BookmarkTree
Definition
cpdf_bookmarktree.h:15
CPDF_BookmarkTree::GetFirstChild
CPDF_Bookmark GetFirstChild(const CPDF_Bookmark &parent) const
Definition
cpdf_bookmarktree.cpp:19
CPDF_BookmarkTree::CPDF_BookmarkTree
CPDF_BookmarkTree(const CPDF_Document *doc)
Definition
cpdf_bookmarktree.cpp:14
CPDF_BookmarkTree::~CPDF_BookmarkTree
~CPDF_BookmarkTree()
CPDF_BookmarkTree::GetNextSibling
CPDF_Bookmark GetNextSibling(const CPDF_Bookmark &bookmark) const
Definition
cpdf_bookmarktree.cpp:34
CPDF_Bookmark
Definition
cpdf_bookmark.h:18
CPDF_Bookmark::CPDF_Bookmark
CPDF_Bookmark()
CPDF_Bookmark::GetDict
const CPDF_Dictionary * GetDict() const
Definition
cpdf_bookmark.h:25
CPDF_Dictionary::GetDictFor
RetainPtr< const CPDF_Dictionary > GetDictFor(const ByteString &key) const
Definition
cpdf_dictionary.cpp:163
CPDF_Document
Definition
cpdf_document.h:29
fxcrt::RetainPtr
Definition
retain_ptr.h:29
std
Definition
qfloat16.h:493
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fpdfdoc
cpdf_bookmarktree.cpp
Generated on Thu Nov 14 2024 00:57:12 for Qt by
1.12.0