blob: af08023ef858cdf1486a46ee7db8259911917275 [file] [log] [blame]
jaepark611adb82016-08-17 11:34:36 -07001// 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
dsinclair114e46a2016-09-29 17:18:21 -07007#include "fpdfsdk/cpdfsdk_xfawidget.h"
jaepark611adb82016-08-17 11:34:36 -07008
dsinclair114e46a2016-09-29 17:18:21 -07009#include "fpdfsdk/ipdfsdk_annothandler.h"
Dan Sinclair80c48782017-03-23 12:11:20 -040010#include "xfa/fxfa/cxfa_ffwidget.h"
jaepark611adb82016-08-17 11:34:36 -070011
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
Tom Sepezd0409af2017-05-25 15:53:57 -070019CPDFSDK_XFAWidget::~CPDFSDK_XFAWidget() {}
20
tsepez4cf55152016-11-02 14:37:54 -070021bool CPDFSDK_XFAWidget::IsXFAField() {
22 return true;
jaepark611adb82016-08-17 11:34:36 -070023}
24
25CXFA_FFWidget* CPDFSDK_XFAWidget::GetXFAWidget() const {
Tom Sepezd0409af2017-05-25 15:53:57 -070026 return m_hXFAWidget.Get();
jaepark611adb82016-08-17 11:34:36 -070027}
28
jaepark956553e2016-08-31 06:49:27 -070029CPDF_Annot::Subtype CPDFSDK_XFAWidget::GetAnnotSubtype() const {
30 return CPDF_Annot::Subtype::XFAWIDGET;
jaepark611adb82016-08-17 11:34:36 -070031}
32
jaepark611adb82016-08-17 11:34:36 -070033CFX_FloatRect CPDFSDK_XFAWidget::GetRect() const {
Dan Sinclairc2229072017-02-07 09:04:28 -050034 CFX_RectF rcBBox = GetXFAWidget()->GetRect(false);
jaepark611adb82016-08-17 11:34:36 -070035 return CFX_FloatRect(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width,
36 rcBBox.top + rcBBox.height);
37}