chromium/third_party/pdfium/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp

// Copyright 2014 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/formfiller/cffl_interactiveformfiller.h"

#include <algorithm>

#include "constants/access_permissions.h"
#include "constants/ascii.h"
#include "constants/form_flags.h"
#include "core/fpdfapi/page/cpdf_page.h"
#include "core/fxcrt/autorestorer.h"
#include "core/fxcrt/check.h"
#include "core/fxge/cfx_drawutils.h"
#include "fpdfsdk/cpdfsdk_pageview.h"
#include "fpdfsdk/cpdfsdk_widget.h"
#include "fpdfsdk/formfiller/cffl_checkbox.h"
#include "fpdfsdk/formfiller/cffl_combobox.h"
#include "fpdfsdk/formfiller/cffl_formfield.h"
#include "fpdfsdk/formfiller/cffl_listbox.h"
#include "fpdfsdk/formfiller/cffl_perwindowdata.h"
#include "fpdfsdk/formfiller/cffl_pushbutton.h"
#include "fpdfsdk/formfiller/cffl_radiobutton.h"
#include "fpdfsdk/formfiller/cffl_textfield.h"
#include "public/fpdf_fwlevent.h"

CFFL_InteractiveFormFiller::CFFL_InteractiveFormFiller(
    CallbackIface* pCallbackIface)
    :{}

CFFL_InteractiveFormFiller::~CFFL_InteractiveFormFiller() = default;

bool CFFL_InteractiveFormFiller::Annot_HitTest(const CPDFSDK_Widget* pWidget,
                                               const CFX_PointF& point) {}

FX_RECT CFFL_InteractiveFormFiller::GetViewBBox(
    const CPDFSDK_PageView* pPageView,
    CPDFSDK_Widget* pWidget) {}

void CFFL_InteractiveFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
                                        CPDFSDK_Widget* pWidget,
                                        CFX_RenderDevice* pDevice,
                                        const CFX_Matrix& mtUser2Device) {}

void CFFL_InteractiveFormFiller::OnDelete(CPDFSDK_Widget* pWidget) {}

void CFFL_InteractiveFormFiller::OnMouseEnter(
    CPDFSDK_PageView* pPageView,
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    Mask<FWL_EVENTFLAG> nFlag) {}

void CFFL_InteractiveFormFiller::OnMouseExit(
    CPDFSDK_PageView* pPageView,
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    Mask<FWL_EVENTFLAG> nFlag) {}

bool CFFL_InteractiveFormFiller::OnLButtonDown(
    CPDFSDK_PageView* pPageView,
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    Mask<FWL_EVENTFLAG> nFlags,
    const CFX_PointF& point) {}

bool CFFL_InteractiveFormFiller::OnLButtonUp(
    CPDFSDK_PageView* pPageView,
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    Mask<FWL_EVENTFLAG> nFlags,
    const CFX_PointF& point) {}

bool CFFL_InteractiveFormFiller::OnButtonUp(
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    const CPDFSDK_PageView* pPageView,
    Mask<FWL_EVENTFLAG> nFlag) {}

bool CFFL_InteractiveFormFiller::SetIndexSelected(
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    int index,
    bool selected) {}

bool CFFL_InteractiveFormFiller::IsIndexSelected(
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    int index) {}

bool CFFL_InteractiveFormFiller::OnLButtonDblClk(
    CPDFSDK_PageView* pPageView,
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    Mask<FWL_EVENTFLAG> nFlags,
    const CFX_PointF& point) {}

bool CFFL_InteractiveFormFiller::OnMouseMove(
    CPDFSDK_PageView* pPageView,
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    Mask<FWL_EVENTFLAG> nFlags,
    const CFX_PointF& point) {}

bool CFFL_InteractiveFormFiller::OnMouseWheel(
    CPDFSDK_PageView* pPageView,
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    Mask<FWL_EVENTFLAG> nFlags,
    const CFX_PointF& point,
    const CFX_Vector& delta) {}

bool CFFL_InteractiveFormFiller::OnRButtonDown(
    CPDFSDK_PageView* pPageView,
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    Mask<FWL_EVENTFLAG> nFlags,
    const CFX_PointF& point) {}

bool CFFL_InteractiveFormFiller::OnRButtonUp(
    CPDFSDK_PageView* pPageView,
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    Mask<FWL_EVENTFLAG> nFlags,
    const CFX_PointF& point) {}

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

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

bool CFFL_InteractiveFormFiller::OnSetFocus(
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    Mask<FWL_EVENTFLAG> nFlag) {}

bool CFFL_InteractiveFormFiller::OnKillFocus(
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    Mask<FWL_EVENTFLAG> nFlag) {}

void CFFL_InteractiveFormFiller::OnSetFieldInputFocus(const WideString& text) {}

void CFFL_InteractiveFormFiller::Invalidate(IPDF_Page* pPage,
                                            const FX_RECT& rect) {}

CPDFSDK_PageView* CFFL_InteractiveFormFiller::GetOrCreatePageView(
    IPDF_Page* pPage) {}

CPDFSDK_PageView* CFFL_InteractiveFormFiller::GetPageView(IPDF_Page* pPage) {}

CFX_Timer::HandlerIface* CFFL_InteractiveFormFiller::GetTimerHandler() {}

