summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_xfawidget.cpp
diff options
context:
space:
mode:
authorjaepark <jaepark@google.com>2016-08-17 11:34:36 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-17 11:34:37 -0700
commit611adb8c91c1d40c95097bb04b4f9eba03b599f9 (patch)
treea66e2b150f2f01a00ef54d1b2262c2656cdfbb84 /fpdfsdk/cpdfsdk_xfawidget.cpp
parent7c05a7ac2738ef5e80692d5e3d2db68b86f27ea4 (diff)
downloadpdfium-611adb8c91c1d40c95097bb04b4f9eba03b599f9.tar.xz
Split fpdfsdk/fsdk_baseform.h into individual classes.
This CL moves classes in fsdk_baseform.h to their own files. Classes include CPDFSDK_Widget, CBA_AnnotIterator, CPDFSDK_XFAWidget, PDFSDK_FieldAction, and CPDFSDK_Interform. Review-Url: https://codereview.chromium.org/2252723002
Diffstat (limited to 'fpdfsdk/cpdfsdk_xfawidget.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_xfawidget.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/fpdfsdk/cpdfsdk_xfawidget.cpp b/fpdfsdk/cpdfsdk_xfawidget.cpp
new file mode 100644
index 0000000000..b866156da8
--- /dev/null
+++ b/fpdfsdk/cpdfsdk_xfawidget.cpp
@@ -0,0 +1,40 @@
+// Copyright 2016 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "fpdfsdk/include/cpdfsdk_xfawidget.h"
+
+#include "fpdfsdk/include/ipdfsdk_annothandler.h"
+#include "xfa/fxfa/include/xfa_ffwidget.h"
+
+CPDFSDK_XFAWidget::CPDFSDK_XFAWidget(CXFA_FFWidget* pAnnot,
+ CPDFSDK_PageView* pPageView,
+ CPDFSDK_InterForm* pInterForm)
+ : CPDFSDK_Annot(pPageView),
+ m_pInterForm(pInterForm),
+ m_hXFAWidget(pAnnot) {}
+
+FX_BOOL CPDFSDK_XFAWidget::IsXFAField() {
+ return TRUE;
+}
+
+CXFA_FFWidget* CPDFSDK_XFAWidget::GetXFAWidget() const {
+ return m_hXFAWidget;
+}
+
+CFX_ByteString CPDFSDK_XFAWidget::GetType() const {
+ return FSDK_XFAWIDGET_TYPENAME;
+}
+
+CFX_ByteString CPDFSDK_XFAWidget::GetSubType() const {
+ return "";
+}
+
+CFX_FloatRect CPDFSDK_XFAWidget::GetRect() const {
+ CFX_RectF rcBBox;
+ GetXFAWidget()->GetRect(rcBBox);
+ return CFX_FloatRect(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width,
+ rcBBox.top + rcBBox.height);
+}