K. Moon | 832a694 | 2022-10-31 20:11:31 +0000 | [diff] [blame] | 1 | // Copyright 2016 The PDFium Authors |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 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 | |
dsinclair | 1727aee | 2016-09-29 13:12:56 -0700 | [diff] [blame] | 7 | #ifndef CORE_FPDFDOC_CPDF_DEST_H_ |
| 8 | #define CORE_FPDFDOC_CPDF_DEST_H_ |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 9 | |
Tom Sepez | 14b3b8c | 2022-10-07 23:41:41 +0000 | [diff] [blame] | 10 | #include <vector> |
| 11 | |
Tom Sepez | 2785e02 | 2022-09-24 02:09:08 +0000 | [diff] [blame] | 12 | #include "core/fpdfapi/parser/cpdf_array.h" |
Tom Sepez | 9d03368 | 2019-07-17 21:16:36 +0000 | [diff] [blame] | 13 | #include "core/fxcrt/retain_ptr.h" |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 14 | |
Lei Zhang | 40e5b9e | 2020-04-02 22:56:05 +0000 | [diff] [blame] | 15 | class CPDF_Document; |
| 16 | class CPDF_Object; |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 17 | |
| 18 | class CPDF_Dest { |
| 19 | public: |
Tom Sepez | 2785e02 | 2022-09-24 02:09:08 +0000 | [diff] [blame] | 20 | explicit CPDF_Dest(RetainPtr<const CPDF_Array> pArray); |
Tom Sepez | 655c783 | 2017-05-23 17:10:46 -0700 | [diff] [blame] | 21 | CPDF_Dest(const CPDF_Dest& that); |
Tom Sepez | 655c783 | 2017-05-23 17:10:46 -0700 | [diff] [blame] | 22 | ~CPDF_Dest(); |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 23 | |
Lei Zhang | 40e5b9e | 2020-04-02 22:56:05 +0000 | [diff] [blame] | 24 | // Use when |pDest| is an object of an unknown type. Can pass in nullptr. |
Tom Sepez | e0dcb6b | 2022-09-08 00:29:53 +0000 | [diff] [blame] | 25 | static CPDF_Dest Create(CPDF_Document* pDoc, |
| 26 | RetainPtr<const CPDF_Object> pDest); |
Lei Zhang | 40e5b9e | 2020-04-02 22:56:05 +0000 | [diff] [blame] | 27 | |
Lei Zhang | 76525c4 | 2018-08-27 18:57:36 +0000 | [diff] [blame] | 28 | const CPDF_Array* GetArray() const { return m_pArray.Get(); } |
Tom Sepez | 14b3b8c | 2022-10-07 23:41:41 +0000 | [diff] [blame] | 29 | |
Henrique Nakashima | 71a7d37 | 2018-02-01 17:07:13 +0000 | [diff] [blame] | 30 | int GetDestPageIndex(CPDF_Document* pDoc) const; |
Tom Sepez | 14b3b8c | 2022-10-07 23:41:41 +0000 | [diff] [blame] | 31 | std::vector<float> GetScrollPositionArray() const; |
Henrique Nakashima | de3f3fc | 2018-01-04 11:54:18 -0500 | [diff] [blame] | 32 | |
| 33 | // Returns the zoom mode, as one of the PDFDEST_VIEW_* values in fpdf_doc.h. |
Lei Zhang | 326c38c | 2018-01-10 20:10:05 +0000 | [diff] [blame] | 34 | int GetZoomMode() const; |
Henrique Nakashima | de3f3fc | 2018-01-04 11:54:18 -0500 | [diff] [blame] | 35 | |
Tom Sepez | 707cb37 | 2022-01-19 00:04:15 +0000 | [diff] [blame] | 36 | size_t GetNumParams() const; |
| 37 | float GetParam(size_t index) const; |
dsinclair | c59fa88 | 2016-11-08 06:55:40 -0800 | [diff] [blame] | 38 | bool GetXYZ(bool* pHasX, |
| 39 | bool* pHasY, |
| 40 | bool* pHasZoom, |
| 41 | float* pX, |
| 42 | float* pY, |
| 43 | float* pZoom) const; |
| 44 | |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 45 | private: |
Tom Sepez | 92f98b8 | 2019-07-26 20:32:35 +0000 | [diff] [blame] | 46 | RetainPtr<const CPDF_Array> const m_pArray; |
dsinclair | cac704d | 2016-07-28 12:59:09 -0700 | [diff] [blame] | 47 | }; |
| 48 | |
dsinclair | 1727aee | 2016-09-29 13:12:56 -0700 | [diff] [blame] | 49 | #endif // CORE_FPDFDOC_CPDF_DEST_H_ |