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/fpdfxfa/cpdfxfa_widget.h" 8 9 #include "fpdfsdk/ipdfsdk_annothandler.h" 10 #include "xfa/fxfa/cxfa_ffwidget.h" 11 CPDFXFA_Widget(CXFA_FFWidget * pXFAFFWidget,CPDFSDK_PageView * pPageView,CPDFSDK_InteractiveForm * pInteractiveForm)12CPDFXFA_Widget::CPDFXFA_Widget(CXFA_FFWidget* pXFAFFWidget, 13 CPDFSDK_PageView* pPageView, 14 CPDFSDK_InteractiveForm* pInteractiveForm) 15 : CPDFSDK_Annot(pPageView), 16 m_pInteractiveForm(pInteractiveForm), 17 m_pXFAFFWidget(pXFAFFWidget) {} 18 19 CPDFXFA_Widget::~CPDFXFA_Widget() = default; 20 AsXFAWidget()21CPDFXFA_Widget* CPDFXFA_Widget::AsXFAWidget() { 22 return this; 23 } 24 GetAnnotSubtype() const25CPDF_Annot::Subtype CPDFXFA_Widget::GetAnnotSubtype() const { 26 return CPDF_Annot::Subtype::XFAWIDGET; 27 } 28 GetRect() const29CFX_FloatRect CPDFXFA_Widget::GetRect() const { 30 return GetXFAFFWidget()->GetLayoutItem()->GetRect(false).ToFloatRect(); 31 } 32