blob: d6712d09bde3a4af10fca42d1816f9bbd82456d7 [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
9#include <algorithm>
10
dsinclair114e46a2016-09-29 17:18:21 -070011#include "fpdfsdk/cpdfsdk_pageview.h"
jaepark27362762016-08-11 13:10:39 -070012
jaepark27362762016-08-11 13:10:39 -070013CPDFSDK_Annot::CPDFSDK_Annot(CPDFSDK_PageView* pPageView)
Lei Zhang3db87592017-06-02 12:48:22 -070014 : m_pPageView(pPageView) {}
jaepark27362762016-08-11 13:10:39 -070015
tsepez7b68f612016-09-07 14:11:27 -070016CPDFSDK_Annot::~CPDFSDK_Annot() {}
jaepark27362762016-08-11 13:10:39 -070017
Tom Sepez522d77d2018-07-28 00:00:25 +000018CPDFSDK_BAAnnot* CPDFSDK_Annot::AsBAAnnot() {
19 return nullptr;
20}
21
Tom Sepez451ed2d2019-08-19 22:55:31 +000022CPDFXFA_Widget* CPDFSDK_Annot::AsXFAWidget() {
jaepark27362762016-08-11 13:10:39 -070023 return nullptr;
24}
jaepark27362762016-08-11 13:10:39 -070025
Tom Sepez9bf01812019-08-19 18:59:27 +000026IPDF_Page* CPDFSDK_Annot::GetXFAPage() {
27#ifdef PDF_ENABLE_XFA
28 if (m_pPageView)
29 return m_pPageView->GetXFAPage();
30#endif
31 return nullptr;
32}
33
jaepark27362762016-08-11 13:10:39 -070034int CPDFSDK_Annot::GetLayoutOrder() const {
35 return 5;
36}
37
38CPDF_Annot* CPDFSDK_Annot::GetPDFAnnot() const {
39 return nullptr;
40}
41
jaepark956553e2016-08-31 06:49:27 -070042CPDF_Annot::Subtype CPDFSDK_Annot::GetAnnotSubtype() const {
43 return CPDF_Annot::Subtype::UNKNOWN;
jaepark27362762016-08-11 13:10:39 -070044}
45
jaepark9ed91372016-08-26 16:16:10 -070046bool CPDFSDK_Annot::IsSignatureWidget() const {
47 return false;
jaepark27362762016-08-11 13:10:39 -070048}
49
50void CPDFSDK_Annot::SetRect(const CFX_FloatRect& rect) {}
51
52CFX_FloatRect CPDFSDK_Annot::GetRect() const {
53 return CFX_FloatRect();
54}
55
Tom Sepez101535f2018-06-12 13:36:05 +000056IPDF_Page* CPDFSDK_Annot::GetPage() {
jaepark27362762016-08-11 13:10:39 -070057#ifdef PDF_ENABLE_XFA
Tom Sepez9bf01812019-08-19 18:59:27 +000058 IPDF_Page* pXFAPage = GetXFAPage();
Tom Sepez8e631772018-06-13 21:26:56 +000059 if (pXFAPage)
60 return pXFAPage;
jaepark27362762016-08-11 13:10:39 -070061#endif // PDF_ENABLE_XFA
Tom Sepez8e631772018-06-13 21:26:56 +000062 return GetPDFPage();
jaepark27362762016-08-11 13:10:39 -070063}
64
65CPDF_Page* CPDFSDK_Annot::GetPDFPage() {
66 return m_pPageView ? m_pPageView->GetPDFPage() : nullptr;
67}