blob: 902ff2a2e8d08e3ceda9ad343c0b8aa850f9854a [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
tsepez4cf55152016-11-02 14:37:54 -070019bool CPDFSDK_XFAWidget::IsXFAField() {
20 return true;
jaepark611adb82016-08-17 11:34:36 -070021}
22
23CXFA_FFWidget* CPDFSDK_XFAWidget::GetXFAWidget() const {
24 return m_hXFAWidget;
25}
26
jaepark956553e2016-08-31 06:49:27 -070027CPDF_Annot::Subtype CPDFSDK_XFAWidget::GetAnnotSubtype() const {
28 return CPDF_Annot::Subtype::XFAWIDGET;
jaepark611adb82016-08-17 11:34:36 -070029}
30
jaepark611adb82016-08-17 11:34:36 -070031CFX_FloatRect CPDFSDK_XFAWidget::GetRect() const {
Dan Sinclairc2229072017-02-07 09:04:28 -050032 CFX_RectF rcBBox = GetXFAWidget()->GetRect(false);
jaepark611adb82016-08-17 11:34:36 -070033 return CFX_FloatRect(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width,
34 rcBBox.top + rcBBox.height);
35}