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_nametree.h
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#ifndef CORE_FPDFDOC_CPDF_NAMETREE_H_
8#define CORE_FPDFDOC_CPDF_NAMETREE_H_
9
10#include <stddef.h>
11
12#include <memory>
13
14#include "core/fxcrt/fx_string.h"
15#include "core/fxcrt/retain_ptr.h"
16
17class CPDF_Array;
18class CPDF_Dictionary;
19class CPDF_Document;
20class CPDF_Object;
21
23 public:
24 CPDF_NameTree(const CPDF_NameTree&) = delete;
27
29 const ByteString& category);
30
31 // If necessary, create missing Names dictionary in |pDoc|, and/or missing
32 // Names array in the dictionary that corresponds to |category|, if necessary.
33 // Returns nullptr on failure.
35 CPDF_Document* pDoc,
36 const ByteString& category);
37
39 CPDF_Dictionary* pRoot);
40
41 static RetainPtr<const CPDF_Array> LookupNamedDest(CPDF_Document* doc,
42 const ByteString& name);
43
44 bool AddValueAndName(RetainPtr<CPDF_Object> pObj, const WideString& name);
45 bool DeleteValueAndName(size_t nIndex);
46
48 WideString* csName) const;
49 RetainPtr<const CPDF_Object> LookupValue(const WideString& csName) const;
50
51 size_t GetCount() const;
52 CPDF_Dictionary* GetRootForTesting() const { return m_pRoot.Get(); }
53
54 private:
55 explicit CPDF_NameTree(RetainPtr<CPDF_Dictionary> pRoot);
56
57 RetainPtr<const CPDF_Array> LookupNewStyleNamedDest(const ByteString& name);
58
59 RetainPtr<CPDF_Dictionary> const m_pRoot;
60};
61
62#endif // CORE_FPDFDOC_CPDF_NAMETREE_H_
bool GetXYZ(bool *pHasX, bool *pHasY, bool *pHasZoom, float *pX, float *pY, float *pZoom) const
Definition cpdf_dest.cpp:98
size_t GetNumParams() const
static CPDF_Dest Create(CPDF_Document *pDoc, RetainPtr< const CPDF_Object > pDest)
Definition cpdf_dest.cpp:42
CPDF_Dest(const CPDF_Dest &that)
int GetDestPageIndex(CPDF_Document *pDoc) const
Definition cpdf_dest.cpp:53
float GetParam(size_t index) const
int GetZoomMode() const
Definition cpdf_dest.cpp:81
std::vector< float > GetScrollPositionArray() const
Definition cpdf_dest.cpp:70
CPDF_Dest(RetainPtr< const CPDF_Array > pArray)
Definition cpdf_dest.cpp:34
int GetPageIndex(uint32_t objnum)
bool AddValueAndName(RetainPtr< CPDF_Object > pObj, const WideString &name)
CPDF_NameTree & operator=(const CPDF_NameTree &)=delete
static RetainPtr< const CPDF_Array > LookupNamedDest(CPDF_Document *doc, const ByteString &name)
CPDF_Dictionary * GetRootForTesting() const
RetainPtr< const CPDF_Object > LookupValue(const WideString &csName) const
static std::unique_ptr< CPDF_NameTree > Create(CPDF_Document *pDoc, const ByteString &category)
CPDF_NameTree(const CPDF_NameTree &)=delete
RetainPtr< CPDF_Object > LookupValueAndName(size_t nIndex, WideString *csName) const
size_t GetCount() const
bool DeleteValueAndName(size_t nIndex)
static std::unique_ptr< CPDF_NameTree > CreateWithRootNameArray(CPDF_Document *pDoc, const ByteString &category)
static std::unique_ptr< CPDF_NameTree > CreateForTesting(CPDF_Dictionary *pRoot)
bool operator==(const char *ptr) const