blob: c32c7da5f9efc4f1f7969816fb2618d101da0b19 [file] [log] [blame]
K. Moon832a6942022-10-31 20:11:31 +00001// Copyright 2016 The PDFium Authors
dsinclaircac704d2016-07-28 12:59:09 -07002// 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
dsinclair1727aee2016-09-29 13:12:56 -07007#ifndef CORE_FPDFDOC_CPDF_DEST_H_
8#define CORE_FPDFDOC_CPDF_DEST_H_
dsinclaircac704d2016-07-28 12:59:09 -07009
Tom Sepez14b3b8c2022-10-07 23:41:41 +000010#include <vector>
11
Tom Sepez2785e022022-09-24 02:09:08 +000012#include "core/fpdfapi/parser/cpdf_array.h"
Tom Sepez9d033682019-07-17 21:16:36 +000013#include "core/fxcrt/retain_ptr.h"
dsinclaircac704d2016-07-28 12:59:09 -070014
Lei Zhang40e5b9e2020-04-02 22:56:05 +000015class CPDF_Document;
16class CPDF_Object;
dsinclaircac704d2016-07-28 12:59:09 -070017
18class CPDF_Dest {
19 public:
Tom Sepez2785e022022-09-24 02:09:08 +000020 explicit CPDF_Dest(RetainPtr<const CPDF_Array> pArray);
Tom Sepez655c7832017-05-23 17:10:46 -070021 CPDF_Dest(const CPDF_Dest& that);
Tom Sepez655c7832017-05-23 17:10:46 -070022 ~CPDF_Dest();
dsinclaircac704d2016-07-28 12:59:09 -070023
Lei Zhang40e5b9e2020-04-02 22:56:05 +000024 // Use when |pDest| is an object of an unknown type. Can pass in nullptr.
Tom Sepeze0dcb6b2022-09-08 00:29:53 +000025 static CPDF_Dest Create(CPDF_Document* pDoc,
26 RetainPtr<const CPDF_Object> pDest);
Lei Zhang40e5b9e2020-04-02 22:56:05 +000027
Lei Zhang76525c42018-08-27 18:57:36 +000028 const CPDF_Array* GetArray() const { return m_pArray.Get(); }
Tom Sepez14b3b8c2022-10-07 23:41:41 +000029
Henrique Nakashima71a7d372018-02-01 17:07:13 +000030 int GetDestPageIndex(CPDF_Document* pDoc) const;
Tom Sepez14b3b8c2022-10-07 23:41:41 +000031 std::vector<float> GetScrollPositionArray() const;
Henrique Nakashimade3f3fc2018-01-04 11:54:18 -050032
33 // Returns the zoom mode, as one of the PDFDEST_VIEW_* values in fpdf_doc.h.
Lei Zhang326c38c2018-01-10 20:10:05 +000034 int GetZoomMode() const;
Henrique Nakashimade3f3fc2018-01-04 11:54:18 -050035
Tom Sepez707cb372022-01-19 00:04:15 +000036 size_t GetNumParams() const;
37 float GetParam(size_t index) const;
dsinclairc59fa882016-11-08 06:55:40 -080038 bool GetXYZ(bool* pHasX,
39 bool* pHasY,
40 bool* pHasZoom,
41 float* pX,
42 float* pY,
43 float* pZoom) const;
44
dsinclaircac704d2016-07-28 12:59:09 -070045 private:
Tom Sepez92f98b82019-07-26 20:32:35 +000046 RetainPtr<const CPDF_Array> const m_pArray;
dsinclaircac704d2016-07-28 12:59:09 -070047};
48
dsinclair1727aee2016-09-29 13:12:56 -070049#endif // CORE_FPDFDOC_CPDF_DEST_H_