chromium/third_party/pdfium/fpdfsdk/cpdfsdk_widget.cpp

// Copyright 2016 The PDFium Authors
// 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/cpdfsdk_widget.h"

#include "constants/access_permissions.h"
#include "constants/annotation_common.h"
#include "constants/appearance.h"
#include "constants/form_flags.h"
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_reference.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fpdfapi/parser/cpdf_string.h"
#include "core/fpdfdoc/cpdf_bafontmap.h"
#include "core/fpdfdoc/cpdf_defaultappearance.h"
#include "core/fpdfdoc/cpdf_formcontrol.h"
#include "core/fpdfdoc/cpdf_formfield.h"
#include "core/fpdfdoc/cpdf_iconfit.h"
#include "core/fpdfdoc/cpdf_interactiveform.h"
#include "core/fxcrt/check.h"
#include "core/fxcrt/notreached.h"
#include "core/fxge/cfx_fillrenderoptions.h"
#include "core/fxge/cfx_graphstatedata.h"
#include "core/fxge/cfx_path.h"
#include "core/fxge/cfx_renderdevice.h"
#include "fpdfsdk/cpdfsdk_appstream.h"
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_interactiveform.h"
#include "fpdfsdk/cpdfsdk_pageview.h"
#include "fpdfsdk/formfiller/cffl_fieldaction.h"
#include "fpdfsdk/pwl/cpwl_edit.h"

#ifdef PDF_ENABLE_XFA
#include "fpdfsdk/fpdfxfa/cpdfxfa_context.h"
#include "xfa/fxfa/cxfa_eventparam.h"
#include "xfa/fxfa/cxfa_ffdocview.h"
#include "xfa/fxfa/cxfa_ffwidget.h"
#include "xfa/fxfa/cxfa_ffwidgethandler.h"
#include "xfa/fxfa/parser/cxfa_node.h"
#endif  // PDF_ENABLE_XFA

CPDFSDK_Widget::CPDFSDK_Widget(CPDF_Annot* pAnnot,
                               CPDFSDK_PageView* pPageView,
                               CPDFSDK_InteractiveForm* pInteractiveForm)
    :{}

CPDFSDK_Widget::~CPDFSDK_Widget() {}

#ifdef PDF_ENABLE_XFA
CXFA_FFWidget* CPDFSDK_Widget::GetMixXFAWidget() const {}

CXFA_FFWidget* CPDFSDK_Widget::GetGroupMixXFAWidget() const {}

CXFA_FFWidgetHandler* CPDFSDK_Widget::GetXFAWidgetHandler() const {}

static XFA_EVENTTYPE GetXFAEventType(PDFSDK_XFAAActionType eXFAAAT) {}

static XFA_EVENTTYPE GetXFAEventType(CPDF_AAction::AActionType eAAT,
                                     bool bWillCommit) {}

bool CPDFSDK_Widget::HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT) const {}

bool CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT,
                                  CFFL_FieldAction* data,
                                  const CPDFSDK_PageView* pPageView) {}

void CPDFSDK_Widget::Synchronize(bool bSynchronizeElse) {}

bool CPDFSDK_Widget::HandleXFAAAction(
    CPDF_AAction::AActionType type,
    CFFL_FieldAction* data,
    CPDFSDK_FormFillEnvironment* pFormFillEnv) {}
#endif  // PDF_ENABLE_XFA

bool CPDFSDK_Widget::IsWidgetAppearanceValid(
    CPDF_Annot::AppearanceMode mode) const {}

bool CPDFSDK_Widget::IsPushHighlighted() const {}

FormFieldType CPDFSDK_Widget::GetFieldType() const {}

void CPDFSDK_Widget::SetRect(const CFX_FloatRect& rect) {}

bool CPDFSDK_Widget::IsAppearanceValid() {}

int CPDFSDK_Widget::GetLayoutOrder() const {}

int CPDFSDK_Widget::GetFieldFlags() const {}

bool CPDFSDK_Widget::IsSignatureWidget() const {}

CPDF_FormField* CPDFSDK_Widget::GetFormField() const {}

CPDF_FormControl* CPDFSDK_Widget::GetFormControl() const {}

int CPDFSDK_Widget::GetRotate() const {}

#ifdef PDF_ENABLE_XFA
WideString CPDFSDK_Widget::GetName() const {}
#endif  // PDF_ENABLE_XFA

std::optional<FX_COLORREF> CPDFSDK_Widget::GetFillColor() const {}

std::optional<FX_COLORREF> CPDFSDK_Widget::GetBorderColor() const {}

std::optional<FX_COLORREF> CPDFSDK_Widget::GetTextColor() const {}

float CPDFSDK_Widget::GetFontSize() const {}

int CPDFSDK_Widget::GetSelectedIndex(int nIndex) const {}

WideString CPDFSDK_Widget::GetValue() const {}

WideString CPDFSDK_Widget::GetExportValue() const {}

WideString CPDFSDK_Widget::GetOptionLabel(int nIndex) const {}

WideString CPDFSDK_Widget::GetSelectExportText(int nIndex) const {}

int CPDFSDK_Widget::CountOptions() const {}

bool CPDFSDK_Widget::IsOptionSelected(int nIndex) const {}

int CPDFSDK_Widget::GetTopVisibleIndex() const {}

bool CPDFSDK_Widget::IsChecked() const {}

int CPDFSDK_Widget::GetAlignment() const {}

