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_xfawidget.h" 8 9 #include "fpdfsdk/ipdfsdk_annothandler.h" 10 #include "xfa/fxfa/xfa_ffwidget.h" 11 CPDFSDK_XFAWidget(CXFA_FFWidget * pAnnot,CPDFSDK_PageView * pPageView,CPDFSDK_InterForm * pInterForm)12CPDFSDK_XFAWidget::CPDFSDK_XFAWidget(CXFA_FFWidget* pAnnot, 13 CPDFSDK_PageView* pPageView, 14 CPDFSDK_InterForm* pInterForm) 15 : CPDFSDK_Annot(pPageView), 16 m_pInterForm(pInterForm), 17 m_hXFAWidget(pAnnot) {} 18 IsXFAField()19bool CPDFSDK_XFAWidget::IsXFAField() { 20 return true; 21 } 22 GetXFAWidget() const23CXFA_FFWidget* CPDFSDK_XFAWidget::GetXFAWidget() const { 24 return m_hXFAWidget; 25 } 26 GetAnnotSubtype() const27CPDF_Annot::Subtype CPDFSDK_XFAWidget::GetAnnotSubtype() const { 28 return CPDF_Annot::Subtype::XFAWIDGET; 29 } 30 GetRect() const31CFX_FloatRect CPDFSDK_XFAWidget::GetRect() const { 32 CFX_RectF rcBBox = GetXFAWidget()->GetRect(false); 33 return CFX_FloatRect(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width, 34 rcBBox.top + rcBBox.height); 35 } 36