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 7 #include "fpdfsdk/cpdfsdk_annot.h" 8 9 #include <algorithm> 10 11 #include "fpdfsdk/cpdfsdk_pageview.h" 12 CPDFSDK_Annot(CPDFSDK_PageView * pPageView)13CPDFSDK_Annot::CPDFSDK_Annot(CPDFSDK_PageView* pPageView) 14 : m_pPageView(pPageView) {} 15 ~CPDFSDK_Annot()16CPDFSDK_Annot::~CPDFSDK_Annot() {} 17 AsBAAnnot()18CPDFSDK_BAAnnot* CPDFSDK_Annot::AsBAAnnot() { 19 return nullptr; 20 } 21 AsXFAWidget()22CPDFXFA_Widget* CPDFSDK_Annot::AsXFAWidget() { 23 return nullptr; 24 } 25 GetXFAPage()26IPDF_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 GetLayoutOrder() const34int CPDFSDK_Annot::GetLayoutOrder() const { 35 return 5; 36 } 37 GetPDFAnnot() const38CPDF_Annot* CPDFSDK_Annot::GetPDFAnnot() const { 39 return nullptr; 40 } 41 GetAnnotSubtype() const42CPDF_Annot::Subtype CPDFSDK_Annot::GetAnnotSubtype() const { 43 return CPDF_Annot::Subtype::UNKNOWN; 44 } 45 IsSignatureWidget() const46bool CPDFSDK_Annot::IsSignatureWidget() const { 47 return false; 48 } 49 SetRect(const CFX_FloatRect & rect)50void CPDFSDK_Annot::SetRect(const CFX_FloatRect& rect) {} 51 GetRect() const52CFX_FloatRect CPDFSDK_Annot::GetRect() const { 53 return CFX_FloatRect(); 54 } 55 GetPage()56IPDF_Page* CPDFSDK_Annot::GetPage() { 57 #ifdef PDF_ENABLE_XFA 58 IPDF_Page* pXFAPage = GetXFAPage(); 59 if (pXFAPage) 60 return pXFAPage; 61 #endif // PDF_ENABLE_XFA 62 return GetPDFPage(); 63 } 64 GetPDFPage()65CPDF_Page* CPDFSDK_Annot::GetPDFPage() { 66 return m_pPageView ? m_pPageView->GetPDFPage() : nullptr; 67 } 68