blob: 8ac6df100c2616afc8eac25e9d913c65dfaed20c [file] [log] [blame]
jaepark27362762016-08-11 13:10:39 -07001// 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
dsinclair114e46a2016-09-29 17:18:21 -07007#include "fpdfsdk/cpdfsdk_annot.h"
jaepark27362762016-08-11 13:10:39 -07008
dsinclair114e46a2016-09-29 17:18:21 -07009#include "fpdfsdk/cpdfsdk_pageview.h"
Tom Sepez9c78c0d2021-01-27 20:13:14 +000010#include "third_party/base/check.h"
jaepark27362762016-08-11 13:10:39 -070011
jaepark27362762016-08-11 13:10:39 -070012CPDFSDK_Annot::CPDFSDK_Annot(CPDFSDK_PageView* pPageView)
Lei Zhangc2ad6282020-02-13 20:50:57 +000013 : m_pPageView(pPageView) {
Tom Sepez9c78c0d2021-01-27 20:13:14 +000014 DCHECK(m_pPageView);
Lei Zhangc2ad6282020-02-13 20:50:57 +000015}
jaepark27362762016-08-11 13:10:39 -070016
Lei Zhangc2ad6282020-02-13 20:50:57 +000017CPDFSDK_Annot::~CPDFSDK_Annot() = default;
jaepark27362762016-08-11 13:10:39 -070018
Tom Sepez522d77d2018-07-28 00:00:25 +000019CPDFSDK_BAAnnot* CPDFSDK_Annot::AsBAAnnot() {
20 return nullptr;
21}
22
Tom Sepez451ed2d2019-08-19 22:55:31 +000023CPDFXFA_Widget* CPDFSDK_Annot::AsXFAWidget() {
jaepark27362762016-08-11 13:10:39 -070024 return nullptr;
25}
jaepark27362762016-08-11 13:10:39 -070026
Tom Sepez9bf01812019-08-19 18:59:27 +000027IPDF_Page* CPDFSDK_Annot::GetXFAPage() {
28#ifdef PDF_ENABLE_XFA
Lei Zhangc2ad6282020-02-13 20:50:57 +000029 return m_pPageView->GetXFAPage();
30#else
Tom Sepez9bf01812019-08-19 18:59:27 +000031 return nullptr;
Lei Zhangc2ad6282020-02-13 20:50:57 +000032#endif
Tom Sepez9bf01812019-08-19 18:59:27 +000033}
34
jaepark27362762016-08-11 13:10:39 -070035int CPDFSDK_Annot::GetLayoutOrder() const {
36 return 5;
37}
38
39CPDF_Annot* CPDFSDK_Annot::GetPDFAnnot() const {
40 return nullptr;
41}
42
jaepark956553e2016-08-31 06:49:27 -070043CPDF_Annot::Subtype CPDFSDK_Annot::GetAnnotSubtype() const {
44 return CPDF_Annot::Subtype::UNKNOWN;
jaepark27362762016-08-11 13:10:39 -070045}
46
jaepark9ed91372016-08-26 16:16:10 -070047bool CPDFSDK_Annot::IsSignatureWidget() const {
48 return false;
jaepark27362762016-08-11 13:10:39 -070049}
50
51void CPDFSDK_Annot::SetRect(const CFX_FloatRect& rect) {}
52
53CFX_FloatRect CPDFSDK_Annot::GetRect() const {
54 return CFX_FloatRect();
55}
56
Tom Sepez101535f2018-06-12 13:36:05 +000057IPDF_Page* CPDFSDK_Annot::GetPage() {
jaepark27362762016-08-11 13:10:39 -070058#ifdef PDF_ENABLE_XFA
Tom Sepez9bf01812019-08-19 18:59:27 +000059 IPDF_Page* pXFAPage = GetXFAPage();
Tom Sepez8e631772018-06-13 21:26:56 +000060 if (pXFAPage)
61 return pXFAPage;
jaepark27362762016-08-11 13:10:39 -070062#endif // PDF_ENABLE_XFA
Tom Sepez8e631772018-06-13 21:26:56 +000063 return GetPDFPage();
jaepark27362762016-08-11 13:10:39 -070064}
65
66CPDF_Page* CPDFSDK_Annot::GetPDFPage() {
Lei Zhangc2ad6282020-02-13 20:50:57 +000067 return m_pPageView->GetPDFPage();
jaepark27362762016-08-11 13:10:39 -070068}