• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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)13 CPDFSDK_Annot::CPDFSDK_Annot(CPDFSDK_PageView* pPageView)
14     : m_pPageView(pPageView) {}
15 
~CPDFSDK_Annot()16 CPDFSDK_Annot::~CPDFSDK_Annot() {}
17 
AsBAAnnot()18 CPDFSDK_BAAnnot* CPDFSDK_Annot::AsBAAnnot() {
19   return nullptr;
20 }
21 
AsXFAWidget()22 CPDFXFA_Widget* CPDFSDK_Annot::AsXFAWidget() {
23   return nullptr;
24 }
25 
GetXFAPage()26 IPDF_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() const34 int CPDFSDK_Annot::GetLayoutOrder() const {
35   return 5;
36 }
37 
GetPDFAnnot() const38 CPDF_Annot* CPDFSDK_Annot::GetPDFAnnot() const {
39   return nullptr;
40 }
41 
GetAnnotSubtype() const42 CPDF_Annot::Subtype CPDFSDK_Annot::GetAnnotSubtype() const {
43   return CPDF_Annot::Subtype::UNKNOWN;
44 }
45 
IsSignatureWidget() const46 bool CPDFSDK_Annot::IsSignatureWidget() const {
47   return false;
48 }
49 
SetRect(const CFX_FloatRect & rect)50 void CPDFSDK_Annot::SetRect(const CFX_FloatRect& rect) {}
51 
GetRect() const52 CFX_FloatRect CPDFSDK_Annot::GetRect() const {
53   return CFX_FloatRect();
54 }
55 
GetPage()56 IPDF_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()65 CPDF_Page* CPDFSDK_Annot::GetPDFPage() {
66   return m_pPageView ? m_pPageView->GetPDFPage() : nullptr;
67 }
68