Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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/include/cpdfsdk_annot.h" | |
| 8 | |
| 9 #include <algorithm> | |
| 10 | |
| 11 #include "fpdfsdk/include/fsdk_mgr.h" | |
| 12 | |
| 13 #ifdef PDF_ENABLE_XFA | |
| 14 #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h" | |
| 15 #endif // PDF_ENABLE_XFA | |
| 16 | |
| 17 namespace { | |
| 18 | |
| 19 const float kMinWidth = 1.0f; | |
| 20 const float kMinHeight = 1.0f; | |
| 21 | |
| 22 } // namespace | |
| 23 | |
| 24 CPDFSDK_Annot::CPDFSDK_Annot(CPDFSDK_PageView* pPageView) | |
| 25 : m_pPageView(pPageView), m_bSelected(FALSE), m_nTabOrder(-1) {} | |
| 26 | |
| 27 CPDFSDK_Annot::~CPDFSDK_Annot() {} | |
| 28 | |
| 29 #ifdef PDF_ENABLE_XFA | |
| 30 | |
| 31 FX_BOOL CPDFSDK_Annot::IsXFAField() { | |
| 32 return FALSE; | |
| 33 } | |
| 34 | |
| 35 CXFA_FFWidget* CPDFSDK_Annot::GetXFAWidget() const { | |
| 36 return nullptr; | |
| 37 } | |
| 38 | |
| 39 #endif // PDF_ENABLE_XFA | |
| 40 | |
| 41 FX_FLOAT CPDFSDK_Annot::GetMinWidth() const { | |
| 42 return kMinWidth; | |
| 43 } | |
| 44 | |
| 45 FX_FLOAT CPDFSDK_Annot::GetMinHeight() const { | |
| 46 return kMinHeight; | |
| 47 } | |
| 48 | |
| 49 int CPDFSDK_Annot::GetLayoutOrder() const { | |
| 50 return 5; | |
| 51 } | |
| 52 | |
| 53 CPDF_Annot* CPDFSDK_Annot::GetPDFAnnot() const { | |
| 54 return nullptr; | |
| 55 } | |
| 56 | |
| 57 CFX_ByteString CPDFSDK_Annot::GetType() const { | |
| 58 return ""; | |
| 59 } | |
| 60 | |
| 61 CFX_ByteString CPDFSDK_Annot::GetSubType() const { | |
| 62 return ""; | |
| 63 } | |
| 64 | |
| 65 void CPDFSDK_Annot::SetRect(const CFX_FloatRect& rect) {} | |
| 66 | |
| 67 CFX_FloatRect CPDFSDK_Annot::GetRect() const { | |
| 68 return CFX_FloatRect(); | |
| 69 } | |
| 70 | |
| 71 void CPDFSDK_Annot::Annot_OnDraw(CFX_RenderDevice* pDevice, | |
| 72 CFX_Matrix* pUser2Device, | |
| 73 CPDF_RenderOptions* pOptions) {} | |
| 74 | |
| 75 FX_BOOL CPDFSDK_Annot::IsSelected() { | |
| 76 return m_bSelected; | |
| 77 } | |
| 78 | |
| 79 void CPDFSDK_Annot::SetSelected(FX_BOOL bSelected) { | |
| 80 m_bSelected = bSelected; | |
| 81 } | |
| 82 | |
| 83 int CPDFSDK_Annot::GetTabOrder() { | |
| 84 return m_nTabOrder; | |
| 85 } | |
| 86 | |
| 87 void CPDFSDK_Annot::SetTabOrder(int iTabOrder) { | |
| 88 m_nTabOrder = iTabOrder; | |
| 89 } | |
| 90 | |
| 91 UnderlyingPageType* CPDFSDK_Annot::GetUnderlyingPage() { | |
| 92 #ifdef PDF_ENABLE_XFA | |
| 93 return GetPDFXFAPage(); | |
| 94 #else // PDF_ENABLE_XFA | |
| 95 return GetPDFPage(); | |
| 96 #endif // PDF_ENABLE_XFA | |
| 97 } | |
| 98 | |
| 99 CPDF_Page* CPDFSDK_Annot::GetPDFPage() { | |
| 100 return m_pPageView ? m_pPageView->GetPDFPage() : nullptr; | |
| 101 } | |
| 102 | |
| 103 #ifdef PDF_ENABLE_XFA | |
|
dsinclair
2016/08/11 14:01:04
Move this up with the ifdef PDF_ENABLE_XFA block a
jaepark
2016/08/11 18:09:50
Done.
| |
| 104 | |
| 105 CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() { | |
| 106 return m_pPageView ? m_pPageView->GetPDFXFAPage() : nullptr; | |
| 107 } | |
| 108 | |
| 109 #endif // PDF_ENABLE_XFA | |
| OLD | NEW |