int CPDFSDK_Widget::GetMaxLen() const {}

void CPDFSDK_Widget::SetCheck(bool bChecked) {}

void CPDFSDK_Widget::SetValue(const WideString& sValue) {}

void CPDFSDK_Widget::SetOptionSelection(int index) {}

void CPDFSDK_Widget::ClearSelection() {}

void CPDFSDK_Widget::SetTopVisibleIndex(int index) {}

void CPDFSDK_Widget::SetAppModified() {}

void CPDFSDK_Widget::ClearAppModified() {}

bool CPDFSDK_Widget::IsAppModified() const {}

#ifdef PDF_ENABLE_XFA
void CPDFSDK_Widget::ResetXFAAppearance(ValueChanged bValueChanged) {}
#endif  // PDF_ENABLE_XFA

void CPDFSDK_Widget::ResetAppearance(std::optional<WideString> sValue,
                                     ValueChanged bValueChanged) {}

std::optional<WideString> CPDFSDK_Widget::OnFormat() {}

void CPDFSDK_Widget::ResetFieldAppearance() {}

void CPDFSDK_Widget::OnDraw(CFX_RenderDevice* pDevice,
                            const CFX_Matrix& mtUser2Device,
                            bool bDrawAnnots) {}

bool CPDFSDK_Widget::DoHitTest(const CFX_PointF& point) {}

CFX_FloatRect CPDFSDK_Widget::GetViewBBox() {}

void CPDFSDK_Widget::OnMouseEnter(Mask<FWL_EVENTFLAG> nFlags) {}

void CPDFSDK_Widget::OnMouseExit(Mask<FWL_EVENTFLAG> nFlags) {}

bool CPDFSDK_Widget::OnLButtonDown(Mask<FWL_EVENTFLAG> nFlags,
                                   const CFX_PointF& point) {}

bool CPDFSDK_Widget::OnLButtonUp(Mask<FWL_EVENTFLAG> nFlags,
                                 const CFX_PointF& point) {}

bool CPDFSDK_Widget::OnLButtonDblClk(Mask<FWL_EVENTFLAG> nFlags,
                                     const CFX_PointF& point) {}

bool CPDFSDK_Widget::OnMouseMove(Mask<FWL_EVENTFLAG> nFlags,
                                 const CFX_PointF& point) {}

bool CPDFSDK_Widget::OnMouseWheel(Mask<FWL_EVENTFLAG> nFlags,
                                  const CFX_PointF& point,
                                  const CFX_Vector& delta) {}

bool CPDFSDK_Widget::OnRButtonDown(Mask<FWL_EVENTFLAG> nFlags,
                                   const CFX_PointF& point) {}

bool CPDFSDK_Widget::OnRButtonUp(Mask<FWL_EVENTFLAG> nFlags,
                                 const CFX_PointF& point) {}

bool CPDFSDK_Widget::OnChar(uint32_t nChar, Mask<FWL_EVENTFLAG> nFlags) {}

bool CPDFSDK_Widget::OnKeyDown(FWL_VKEYCODE nKeyCode,
                               Mask<FWL_EVENTFLAG> nFlags) {}

bool CPDFSDK_Widget::OnSetFocus(Mask<FWL_EVENTFLAG> nFlags) {}

bool CPDFSDK_Widget::OnKillFocus(Mask<FWL_EVENTFLAG> nFlags) {}

bool CPDFSDK_Widget::CanUndo() {}

bool CPDFSDK_Widget::CanRedo() {}

bool CPDFSDK_Widget::Undo() {}

bool CPDFSDK_Widget::Redo() {}

WideString CPDFSDK_Widget::GetText() {}

WideString CPDFSDK_Widget::GetSelectedText() {}

void CPDFSDK_Widget::ReplaceAndKeepSelection(const WideString& text) {}

void CPDFSDK_Widget::ReplaceSelection(const WideString& text) {}

bool CPDFSDK_Widget::SelectAllText() {}

bool CPDFSDK_Widget::SetIndexSelected(int index, bool selected) {}

bool CPDFSDK_Widget::IsIndexSelected(int index) {}

void CPDFSDK_Widget::DrawAppearance(CFX_RenderDevice* pDevice,
                                    const CFX_Matrix& mtUser2Device,
                                    CPDF_Annot::AppearanceMode mode) {}

void CPDFSDK_Widget::UpdateField() {}

void CPDFSDK_Widget::DrawShadow(CFX_RenderDevice* pDevice,
                                CPDFSDK_PageView* pPageView) {}

CFX_FloatRect CPDFSDK_Widget::GetClientRect() const {}

CFX_FloatRect CPDFSDK_Widget::GetRotatedRect() const {}

CFX_Matrix CPDFSDK_Widget::GetMatrix() const {}

CFX_Color CPDFSDK_Widget::GetTextPWLColor() const {}

CFX_Color CPDFSDK_Widget::GetBorderPWLColor() const {}

CFX_Color CPDFSDK_Widget::GetFillPWLColor() const {}

bool CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type,
                               CFFL_FieldAction* data,
                               const CPDFSDK_PageView* pPageView) {}

void CPDFSDK_Widget::OnLoad() {}

CPDF_Action CPDFSDK_Widget::GetAAction(CPDF_AAction::AActionType eAAT) {}

CFFL_InteractiveFormFiller* CPDFSDK_Widget::GetInteractiveFormFiller() {}