void CFFL_InteractiveFormFiller::OnChange() {}

bool CFFL_InteractiveFormFiller::IsVisible(CPDFSDK_Widget* pWidget) {}

bool CFFL_InteractiveFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget) {}

bool CFFL_InteractiveFormFiller::IsFillingAllowed(
    CPDFSDK_Widget* pWidget) const {}

CFFL_FormField* CFFL_InteractiveFormFiller::GetFormField(
    CPDFSDK_Widget* pWidget) {}

CFFL_FormField* CFFL_InteractiveFormFiller::GetOrCreateFormField(
    CPDFSDK_Widget* pWidget) {}

WideString CFFL_InteractiveFormFiller::GetText(CPDFSDK_Widget* pWidget) {}

WideString CFFL_InteractiveFormFiller::GetSelectedText(
    CPDFSDK_Widget* pWidget) {}

void CFFL_InteractiveFormFiller::ReplaceAndKeepSelection(
    CPDFSDK_Widget* pWidget,
    const WideString& text) {}

void CFFL_InteractiveFormFiller::ReplaceSelection(CPDFSDK_Widget* pWidget,
                                                  const WideString& text) {}

bool CFFL_InteractiveFormFiller::SelectAllText(CPDFSDK_Widget* pWidget) {}

bool CFFL_InteractiveFormFiller::CanUndo(CPDFSDK_Widget* pWidget) {}

bool CFFL_InteractiveFormFiller::CanRedo(CPDFSDK_Widget* pWidget) {}

bool CFFL_InteractiveFormFiller::Undo(CPDFSDK_Widget* pWidget) {}

bool CFFL_InteractiveFormFiller::Redo(CPDFSDK_Widget* pWidget) {}

void CFFL_InteractiveFormFiller::UnregisterFormField(CPDFSDK_Widget* pWidget) {}

void CFFL_InteractiveFormFiller::InvalidateRect(PerWindowData* pWidgetData,
                                                const CFX_FloatRect& rect) {}

void CFFL_InteractiveFormFiller::OutputSelectedRect(PerWindowData* pWidgetData,
                                                    const CFX_FloatRect& rect) {}

bool CFFL_InteractiveFormFiller::IsSelectionImplemented() const {}

void CFFL_InteractiveFormFiller::SetCursor(CursorStyle nCursorStyle) {}

void CFFL_InteractiveFormFiller::QueryWherePopup(
    const IPWL_FillerNotify::PerWindowData* pAttached,
    float fPopupMin,
    float fPopupMax,
    bool* bBottom,
    float* fPopupRet) {}

bool CFFL_InteractiveFormFiller::OnKeyStrokeCommit(
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    const CPDFSDK_PageView* pPageView,
    Mask<FWL_EVENTFLAG> nFlag) {}

bool CFFL_InteractiveFormFiller::OnValidate(
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    const CPDFSDK_PageView* pPageView,
    Mask<FWL_EVENTFLAG> nFlag) {}

void CFFL_InteractiveFormFiller::OnCalculate(
    ObservedPtr<CPDFSDK_Widget>& pWidget) {}

void CFFL_InteractiveFormFiller::OnFormat(
    ObservedPtr<CPDFSDK_Widget>& pWidget) {}

#ifdef PDF_ENABLE_XFA
bool CFFL_InteractiveFormFiller::OnClick(ObservedPtr<CPDFSDK_Widget>& pWidget,
                                         const CPDFSDK_PageView* pPageView,
                                         Mask<FWL_EVENTFLAG> nFlag) {}

bool CFFL_InteractiveFormFiller::OnFull(ObservedPtr<CPDFSDK_Widget>& pWidget,
                                        const CPDFSDK_PageView* pPageView,
                                        Mask<FWL_EVENTFLAG> nFlag) {}

bool CFFL_InteractiveFormFiller::OnPreOpen(ObservedPtr<CPDFSDK_Widget>& pWidget,
                                           const CPDFSDK_PageView* pPageView,
                                           Mask<FWL_EVENTFLAG> nFlag) {}

bool CFFL_InteractiveFormFiller::OnPostOpen(
    ObservedPtr<CPDFSDK_Widget>& pWidget,
    const CPDFSDK_PageView* pPageView,
    Mask<FWL_EVENTFLAG> nFlag) {}
#endif  // PDF_ENABLE_XFA

// static
bool CFFL_InteractiveFormFiller::IsValidAnnot(const CPDFSDK_PageView* pPageView,
                                              CPDFSDK_Widget* pWidget) {}

IPWL_FillerNotify::BeforeKeystrokeResult
CFFL_InteractiveFormFiller::OnBeforeKeyStroke(
    const IPWL_FillerNotify::PerWindowData* pAttached,
    WideString& strChange,
    const WideString& strChangeEx,
    int nSelStart,
    int nSelEnd,
    bool bKeyDown,
    Mask<FWL_EVENTFLAG> nFlag) {}

bool CFFL_InteractiveFormFiller::OnPopupPreOpen(
    const IPWL_FillerNotify::PerWindowData* pAttached,
    Mask<FWL_EVENTFLAG> nFlag) {}

bool CFFL_InteractiveFormFiller::OnPopupPostOpen(
    const IPWL_FillerNotify::PerWindowData* pAttached,
    Mask<FWL_EVENTFLAG> nFlag) {}