jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 1 | // Copyright 2016 PDFium Authors. All rights reserved. |
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 | 114e46a | 2016-09-29 17:18:21 -0700 | [diff] [blame] | 7 | #include "fpdfsdk/cpdfsdk_annot.h" |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 8 | |
dsinclair | 114e46a | 2016-09-29 17:18:21 -0700 | [diff] [blame] | 9 | #include "fpdfsdk/cpdfsdk_pageview.h" |
Tom Sepez | 9c78c0d | 2021-01-27 20:13:14 +0000 | [diff] [blame^] | 10 | #include "third_party/base/check.h" |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 11 | |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 12 | CPDFSDK_Annot::CPDFSDK_Annot(CPDFSDK_PageView* pPageView) |
Lei Zhang | c2ad628 | 2020-02-13 20:50:57 +0000 | [diff] [blame] | 13 | : m_pPageView(pPageView) { |
Tom Sepez | 9c78c0d | 2021-01-27 20:13:14 +0000 | [diff] [blame^] | 14 | DCHECK(m_pPageView); |
Lei Zhang | c2ad628 | 2020-02-13 20:50:57 +0000 | [diff] [blame] | 15 | } |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 16 | |
Lei Zhang | c2ad628 | 2020-02-13 20:50:57 +0000 | [diff] [blame] | 17 | CPDFSDK_Annot::~CPDFSDK_Annot() = default; |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 18 | |
Tom Sepez | 522d77d | 2018-07-28 00:00:25 +0000 | [diff] [blame] | 19 | CPDFSDK_BAAnnot* CPDFSDK_Annot::AsBAAnnot() { |
20 | return nullptr; | ||||
21 | } | ||||
22 | |||||
Tom Sepez | 451ed2d | 2019-08-19 22:55:31 +0000 | [diff] [blame] | 23 | CPDFXFA_Widget* CPDFSDK_Annot::AsXFAWidget() { |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 24 | return nullptr; |
25 | } | ||||
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 26 | |
Tom Sepez | 9bf0181 | 2019-08-19 18:59:27 +0000 | [diff] [blame] | 27 | IPDF_Page* CPDFSDK_Annot::GetXFAPage() { |
28 | #ifdef PDF_ENABLE_XFA | ||||
Lei Zhang | c2ad628 | 2020-02-13 20:50:57 +0000 | [diff] [blame] | 29 | return m_pPageView->GetXFAPage(); |
30 | #else | ||||
Tom Sepez | 9bf0181 | 2019-08-19 18:59:27 +0000 | [diff] [blame] | 31 | return nullptr; |
Lei Zhang | c2ad628 | 2020-02-13 20:50:57 +0000 | [diff] [blame] | 32 | #endif |
Tom Sepez | 9bf0181 | 2019-08-19 18:59:27 +0000 | [diff] [blame] | 33 | } |
34 | |||||
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 35 | int CPDFSDK_Annot::GetLayoutOrder() const { |
36 | return 5; | ||||
37 | } | ||||
38 | |||||
39 | CPDF_Annot* CPDFSDK_Annot::GetPDFAnnot() const { | ||||
40 | return nullptr; | ||||
41 | } | ||||
42 | |||||
jaepark | 956553e | 2016-08-31 06:49:27 -0700 | [diff] [blame] | 43 | CPDF_Annot::Subtype CPDFSDK_Annot::GetAnnotSubtype() const { |
44 | return CPDF_Annot::Subtype::UNKNOWN; | ||||
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 45 | } |
46 | |||||
jaepark | 9ed9137 | 2016-08-26 16:16:10 -0700 | [diff] [blame] | 47 | bool CPDFSDK_Annot::IsSignatureWidget() const { |
48 | return false; | ||||
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 49 | } |
50 | |||||
51 | void CPDFSDK_Annot::SetRect(const CFX_FloatRect& rect) {} | ||||
52 | |||||
53 | CFX_FloatRect CPDFSDK_Annot::GetRect() const { | ||||
54 | return CFX_FloatRect(); | ||||
55 | } | ||||
56 | |||||
Tom Sepez | 101535f | 2018-06-12 13:36:05 +0000 | [diff] [blame] | 57 | IPDF_Page* CPDFSDK_Annot::GetPage() { |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 58 | #ifdef PDF_ENABLE_XFA |
Tom Sepez | 9bf0181 | 2019-08-19 18:59:27 +0000 | [diff] [blame] | 59 | IPDF_Page* pXFAPage = GetXFAPage(); |
Tom Sepez | 8e63177 | 2018-06-13 21:26:56 +0000 | [diff] [blame] | 60 | if (pXFAPage) |
61 | return pXFAPage; | ||||
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 62 | #endif // PDF_ENABLE_XFA |
Tom Sepez | 8e63177 | 2018-06-13 21:26:56 +0000 | [diff] [blame] | 63 | return GetPDFPage(); |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 64 | } |
65 | |||||
66 | CPDF_Page* CPDFSDK_Annot::GetPDFPage() { | ||||
Lei Zhang | c2ad628 | 2020-02-13 20:50:57 +0000 | [diff] [blame] | 67 | return m_pPageView->GetPDFPage(); |
jaepark | 2736276 | 2016-08-11 13:10:39 -0700 | [diff] [blame] | 68 | } |