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
16
18
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"))
32}
33
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_Bookmark GetFirstChild(const CPDF_Bookmark &parent) const
CPDF_BookmarkTree(const CPDF_Document *doc)
CPDF_Bookmark GetNextSibling(const CPDF_Bookmark &bookmark) const
const CPDF_Dictionary * GetDict() const
RetainPtr< const CPDF_Dictionary > GetDictFor(const ByteString &key) const