| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "fpdfsdk/include/cpdfsdk_annot.h" | 7 #include "fpdfsdk/include/cpdfsdk_annot.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "fpdfsdk/include/fsdk_mgr.h" | 11 #include "fpdfsdk/include/fsdk_mgr.h" |
| 12 | 12 |
| 13 #ifdef PDF_ENABLE_XFA | 13 #ifdef PDF_ENABLE_XFA |
| 14 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h" | 14 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h" |
| 15 #endif // PDF_ENABLE_XFA | 15 #endif // PDF_ENABLE_XFA |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 const float kMinWidth = 1.0f; | 19 const float kMinWidth = 1.0f; |
| 20 const float kMinHeight = 1.0f; | 20 const float kMinHeight = 1.0f; |
| 21 | 21 |
| 22 } // namespace | 22 } // namespace |
| 23 | 23 |
| 24 CPDFSDK_Annot::CPDFSDK_Annot(CPDFSDK_PageView* pPageView) | 24 CPDFSDK_Annot::CPDFSDK_Annot(CPDFSDK_PageView* pPageView) |
| 25 : m_pPageView(pPageView), m_bSelected(FALSE), m_nTabOrder(-1) {} | 25 : m_pPageView(pPageView), m_bSelected(FALSE) {} |
| 26 | 26 |
| 27 CPDFSDK_Annot::~CPDFSDK_Annot() {} | 27 CPDFSDK_Annot::~CPDFSDK_Annot() {} |
| 28 | 28 |
| 29 #ifdef PDF_ENABLE_XFA | 29 #ifdef PDF_ENABLE_XFA |
| 30 | 30 |
| 31 FX_BOOL CPDFSDK_Annot::IsXFAField() { | 31 FX_BOOL CPDFSDK_Annot::IsXFAField() { |
| 32 return FALSE; | 32 return FALSE; |
| 33 } | 33 } |
| 34 | 34 |
| 35 CXFA_FFWidget* CPDFSDK_Annot::GetXFAWidget() const { | 35 CXFA_FFWidget* CPDFSDK_Annot::GetXFAWidget() const { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 CPDF_RenderOptions* pOptions) {} | 77 CPDF_RenderOptions* pOptions) {} |
| 78 | 78 |
| 79 FX_BOOL CPDFSDK_Annot::IsSelected() { | 79 FX_BOOL CPDFSDK_Annot::IsSelected() { |
| 80 return m_bSelected; | 80 return m_bSelected; |
| 81 } | 81 } |
| 82 | 82 |
| 83 void CPDFSDK_Annot::SetSelected(FX_BOOL bSelected) { | 83 void CPDFSDK_Annot::SetSelected(FX_BOOL bSelected) { |
| 84 m_bSelected = bSelected; | 84 m_bSelected = bSelected; |
| 85 } | 85 } |
| 86 | 86 |
| 87 int CPDFSDK_Annot::GetTabOrder() { | |
| 88 return m_nTabOrder; | |
| 89 } | |
| 90 | |
| 91 void CPDFSDK_Annot::SetTabOrder(int iTabOrder) { | |
| 92 m_nTabOrder = iTabOrder; | |
| 93 } | |
| 94 | |
| 95 UnderlyingPageType* CPDFSDK_Annot::GetUnderlyingPage() { | 87 UnderlyingPageType* CPDFSDK_Annot::GetUnderlyingPage() { |
| 96 #ifdef PDF_ENABLE_XFA | 88 #ifdef PDF_ENABLE_XFA |
| 97 return GetPDFXFAPage(); | 89 return GetPDFXFAPage(); |
| 98 #else // PDF_ENABLE_XFA | 90 #else // PDF_ENABLE_XFA |
| 99 return GetPDFPage(); | 91 return GetPDFPage(); |
| 100 #endif // PDF_ENABLE_XFA | 92 #endif // PDF_ENABLE_XFA |
| 101 } | 93 } |
| 102 | 94 |
| 103 CPDF_Page* CPDFSDK_Annot::GetPDFPage() { | 95 CPDF_Page* CPDFSDK_Annot::GetPDFPage() { |
| 104 return m_pPageView ? m_pPageView->GetPDFPage() : nullptr; | 96 return m_pPageView ? m_pPageView->GetPDFPage() : nullptr; |
| 105 } | 97 } |
| OLD | NEW |