7#include "fpdfsdk/fpdfxfa/cpdfxfa_widget.h"
9#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
10#include "fpdfsdk/cpdfsdk_pageview.h"
11#include "third_party/base/check.h"
12#include "xfa/fgas/graphics/cfgas_gegraphics.h"
13#include "xfa/fxfa/cxfa_ffdocview.h"
14#include "xfa/fxfa/cxfa_ffpageview.h"
15#include "xfa/fxfa/cxfa_ffwidget.h"
16#include "xfa/fxfa/cxfa_ffwidgethandler.h"
17#include "xfa/fxfa/parser/cxfa_node.h"
19#define CHECK_FWL_VKEY_ENUM____(name)
20 static_assert(static_cast<int>(name) == static_cast<int>(XFA_##name),
21 "FWL_VKEYCODE enum mismatch")
193#undef CHECK_FWL_VKEY_ENUM____
219 CPDFSDK_PageView* pPageView)
243 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
248 bool is_highlight =
GetPageView()->GetFormFillEnv()->GetFocusAnnot() !=
this;
255bool CPDFXFA_Widget::
DoHitTest(
const CFX_PointF& point) {
256 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
279 DCHECK(node->IsWidgetReady());
292 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
298 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
304 const CFX_PointF& point) {
305 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
306 return widget_handler && widget_handler->OnLButtonDown(
307 GetXFAFFWidget(), GetKeyFlags(nFlags), point);
311 const CFX_PointF& point) {
312 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
313 return widget_handler && widget_handler->OnLButtonUp(
314 GetXFAFFWidget(), GetKeyFlags(nFlags), point);
318 const CFX_PointF& point) {
319 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
320 return widget_handler && widget_handler->OnLButtonDblClk(
321 GetXFAFFWidget(), GetKeyFlags(nFlags), point);
325 const CFX_PointF& point) {
326 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
327 return widget_handler && widget_handler->OnMouseMove(
328 GetXFAFFWidget(), GetKeyFlags(nFlags), point);
332 const CFX_PointF& point,
333 const CFX_Vector& delta) {
334 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
335 return widget_handler &&
336 widget_handler->OnMouseWheel(GetXFAFFWidget(), GetKeyFlags(nFlags),
341 const CFX_PointF& point) {
342 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
343 return widget_handler && widget_handler->OnRButtonDown(
344 GetXFAFFWidget(), GetKeyFlags(nFlags), point);
348 const CFX_PointF& point) {
349 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
350 return widget_handler && widget_handler->OnRButtonUp(
351 GetXFAFFWidget(), GetKeyFlags(nFlags), point);
354bool CPDFXFA_Widget::
OnChar(uint32_t nChar,
Mask<FWL_EVENTFLAG> nFlags) {
355 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
356 return widget_handler &&
357 widget_handler->OnChar(GetXFAFFWidget(), nChar, GetKeyFlags(nFlags));
361 Mask<FWL_EVENTFLAG> nFlags) {
362 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
363 return widget_handler &&
364 widget_handler->OnKeyDown(GetXFAFFWidget(),
365 static_cast<XFA_FWL_VKEYCODE>(nKeyCode),
366 GetKeyFlags(nFlags));
381 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
386 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
391 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
396 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
401 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
408 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
421 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
427 CXFA_FFWidgetHandler* widget_handler = GetWidgetHandler();
444CXFA_FFWidgetHandler* CPDFXFA_Widget::GetWidgetHandler() {
CFGAS_GEGraphics(CFX_RenderDevice *renderDevice)
void Inflate(float x, float y)
CFX_FloatRect ToFloatRect() const
CPDFSDK_Annot(CPDFSDK_PageView *pPageView)
CPDFSDK_PageView * GetPageView() const
CFX_RectF GetAbsoluteRect() const
CXFA_FFWidgetHandler * GetWidgetHandler()
bool SetFocus(CXFA_FFWidget *pNewFocus)
CXFA_FFWidget * GetFocusWidget() const
CXFA_FFDocView * GetDocView() const
XFA_FFWidgetType GetFFWidgetType()
@ FWL_EVENTFLAG_RightButtonDown
@ FWL_EVENTFLAG_LeftButtonDown
@ FWL_EVENTFLAG_MiddleButtonDown
@ FWL_EVENTFLAG_ControlKey