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 #ifndef FPDFSDK_FPDFXFA_CPDFXFA_WIDGET_H_
8 #define FPDFSDK_FPDFXFA_CPDFXFA_WIDGET_H_
9 
10 #include "core/fxcrt/fx_coordinates.h"
11 #include "core/fxcrt/fx_string.h"
12 #include "core/fxcrt/observed_ptr.h"
13 #include "core/fxcrt/unowned_ptr.h"
14 #include "fpdfsdk/cpdfsdk_annot.h"
15 #include "xfa/fxfa/cxfa_ffwidget.h"
16 
17 class CPDFSDK_InteractiveForm;
18 class CPDFSDK_PageView;
19 
20 class CPDFXFA_Widget final : public CPDFSDK_Annot {
21  public:
22   CPDFXFA_Widget(CXFA_FFWidget* pXFAFFWidget,
23                  CPDFSDK_PageView* pPageView,
24                  CPDFSDK_InteractiveForm* pInteractiveForm);
25   ~CPDFXFA_Widget() override;
26 
27   // CPDFSDK_Annot:
28   CPDFXFA_Widget* AsXFAWidget() override;
29   CPDF_Annot::Subtype GetAnnotSubtype() const override;
30   CFX_FloatRect GetRect() const override;
31 
GetXFAFFWidget()32   CXFA_FFWidget* GetXFAFFWidget() const { return m_pXFAFFWidget.Get(); }
GetInteractiveForm()33   CPDFSDK_InteractiveForm* GetInteractiveForm() const {
34     return m_pInteractiveForm.Get();
35   }
36 
37  private:
38   UnownedPtr<CPDFSDK_InteractiveForm> const m_pInteractiveForm;
39   ObservedPtr<CXFA_FFWidget> const m_pXFAFFWidget;
40 };
41 
42 #endif  // FPDFSDK_FPDFXFA_CPDFXFA_WIDGET_H_
43