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_bfannothandler.h" | 7 #include "fpdfsdk/include/cpdfsdk_bfannothandler.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 CPDFSDK_BFAnnotHandler::CPDFSDK_BFAnnotHandler(CPDFDoc_Environment* pApp) | 25 CPDFSDK_BFAnnotHandler::CPDFSDK_BFAnnotHandler(CPDFDoc_Environment* pApp) |
26 : m_pApp(pApp), m_pFormFiller(nullptr) {} | 26 : m_pApp(pApp), m_pFormFiller(nullptr) {} |
27 | 27 |
28 CPDFSDK_BFAnnotHandler::~CPDFSDK_BFAnnotHandler() {} | 28 CPDFSDK_BFAnnotHandler::~CPDFSDK_BFAnnotHandler() {} |
29 | 29 |
30 CFX_ByteString CPDFSDK_BFAnnotHandler::GetType() { | 30 CFX_ByteString CPDFSDK_BFAnnotHandler::GetType() { |
31 return CFX_ByteString("Widget"); | 31 return CFX_ByteString("Widget"); |
32 } | 32 } |
33 | 33 |
34 CFX_ByteString CPDFSDK_BFAnnotHandler::GetName() { | |
35 return CFX_ByteString("WidgetHandler"); | |
36 } | |
37 | |
38 FX_BOOL CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { | 34 FX_BOOL CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { |
39 ASSERT(pAnnot->GetType() == "Widget"); | 35 ASSERT(pAnnot->GetType() == "Widget"); |
40 if (pAnnot->GetSubType() == BFFT_SIGNATURE) | 36 if (pAnnot->GetSubType() == BFFT_SIGNATURE) |
41 return FALSE; | 37 return FALSE; |
42 | 38 |
43 CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot); | 39 CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot); |
44 if (!pWidget->IsVisible()) | 40 if (!pWidget->IsVisible()) |
45 return FALSE; | 41 return FALSE; |
46 | 42 |
47 int nFieldFlags = pWidget->GetFieldFlags(); | 43 int nFieldFlags = pWidget->GetFieldFlags(); |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 304 |
309 FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView* pPageView, | 305 FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView* pPageView, |
310 CPDFSDK_Annot* pAnnot, | 306 CPDFSDK_Annot* pAnnot, |
311 const CFX_FloatPoint& point) { | 307 const CFX_FloatPoint& point) { |
312 ASSERT(pPageView); | 308 ASSERT(pPageView); |
313 ASSERT(pAnnot); | 309 ASSERT(pAnnot); |
314 | 310 |
315 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot); | 311 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot); |
316 return rect.Contains(point.x, point.y); | 312 return rect.Contains(point.x, point.y); |
317 } | 313 } |
OLD | NEW |