Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cxfa_fffield.cpp
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
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#include "xfa/fxfa/cxfa_fffield.h"
8
9#include <algorithm>
10#include <utility>
11
12#include "constants/ascii.h"
13#include "third_party/base/check.h"
14#include "xfa/fgas/graphics/cfgas_gecolor.h"
15#include "xfa/fgas/graphics/cfgas_gegraphics.h"
16#include "xfa/fgas/graphics/cfgas_gepath.h"
17#include "xfa/fwl/cfwl_edit.h"
18#include "xfa/fwl/cfwl_eventmouse.h"
19#include "xfa/fwl/cfwl_messagekey.h"
20#include "xfa/fwl/cfwl_messagekillfocus.h"
21#include "xfa/fwl/cfwl_messagemouse.h"
22#include "xfa/fwl/cfwl_messagemousewheel.h"
23#include "xfa/fwl/cfwl_messagesetfocus.h"
24#include "xfa/fwl/cfwl_picturebox.h"
25#include "xfa/fwl/cfwl_widgetmgr.h"
26#include "xfa/fwl/fwl_widgetdef.h"
27#include "xfa/fxfa/cxfa_ffapp.h"
28#include "xfa/fxfa/cxfa_ffdoc.h"
29#include "xfa/fxfa/cxfa_ffdocview.h"
30#include "xfa/fxfa/cxfa_ffpageview.h"
31#include "xfa/fxfa/cxfa_ffwidget.h"
32#include "xfa/fxfa/cxfa_fwltheme.h"
33#include "xfa/fxfa/cxfa_textlayout.h"
34#include "xfa/fxfa/parser/cxfa_border.h"
35#include "xfa/fxfa/parser/cxfa_calculate.h"
36#include "xfa/fxfa/parser/cxfa_caption.h"
37#include "xfa/fxfa/parser/cxfa_margin.h"
38#include "xfa/fxfa/parser/cxfa_node.h"
39#include "xfa/fxfa/parser/cxfa_script.h"
40
41namespace {
42
43constexpr float kMinUIHeight = 4.32f;
44constexpr float kDefaultUIHeight = 2.0f;
45
46} // namespace
47
49
50CXFA_FFField::~CXFA_FFField() = default;
51
53 return nullptr;
54}
55
57 return this;
58}
59
60void CXFA_FFField::Trace(cppgc::Visitor* visitor) const {
61 CXFA_FFWidget::Trace(visitor);
62 visitor->Trace(m_pNormalWidget);
63}
64
66 if (focus == kDoNotDrawFocus)
68
69 switch (m_pNode->GetFFWidgetType()) {
70 case XFA_FFWidgetType::kButton:
71 case XFA_FFWidgetType::kCheckButton:
72 case XFA_FFWidgetType::kImageEdit:
73 case XFA_FFWidgetType::kSignature:
74 case XFA_FFWidgetType::kChoiceList:
75 return GetRotateMatrix().TransformRect(m_UIRect);
76 default:
77 return CFX_RectF();
78 }
79}
80
82 const CFX_Matrix& matrix,
83 HighlightOption highlight) {
84 if (!HasVisibleStatus())
85 return;
86
87 CFX_Matrix mtRotate = GetRotateMatrix();
88 mtRotate.Concat(matrix);
89
90 CXFA_FFWidget::RenderWidget(pGS, mtRotate, highlight);
91 DrawBorder(pGS, m_pNode->GetUIBorder(), m_UIRect, mtRotate);
92 RenderCaption(pGS, mtRotate);
93 DrawHighlight(pGS, mtRotate, highlight, kSquareShape);
94
96 CFX_Matrix mt(1, 0, 0, 1, rtWidget.left, rtWidget.top);
97 mt.Concat(mtRotate);
98 GetApp()->GetFWLWidgetMgr()->OnDrawWidget(GetNormalWidget(), pGS, mt);
99}
100
102 const CFX_Matrix& pMatrix,
103 HighlightOption highlight,
104 ShapeOption shape) {
105 if (highlight == kNoHighlight)
106 return;
107
108 if (m_UIRect.IsEmpty() || !GetDoc()->GetXFADoc()->IsInteractive() ||
109 !m_pNode->IsOpenAccess()) {
110 return;
111 }
112 pGS->SetFillColor(CFGAS_GEColor(GetDoc()->GetHighlightColor()));
113 CFGAS_GEPath path;
114 if (shape == kRoundShape)
116 else
119
121}
122
124 return m_pNormalWidget;
125}
126
128 return m_pNormalWidget;
129}
130
132 m_pNormalWidget = widget;
133}
134
138
140 m_pNode->LoadCaption(GetDoc());
142 return true;
143}
144
146 XFA_FFWidgetType eType = m_pNode->GetFFWidgetType();
147 if (eType != XFA_FFWidgetType::kTextEdit &&
150 return;
151 }
152
153 float fScrollOffset = 0;
154 CXFA_ContentLayoutItem* pItem = GetLayoutItem()->GetPrev();
155 CXFA_FFField* pPrev = pItem ? ToField(pItem->GetFFWidget()) : nullptr;
156 if (pPrev)
157 fScrollOffset = -(m_pNode->GetUIMargin().top);
158
159 while (pPrev) {
160 fScrollOffset += pPrev->m_UIRect.height;
161 pItem = pPrev->GetLayoutItem()->GetPrev();
162 pPrev = pItem ? ToField(pItem->GetFFWidget()) : nullptr;
163 }
164 static_cast<CFWL_Edit*>(GetNormalWidget())->SetScrollOffset(fScrollOffset);
165}
166
177
179 CFX_RectF rtWidget = GetRectWithoutRotate();
180 CXFA_Margin* margin = m_pNode->GetMarginIfExists();
181 if (margin) {
182 CXFA_ContentLayoutItem* pItem = GetLayoutItem();
183 float fLeftInset = margin->GetLeftInset();
184 float fRightInset = margin->GetRightInset();
185 float fTopInset = margin->GetTopInset();
186 float fBottomInset = margin->GetBottomInset();
187 if (!pItem->GetPrev() && !pItem->GetNext()) {
188 rtWidget.Deflate(fLeftInset, fTopInset, fRightInset, fBottomInset);
189 } else {
190 if (!pItem->GetPrev())
191 rtWidget.Deflate(fLeftInset, fTopInset, fRightInset, 0);
192 else if (!pItem->GetNext())
193 rtWidget.Deflate(fLeftInset, 0, fRightInset, fBottomInset);
194 else
195 rtWidget.Deflate(fLeftInset, 0, fRightInset, 0);
196 }
197 }
198
199 XFA_AttributeValue iCapPlacement = XFA_AttributeValue::Unknown;
200 float fCapReserve = 0;
201 CXFA_Caption* caption = m_pNode->GetCaptionIfExists();
202 if (caption && !caption->IsHidden()) {
203 iCapPlacement = caption->GetPlacementType();
204 if ((iCapPlacement == XFA_AttributeValue::Top &&
205 GetLayoutItem()->GetPrev()) ||
206 (iCapPlacement == XFA_AttributeValue::Bottom &&
207 GetLayoutItem()->GetNext())) {
209 } else {
210 fCapReserve = caption->GetReserve();
211 if (iCapPlacement == XFA_AttributeValue::Top ||
212 iCapPlacement == XFA_AttributeValue::Bottom) {
213 fCapReserve = std::min(fCapReserve, rtWidget.height);
214 } else {
215 fCapReserve = std::min(fCapReserve, rtWidget.width);
216 }
217 CXFA_ContentLayoutItem* pItem = GetLayoutItem();
218 if (!pItem->GetPrev() && !pItem->GetNext()) {
219 m_CaptionRect = rtWidget;
220 } else {
221 pItem = pItem->GetFirst();
223 pItem = pItem->GetNext();
224 while (pItem) {
226 pItem = pItem->GetNext();
227 }
229 }
230
231 CXFA_TextLayout* pCapTextLayout = m_pNode->GetCaptionTextLayout();
232 if (fCapReserve <= 0 && pCapTextLayout) {
233 CFX_SizeF minSize;
234 CFX_SizeF maxSize;
235 CFX_SizeF size = pCapTextLayout->CalcSize(minSize, maxSize);
236 if (iCapPlacement == XFA_AttributeValue::Top ||
237 iCapPlacement == XFA_AttributeValue::Bottom) {
238 fCapReserve = size.height;
239 } else {
240 fCapReserve = size.width;
241 }
242 }
243 }
244 }
245
246 m_UIRect = rtWidget;
247 CXFA_Margin* capMargin = caption ? caption->GetMarginIfExists() : nullptr;
248 switch (iCapPlacement) {
249 case XFA_AttributeValue::Left: {
250 m_CaptionRect.width = fCapReserve;
251 CapLeftRightPlacement(capMargin, rtWidget, iCapPlacement);
252 m_UIRect.width -= fCapReserve;
253 m_UIRect.left += fCapReserve;
254 break;
255 }
256 case XFA_AttributeValue::Top: {
257 m_CaptionRect.height = fCapReserve;
258 CapTopBottomPlacement(capMargin, rtWidget, iCapPlacement);
259 m_UIRect.top += fCapReserve;
260 m_UIRect.height -= fCapReserve;
261 break;
262 }
263 case XFA_AttributeValue::Right: {
265 m_CaptionRect.width = fCapReserve;
266 CapLeftRightPlacement(capMargin, rtWidget, iCapPlacement);
267 m_UIRect.width -= fCapReserve;
268 break;
269 }
270 case XFA_AttributeValue::Bottom: {
272 m_CaptionRect.height = fCapReserve;
273 CapTopBottomPlacement(capMargin, rtWidget, iCapPlacement);
274 m_UIRect.height -= fCapReserve;
275 break;
276 }
277 case XFA_AttributeValue::Inline:
278 break;
279 default:
280 break;
281 }
282
283 CXFA_Border* borderUI = m_pNode->GetUIBorder();
284 if (borderUI) {
285 CXFA_Margin* borderMargin = borderUI->GetMarginIfExists();
287 }
289}
290
291void CXFA_FFField::CapTopBottomPlacement(const CXFA_Margin* margin,
292 const CFX_RectF& rtWidget,
293 XFA_AttributeValue iCapPlacement) {
294 CFX_RectF rtUIMargin = m_pNode->GetUIMargin();
295 m_CaptionRect.left += rtUIMargin.left;
296 if (margin) {
298 if (m_CaptionRect.height < 0)
300 }
301
302 float fWidth = rtUIMargin.left + rtUIMargin.width;
303 float fHeight = m_CaptionRect.height + rtUIMargin.top + rtUIMargin.height;
304 if (fWidth > rtWidget.width)
305 m_UIRect.width += fWidth - rtWidget.width;
306
307 if (fHeight == kDefaultUIHeight && m_UIRect.height < kMinUIHeight) {
308 m_UIRect.height = kMinUIHeight;
309 m_CaptionRect.top += rtUIMargin.top + rtUIMargin.height;
310 } else if (fHeight > rtWidget.height) {
311 m_UIRect.height += fHeight - rtWidget.height;
312 if (iCapPlacement == XFA_AttributeValue::Bottom)
313 m_CaptionRect.top += fHeight - rtWidget.height;
314 }
315}
316
317void CXFA_FFField::CapLeftRightPlacement(const CXFA_Margin* margin,
318 const CFX_RectF& rtWidget,
319 XFA_AttributeValue iCapPlacement) {
320 CFX_RectF rtUIMargin = m_pNode->GetUIMargin();
321 m_CaptionRect.top += rtUIMargin.top;
322 m_CaptionRect.height -= rtUIMargin.top;
323 if (margin) {
325 if (m_CaptionRect.height < 0)
327 }
328
329 float fWidth = m_CaptionRect.width + rtUIMargin.left + rtUIMargin.width;
330 float fHeight = rtUIMargin.top + rtUIMargin.height;
331 if (fWidth > rtWidget.width) {
332 m_UIRect.width += fWidth - rtWidget.width;
333 if (iCapPlacement == XFA_AttributeValue::Right)
334 m_CaptionRect.left += fWidth - rtWidget.width;
335 }
336
337 if (fHeight == kDefaultUIHeight && m_UIRect.height < kMinUIHeight) {
338 m_UIRect.height = kMinUIHeight;
339 m_CaptionRect.top += rtUIMargin.top + rtUIMargin.height;
340 } else if (fHeight > rtWidget.height) {
341 m_UIRect.height += fHeight - rtWidget.height;
342 }
343}
344
349
351 CXFA_Node* pUiNode = m_pNode->GetUIChildNode();
352 if (pUiNode && pUiNode->GetElementType() == XFA_Element::DefaultUi)
354 return 0;
355}
356
359 return;
360
361 CFX_RectF rtUi = m_UIRect;
362 rtUi.width = std::max(rtUi.width, 1.0f);
363 if (!GetDoc()->GetXFADoc()->IsInteractive()) {
364 float fFontSize = m_pNode->GetFontSize();
365 rtUi.height = std::max(rtUi.height, fFontSize);
366 }
368}
369
372 return false;
373
374 CFWL_MessageMouse msg(GetNormalWidget(),
375 CFWL_MessageMouse::MouseCommand::kEnter,
376 Mask<XFA_FWL_KeyFlag>(), CFX_PointF());
378 return true;
379}
380
383 return false;
384
385 CFWL_MessageMouse msg(GetNormalWidget(),
386 CFWL_MessageMouse::MouseCommand::kLeave,
387 Mask<XFA_FWL_KeyFlag>(), CFX_PointF());
389 return true;
390}
391
392CFX_PointF CXFA_FFField::FWLToClient(const CFX_PointF& point) {
393 return GetNormalWidget()
394 ? point - GetNormalWidget()->GetWidgetRect().TopLeft()
395 : point;
396}
397
399 Mask<XFA_FWL_KeyFlag> dwFlags,
400 const CFX_PointF& point,
401 CFWL_MessageMouse::MouseCommand command) {
403 return false;
404 if (!m_pNode->IsOpenAccess() || !GetDoc()->GetXFADoc()->IsInteractive())
405 return false;
406 if (!PtInActiveRect(point))
407 return false;
408
409 return true;
410}
411
413 const CFX_PointF& point) {
414 SetButtonDown(true);
415 CFWL_MessageMouse msg(GetNormalWidget(),
416 CFWL_MessageMouse::MouseCommand::kLeftButtonDown,
417 dwFlags, FWLToClient(point));
419 return true;
420}
421
423 const CFX_PointF& point) {
425 return false;
426 if (!IsButtonDown())
427 return false;
428
429 SetButtonDown(false);
430
431 CFWL_MessageMouse msg(GetNormalWidget(),
432 CFWL_MessageMouse::MouseCommand::kLeftButtonUp, dwFlags,
433 FWLToClient(point));
435 return true;
436}
437
439 const CFX_PointF& point) {
441 return false;
442
443 CFWL_MessageMouse msg(GetNormalWidget(),
444 CFWL_MessageMouse::MouseCommand::kLeftButtonDblClk,
445 dwFlags, FWLToClient(point));
447 return true;
448}
449
451 const CFX_PointF& point) {
453 return false;
454
455 CFWL_MessageMouse msg(GetNormalWidget(),
456 CFWL_MessageMouse::MouseCommand::kMove, dwFlags,
457 FWLToClient(point));
459 return true;
460}
461
463 const CFX_PointF& point,
464 const CFX_Vector& delta) {
466 return false;
467
468 CFWL_MessageMouseWheel msg(GetNormalWidget(), FWLToClient(point), delta);
470 return true;
471}
472
474 const CFX_PointF& point) {
475 SetButtonDown(true);
476
477 CFWL_MessageMouse msg(GetNormalWidget(),
478 CFWL_MessageMouse::MouseCommand::kRightButtonDown,
479 dwFlags, FWLToClient(point));
481 return true;
482}
483
485 const CFX_PointF& point) {
487 return false;
488 if (!IsButtonDown())
489 return false;
490
491 SetButtonDown(false);
492 CFWL_MessageMouse msg(GetNormalWidget(),
493 CFWL_MessageMouse::MouseCommand::kRightButtonUp,
494 dwFlags, FWLToClient(point));
496 return true;
497}
498
500 const CFX_PointF& point) {
502 return false;
503
504 CFWL_MessageMouse msg(GetNormalWidget(),
505 CFWL_MessageMouse::MouseCommand::kRightButtonDblClk,
506 dwFlags, FWLToClient(point));
508 return true;
509}
510
512 if (!CXFA_FFWidget::OnSetFocus(pOldWidget))
513 return false;
514
516 return false;
517
518 CFWL_MessageSetFocus msg(GetNormalWidget());
522
523 return true;
524}
525
527 if (GetNormalWidget()) {
528 CFWL_MessageKillFocus msg(GetNormalWidget());
530 GetLayoutItem()->ClearStatusBits(XFA_WidgetStatus::kFocused);
532 }
533 return pNewWidget && CXFA_FFWidget::OnKillFocus(pNewWidget);
534}
535
537 Mask<XFA_FWL_KeyFlag> dwFlags) {
538 if (!GetNormalWidget() || !GetDoc()->GetXFADoc()->IsInteractive())
539 return false;
540
541 CFWL_MessageKey msg(GetNormalWidget(), CFWL_MessageKey::KeyCommand::kKeyDown,
542 dwFlags, dwKeyCode);
544 return true;
545}
546
547bool CXFA_FFField::OnChar(uint32_t dwChar, Mask<XFA_FWL_KeyFlag> dwFlags) {
548 if (!GetDoc()->GetXFADoc()->IsInteractive())
549 return false;
550 if (dwChar == pdfium::ascii::kTab)
551 return true;
553 return false;
554 if (!m_pNode->IsOpenAccess())
555 return false;
556
557 CFWL_MessageKey msg(GetNormalWidget(), CFWL_MessageKey::KeyCommand::kChar,
558 dwFlags, dwChar);
560 return true;
561}
562
563FWL_WidgetHit CXFA_FFField::HitTest(const CFX_PointF& point) {
564 auto* pNorm = GetNormalWidget();
565 if (pNorm && pNorm->HitTest(FWLToClient(point)) != FWL_WidgetHit::Unknown)
567 if (!GetRectWithoutRotate().Contains(point))
572}
573
574bool CXFA_FFField::PtInActiveRect(const CFX_PointF& point) {
575 return GetNormalWidget() &&
577}
578
580 CXFA_TextLayout* pCapTextLayout = m_pNode->GetCaptionTextLayout();
581 if (!pCapTextLayout)
582 return;
583
584 float fHeight = pCapTextLayout->Layout(m_CaptionRect.Size());
586}
587
589 const CFX_Matrix& pMatrix) {
590 CXFA_TextLayout* pCapTextLayout = m_pNode->GetCaptionTextLayout();
591 if (!pCapTextLayout)
592 return;
593
594 CXFA_Caption* caption = m_pNode->GetCaptionIfExists();
595 if (!caption || !caption->IsVisible())
596 return;
597
598 if (!pCapTextLayout->IsLoaded())
599 pCapTextLayout->Layout(m_CaptionRect.Size());
600
601 CFX_RectF rtClip = m_CaptionRect;
603 CFX_RenderDevice* pRenderDevice = pGS->GetRenderDevice();
605 rtClip = pMatrix.TransformRect(rtClip);
606 mt.Concat(pMatrix);
607 pCapTextLayout->DrawString(pRenderDevice, mt, rtClip, 0);
608}
609
611 if (!m_pNode->IsOpenAccess())
612 return false;
613 if (!IsDataChanged())
614 return false;
615
616 m_pDocView->SetChangeMark();
617 m_pDocView->AddValidateNode(m_pNode.Get());
618
619 if (CalculateOverride() != 1)
620 return false;
621 return CommitData();
622}
623
625 CXFA_Node* exclNode = m_pNode->GetExclGroupIfExists();
626 if (!exclNode || !exclNode->IsWidgetReady())
627 return CalculateNode(m_pNode.Get());
628 if (CalculateNode(exclNode) == 0)
629 return 0;
630
631 CXFA_Node* pNode = exclNode->GetExclGroupFirstMember();
632 if (!pNode)
633 return 1;
634
635 while (pNode) {
636 if (!pNode->IsWidgetReady())
637 return 1;
638 if (CalculateNode(pNode) == 0)
639 return 0;
640
641 pNode = pNode->GetExclGroupNextMember(pNode);
642 }
643 return 1;
644}
645
647 CXFA_Calculate* calc = pNode->GetCalculateIfExists();
648 if (!calc)
649 return 1;
650
651 XFA_VERSION version = GetDoc()->GetXFADoc()->GetCurVersionMode();
652 switch (calc->GetOverride()) {
653 case XFA_AttributeValue::Error: {
654 if (version <= XFA_VERSION_204)
655 return 1;
656
657 CXFA_FFApp::CallbackIface* pAppProvider = GetAppProvider();
658 if (pAppProvider) {
659 pAppProvider->MsgBox(
660 WideString::FromASCII("You are not allowed to modify this field."),
661 WideString::FromASCII("Calculate Override"),
662 static_cast<uint32_t>(AlertIcon::kWarning),
663 static_cast<uint32_t>(AlertButton::kOK));
664 }
665 return 0;
666 }
667 case XFA_AttributeValue::Warning: {
668 if (version <= XFA_VERSION_204) {
669 CXFA_Script* script = calc->GetScriptIfExists();
670 if (!script || script->GetExpression().IsEmpty())
671 return 1;
672 }
673
674 if (pNode->IsUserInteractive())
675 return 1;
676
677 CXFA_FFApp::CallbackIface* pAppProvider = GetAppProvider();
678 if (!pAppProvider)
679 return 0;
680
681 WideString wsMessage = calc->GetMessageText();
682 if (!wsMessage.IsEmpty())
683 wsMessage += L"\r\n";
684 wsMessage +=
685 WideString::FromASCII("Are you sure you want to modify this field?");
686
687 if (pAppProvider->MsgBox(wsMessage,
688 WideString::FromASCII("Calculate Override"),
689 static_cast<uint32_t>(AlertIcon::kWarning),
690 static_cast<uint32_t>(AlertButton::kYesNo)) ==
691 static_cast<uint32_t>(AlertReturn::kYes)) {
693 return 1;
694 }
695 return 0;
696 }
697 case XFA_AttributeValue::Ignore:
698 return 0;
699 case XFA_AttributeValue::Disabled:
701 return 1;
702 default:
703 return 1;
704 }
705}
706
708 return false;
709}
710
712 return false;
713}
714
716 DCHECK(pMessage);
717 GetApp()->GetFWLWidgetMgr()->OnProcessMessageToForm(pMessage);
718}
719
721
723 switch (pEvent->GetType()) {
725 CFWL_EventMouse* event = static_cast<CFWL_EventMouse*>(pEvent);
726 CFWL_MessageMouse::MouseCommand cmd = event->GetCommand();
727 if (cmd == CFWL_MessageMouse::MouseCommand::kEnter) {
729 m_pNode->ProcessEvent(GetDocView(), XFA_AttributeValue::MouseEnter,
730 &eParam);
731 } else if (cmd == CFWL_MessageMouse::MouseCommand::kLeave) {
733 m_pNode->ProcessEvent(GetDocView(), XFA_AttributeValue::MouseExit,
734 &eParam);
735 } else if (cmd == CFWL_MessageMouse::MouseCommand::kLeftButtonDown) {
737 m_pNode->ProcessEvent(GetDocView(), XFA_AttributeValue::MouseDown,
738 &eParam);
739 } else if (cmd == CFWL_MessageMouse::MouseCommand::kLeftButtonUp) {
741 m_pNode->ProcessEvent(GetDocView(), XFA_AttributeValue::MouseUp,
742 &eParam);
743 }
744 break;
745 }
748 m_pNode->ProcessEvent(GetDocView(), XFA_AttributeValue::Click, &eParam);
749 break;
750 }
751 default:
752 break;
753 }
754}
755
757 const CFX_Matrix& matrix) {}
#define FWL_STYLEEXT_EDT_ReadOnly
Definition cfwl_edit.h:19
void FillPath(const CFGAS_GEPath &path, CFX_FillRenderOptions::FillType fill_type, const CFX_Matrix &matrix)
CFX_RenderDevice * GetRenderDevice()
void SetFillColor(const CFGAS_GEColor &color)
void AddRectangle(float left, float top, float width, float height)
void AddEllipse(const CFX_RectF &rect)
void SetScrollOffset(float fScrollOffset) override
CFWL_MessageMouse::MouseCommand GetCommand() const
Type GetType() const
Definition cfwl_event.h:39
CFWL_MessageKillFocus(CFWL_Widget *pDstTarget)
CFWL_MessageSetFocus(CFWL_Widget *pDstTarget)
virtual CFX_RectF GetWidgetRect()
virtual void Update()=0
void SetWidgetRect(const CFX_RectF &rect)
CFX_Matrix(float a1, float b1, float c1, float d1, float e1, float f1)
CFX_RectF TransformRect(const CFX_RectF &rect) const
void Concat(const CFX_Matrix &right)
constexpr CFX_RectF()=default
void Intersect(const CFX_RectF &rt)
void Deflate(float off_left, float off_top, float off_right, float off_bottom)
CFX_RectF & operator=(const CFX_RectF &other)=default
float Height() const
float bottom() const
void Normalize()
bool Contains(const PointType &p) const
float right() const
CXFA_Script * GetScriptIfExists()
XFA_AttributeValue GetOverride()
WideString GetMessageText() const
float GetReserve() const
CXFA_Margin * GetMarginIfExists()
XFA_AttributeValue GetPlacementType()
CXFA_ContentLayoutItem * GetPrev() const
CXFA_ContentLayoutItem * GetNext() const
CXFA_ContentLayoutItem * GetFirst()
CXFA_EventParam(XFA_EVENTTYPE type)
virtual int32_t MsgBox(const WideString &wsMessage, const WideString &wsTitle, uint32_t dwIconType, uint32_t dwButtonType)=0
CXFA_FFField(CXFA_Node *pNode)
bool OnMouseEnter() override
bool OnSetFocus(CXFA_FFWidget *pOldWidget) override
void OnProcessMessage(CFWL_Message *pMessage) override
int32_t CalculateOverride()
bool OnMouseExit() override
bool OnLButtonUp(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
virtual bool IsDataChanged()
void OnDrawWidget(CFGAS_GEGraphics *pGraphics, const CFX_Matrix &matrix) override
void RenderWidget(CFGAS_GEGraphics *pGS, const CFX_Matrix &matrix, HighlightOption highlight) override
int32_t CalculateNode(CXFA_Node *pNode)
bool OnMouseWheel(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point, const CFX_Vector &delta) override
bool OnLButtonDown(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
const CFWL_Widget * GetNormalWidget() const
bool OnLButtonDblClk(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
bool OnKillFocus(CXFA_FFWidget *pNewWidget) override
CFX_PointF FWLToClient(const CFX_PointF &point)
~CXFA_FFField() override
bool PerformLayout() override
CFX_RectF m_UIRect
void DrawHighlight(CFGAS_GEGraphics *pGS, const CFX_Matrix &pMatrix, HighlightOption highlight, ShapeOption shape)
bool ProcessCommittedData()
virtual void SetFWLRect()
bool OnRButtonDblClk(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
virtual CXFA_FFDropDown * AsDropDown()
bool LoadWidget() override
void SetEditScrollOffset()
bool OnRButtonDown(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
CFWL_Widget * GetNormalWidget()
CFX_RectF GetBBox(FocusOption focus) override
bool OnRButtonUp(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
bool AcceptsFocusOnButtonDown(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point, CFWL_MessageMouse::MouseCommand command) override
void SetNormalWidget(CFWL_Widget *widget)
void CapTopBottomPlacement(const CXFA_Margin *margin, const CFX_RectF &rtWidget, XFA_AttributeValue iCapPlacement)
bool PtInActiveRect(const CFX_PointF &point) override
FWL_WidgetHit HitTest(const CFX_PointF &point) override
void OnProcessEvent(CFWL_Event *pEvent) override
uint32_t UpdateUIProperty()
void RenderCaption(CFGAS_GEGraphics *pGS, const CFX_Matrix &pMatrix)
virtual bool CommitData()
CFX_RectF m_CaptionRect
bool IsLoaded() override
bool OnChar(uint32_t dwChar, Mask< XFA_FWL_KeyFlag > dwFlags) override
void CapLeftRightPlacement(const CXFA_Margin *margin, const CFX_RectF &rtWidget, XFA_AttributeValue iCapPlacement)
void SendMessageToFWLWidget(CFWL_Message *pMessage)
bool OnKeyDown(XFA_FWL_VKEYCODE dwKeyCode, Mask< XFA_FWL_KeyFlag > dwFlags) override
bool OnMouseMove(Mask< XFA_FWL_KeyFlag > dwFlags, const CFX_PointF &point) override
CXFA_FFField * AsField() override
CFX_Matrix GetRotateMatrix() override
virtual bool PerformLayout()
virtual bool OnSetFocus(CXFA_FFWidget *pOldWidget)
virtual void RenderWidget(CFGAS_GEGraphics *pGS, const CFX_Matrix &matrix, HighlightOption highlight)
CXFA_FFWidget(CXFA_Node *pNode)
bool HasVisibleStatus() const
virtual bool IsLoaded()
CXFA_FFApp::CallbackIface * GetAppProvider()
void SetButtonDown(bool bSet)
virtual CFX_RectF GetBBox(FocusOption focus)
CXFA_FFDoc * GetDoc()
CXFA_FFApp * GetApp()
CFX_RectF GetRectWithoutRotate()
CXFA_ContentLayoutItem * GetLayoutItem() const
virtual bool OnKillFocus(CXFA_FFWidget *pNewWidget)
float GetBottomInset() const
float GetLeftInset() const
float GetTopInset() const
float GetRightInset() const
CXFA_Calculate * GetCalculateIfExists() const
void SetFlag(XFA_NodeFlag dwFlag)
CXFA_Node * GetExclGroupFirstMember()
CXFA_Node * GetExclGroupNextMember(CXFA_Node *pNode)
bool IsUserInteractive() const
Definition cxfa_node.h:162
bool IsWidgetReady() const
Definition cxfa_node.h:327
CXFA_Margin * GetMarginIfExists() const
XFA_Element GetElementType() const
Definition cxfa_object.h:91
WideString GetExpression()
bool IsLoaded() const
float Layout(const CFX_SizeF &size)
WideString & operator+=(const wchar_t *str)
bool IsEmpty() const
Definition widestring.h:118
static WideString FromASCII(ByteStringView str)
XFA_VERSION
@ XFA_VERSION_204
@ XFA_EVENT_Click
@ XFA_EVENT_MouseDown
@ XFA_EVENT_MouseEnter
@ XFA_EVENT_MouseUp
@ XFA_EVENT_MouseExit
CXFA_FFField * ToField(CXFA_FFWidget *widget)
void XFA_RectWithoutMargin(CFX_RectF *rt, const CXFA_Margin *margin)
XFA_FFWidgetType
XFA_NodeFlag
Definition cxfa_node.h:77
XFA_FWL_KeyFlag
XFA_FWL_VKEYCODE
FWL_WidgetHit
AlertIcon
Definition fxfa.h:20
AlertButton
Definition fxfa.h:11
AlertReturn
Definition fxfa.h:30
XFA_WidgetStatus
Definition fxfa.h:61
XFA_Element
Definition fxfa_basic.h:75
XFA_AttributeValue
Definition fxfa_basic.h:60
Definition heap.h:12
constexpr uint8_t kTab
Definition ascii.h:18