xref: /aosp_15_r20/external/pdfium/core/fpdfdoc/cpdf_dest.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
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_DEST_H_
8 #define CORE_FPDFDOC_CPDF_DEST_H_
9 
10 #include <vector>
11 
12 #include "core/fpdfapi/parser/cpdf_array.h"
13 #include "core/fxcrt/retain_ptr.h"
14 
15 class CPDF_Document;
16 class CPDF_Object;
17 
18 class CPDF_Dest {
19  public:
20   explicit CPDF_Dest(RetainPtr<const CPDF_Array> pArray);
21   CPDF_Dest(const CPDF_Dest& that);
22   ~CPDF_Dest();
23 
24   // Use when |pDest| is an object of an unknown type. Can pass in nullptr.
25   static CPDF_Dest Create(CPDF_Document* pDoc,
26                           RetainPtr<const CPDF_Object> pDest);
27 
GetArray()28   const CPDF_Array* GetArray() const { return m_pArray.Get(); }
29 
30   int GetDestPageIndex(CPDF_Document* pDoc) const;
31   std::vector<float> GetScrollPositionArray() const;
32 
33   // Returns the zoom mode, as one of the PDFDEST_VIEW_* values in fpdf_doc.h.
34   int GetZoomMode() const;
35 
36   size_t GetNumParams() const;
37   float GetParam(size_t index) const;
38   bool GetXYZ(bool* pHasX,
39               bool* pHasY,
40               bool* pHasZoom,
41               float* pX,
42               float* pY,
43               float* pZoom) const;
44 
45  private:
46   RetainPtr<const CPDF_Array> const m_pArray;
47 };
48 
49 #endif  // CORE_FPDFDOC_CPDF_DEST_H_
50