7#include "xfa/fxfa/cxfa_ffnotify.h"
11#include "third_party/base/check.h"
12#include "xfa/fxfa/cxfa_ffapp.h"
13#include "xfa/fxfa/cxfa_ffarc.h"
14#include "xfa/fxfa/cxfa_ffbarcode.h"
15#include "xfa/fxfa/cxfa_ffcheckbutton.h"
16#include "xfa/fxfa/cxfa_ffcombobox.h"
17#include "xfa/fxfa/cxfa_ffdatetimeedit.h"
18#include "xfa/fxfa/cxfa_ffdoc.h"
19#include "xfa/fxfa/cxfa_ffdocview.h"
20#include "xfa/fxfa/cxfa_ffexclgroup.h"
21#include "xfa/fxfa/cxfa_fffield.h"
22#include "xfa/fxfa/cxfa_ffimage.h"
23#include "xfa/fxfa/cxfa_ffimageedit.h"
24#include "xfa/fxfa/cxfa_ffline.h"
25#include "xfa/fxfa/cxfa_fflistbox.h"
26#include "xfa/fxfa/cxfa_ffnumericedit.h"
27#include "xfa/fxfa/cxfa_ffpageview.h"
28#include "xfa/fxfa/cxfa_ffpasswordedit.h"
29#include "xfa/fxfa/cxfa_ffpushbutton.h"
30#include "xfa/fxfa/cxfa_ffrectangle.h"
31#include "xfa/fxfa/cxfa_ffsignature.h"
32#include "xfa/fxfa/cxfa_fftext.h"
33#include "xfa/fxfa/cxfa_ffwidget.h"
34#include "xfa/fxfa/cxfa_ffwidgethandler.h"
35#include "xfa/fxfa/cxfa_fwladapterwidgetmgr.h"
36#include "xfa/fxfa/cxfa_textlayout.h"
37#include "xfa/fxfa/cxfa_textprovider.h"
38#include "xfa/fxfa/layout/cxfa_layoutprocessor.h"
39#include "xfa/fxfa/parser/cxfa_barcode.h"
40#include "xfa/fxfa/parser/cxfa_binditems.h"
41#include "xfa/fxfa/parser/cxfa_button.h"
42#include "xfa/fxfa/parser/cxfa_checkbutton.h"
43#include "xfa/fxfa/parser/cxfa_node.h"
44#include "xfa/fxfa/parser/cxfa_passwordedit.h"
51 visitor->Trace(m_pDoc);
56 CXFA_FFDocView* pDocView = m_pDoc->GetDocView(pSender->GetLayout());
62 const WideString& wsLabel,
67 CXFA_FFWidget* pWidget = m_pDoc->GetDocView()->GetWidgetForNode(pSender);
79 CXFA_FFWidget* pWidget = m_pDoc->GetDocView()->GetWidgetForNode(pSender);
90 auto* pLayout = CXFA_LayoutProcessor::FromDocument(m_pDoc->GetXFADoc());
91 return cppgc::MakeGarbageCollected<CXFA_FFPageView>(
92 m_pDoc->GetHeap()->GetAllocationHandle(), m_pDoc->GetDocView(pLayout),
97 DCHECK(pNode->GetElementType() != XFA_Element::ContentArea);
98 DCHECK(pNode->GetElementType() != XFA_Element::PageArea);
111 pWidget = cppgc::MakeGarbageCollected<CXFA_FFBarcode>(
112 m_pDoc->GetHeap()->GetAllocationHandle(), pNode, child);
120 pWidget = cppgc::MakeGarbageCollected<CXFA_FFPushButton>(
121 m_pDoc->GetHeap()->GetAllocationHandle(), pNode, child);
129 pWidget = cppgc::MakeGarbageCollected<CXFA_FFCheckButton>(
130 m_pDoc->GetHeap()->GetAllocationHandle(), pNode, child);
135 pWidget = cppgc::MakeGarbageCollected<CXFA_FFListBox>(
136 m_pDoc->GetHeap()->GetAllocationHandle(), pNode);
138 pWidget = cppgc::MakeGarbageCollected<CXFA_FFComboBox>(
139 m_pDoc->GetHeap()->GetAllocationHandle(), pNode);
143 case XFA_FFWidgetType::kDateTimeEdit:
144 pWidget = cppgc::MakeGarbageCollected<CXFA_FFDateTimeEdit>(
145 m_pDoc->GetHeap()->GetAllocationHandle(), pNode);
147 case XFA_FFWidgetType::kImageEdit:
148 pWidget = cppgc::MakeGarbageCollected<CXFA_FFImageEdit>(
149 m_pDoc->GetHeap()->GetAllocationHandle(), pNode);
151 case XFA_FFWidgetType::kNumericEdit:
152 pWidget = cppgc::MakeGarbageCollected<CXFA_FFNumericEdit>(
153 m_pDoc->GetHeap()->GetAllocationHandle(), pNode);
160 pWidget = cppgc::MakeGarbageCollected<CXFA_FFPasswordEdit>(
161 m_pDoc->GetHeap()->GetAllocationHandle(), pNode, child);
164 case XFA_FFWidgetType::kSignature:
165 pWidget = cppgc::MakeGarbageCollected<CXFA_FFSignature>(
166 m_pDoc->GetHeap()->GetAllocationHandle(), pNode);
168 case XFA_FFWidgetType::kTextEdit:
169 pWidget = cppgc::MakeGarbageCollected<CXFA_FFTextEdit>(
170 m_pDoc->GetHeap()->GetAllocationHandle(), pNode);
172 case XFA_FFWidgetType::kArc:
173 pWidget = cppgc::MakeGarbageCollected<CXFA_FFArc>(
174 m_pDoc->GetHeap()->GetAllocationHandle(), pNode);
176 case XFA_FFWidgetType::kLine:
177 pWidget = cppgc::MakeGarbageCollected<CXFA_FFLine>(
178 m_pDoc->GetHeap()->GetAllocationHandle(), pNode);
180 case XFA_FFWidgetType::kRectangle:
181 pWidget = cppgc::MakeGarbageCollected<CXFA_FFRectangle>(
182 m_pDoc->GetHeap()->GetAllocationHandle(), pNode);
184 case XFA_FFWidgetType::kText:
185 pWidget = cppgc::MakeGarbageCollected<CXFA_FFText>(
186 m_pDoc->GetHeap()->GetAllocationHandle(), pNode);
188 case XFA_FFWidgetType::kImage:
189 pWidget = cppgc::MakeGarbageCollected<CXFA_FFImage>(
190 m_pDoc->GetHeap()->GetAllocationHandle(), pNode);
192 case XFA_FFWidgetType::kSubform:
193 pWidget = cppgc::MakeGarbageCollected<CXFA_FFWidget>(
194 m_pDoc->GetHeap()->GetAllocationHandle(), pNode);
196 case XFA_FFWidgetType::kExclGroup:
197 pWidget = cppgc::MakeGarbageCollected<CXFA_FFExclGroup>(
198 m_pDoc->GetHeap()->GetAllocationHandle(), pNode);
203 auto* pLayout = CXFA_LayoutProcessor::FromDocument(m_pDoc->GetXFADoc());
204 pWidget->SetDocView(m_pDoc->GetDocView(pLayout));
210 float* pCalcHeight) {
211 pItem->StartWidgetLayout(m_pDoc.Get(), pCalcWidth, pCalcHeight);
237 bIsFormReady
, bRecursive
);
250 return m_pDoc->GetApp()->GetAppProvider();
267 auto* pDocLayout = CXFA_LayoutProcessor::FromDocument(m_pDoc->GetXFADoc());
371 CXFA_FFWidget* pWidget = m_pDoc->GetDocView()->GetWidgetForNode(pSender);
394 bool bUpdateProperty =
false;
407 bUpdateProperty =
true;
413 bUpdateProperty =
true;
417 if (eType ==
XFA_Element::Value || bIsContainerNode) {
418 if (bIsContainerNode) {
419 m_pDoc->GetDocView()->UpdateUIDisplay(pWidgetNode,
nullptr);
422 }
else if (pWidgetNode->GetParent()->GetElementType() ==
424 m_pDoc->GetDocView()->UpdateUIDisplay(pWidgetNode,
nullptr);
430 CXFA_FFWidget* pWidget = m_pDoc->GetDocView()->GetWidgetForNode(pWidgetNode);
443 m_pDoc->GetXFADoc()->GetLayoutProcessor()->SetHasChangedContainer();
454 const bool bLayoutReady =
458 m_pDoc->SetChangeMark();
466 const bool bLayoutReady =
470 m_pDoc->SetChangeMark();
487 XFA_WidgetStatus::kViewable,
488 XFA_WidgetStatus::kPrintable};
491 if (pPrePageView != pNewPageView ||
495 m_pDoc->WidgetPostAdd(pWidget);
521 m_pDoc->WidgetPreRemove(pWidget);
friend bool operator!=(const CFX_RectF &rc1, const CFX_RectF &rc2)
static CXFA_Barcode * FromNode(CXFA_Node *pNode)
CXFA_EventParam(XFA_EVENTTYPE type)
CXFA_FFWidgetHandler * GetWidgetHandler()
LayoutStatus GetLayoutStatus() const
void AddValidateNode(CXFA_Node *node)
void ResetNode(CXFA_Node *pNode)
void AddCalculateNodeNotify(CXFA_Node *pNodeChange)
bool InLayoutStatus() const
CXFA_Node * GetFocusNode() const
void DeleteLayoutItem(CXFA_FFWidget *pWidget)
void AddNewFormNode(CXFA_Node *pNode)
void AddBindItem(CXFA_BindItems *item)
void OnPageViewEvent(CXFA_ViewLayoutItem *pSender, CXFA_FFDoc::PageViewEvent eEvent)
CXFA_FFPageView * GetPageView(int32_t nIndex) const
void SetFocusNode(CXFA_Node *pNode)
void AddCalculateNode(CXFA_Node *node)
XFA_EventError ExecEventActivityByDeepFirst(CXFA_Node *pFormNode, XFA_EVENTTYPE eEventType, bool bIsFormReady, bool bRecursive)
void AddIndexChangedSubform(CXFA_Subform *pNode)
void SetFocusWidget(CXFA_FFWidget *hWidget)
virtual void DeleteItem(int32_t nIndex)=0
virtual void InsertItem(const WideString &wsLabel, int32_t nIndex)=0
void OnValueChanged(CXFA_Node *pSender, XFA_Attribute eAttr, CXFA_Node *pParentNode, CXFA_Node *pWidgetNode)
CXFA_FFPageView * OnCreateViewLayoutItem(CXFA_Node *pNode)
CXFA_FFDocView::LayoutStatus GetLayoutStatus()
void OnLayoutItemAdded(CXFA_LayoutProcessor *pLayout, CXFA_LayoutItem *pSender, int32_t iPageIdx, Mask< XFA_WidgetStatus > dwStatus)
void OnValueChanging(CXFA_Node *pSender, XFA_Attribute eAttr)
void Trace(cppgc::Visitor *visitor) const
void OnWidgetListItemRemoved(CXFA_Node *pSender, int32_t iIndex)
void OnNodeReady(CXFA_Node *pNode)
void ResetData(CXFA_Node *pNode)
void SetFocusWidgetNode(CXFA_Node *pNode)
void OnChildAdded(CXFA_Node *pSender)
void OnWidgetListItemAdded(CXFA_Node *pSender, const WideString &wsLabel, int32_t iIndex)
void HandleWidgetEvent(CXFA_Node *pNode, CXFA_EventParam *pParam)
void StartFieldDrawLayout(CXFA_Node *pItem, float *pCalcWidth, float *pCalcHeight)
void AddCalcValidate(CXFA_Node *pNode)
bool RunScript(CXFA_Script *pScript, CXFA_Node *pFormItem)
CXFA_FFDoc * GetFFDoc() const
CXFA_FFApp::CallbackIface * GetAppProvider()
CXFA_Node * GetFocusWidgetNode()
XFA_EventError ExecEventByDeepFirst(CXFA_Node *pFormNode, XFA_EVENTTYPE eEventType, bool bIsFormReady, bool bRecursive)
CXFA_FFWidget * OnCreateContentLayoutItem(CXFA_Node *pNode)
void OnPageViewEvent(CXFA_ViewLayoutItem *pSender, CXFA_FFDoc::PageViewEvent eEvent)
void OpenDropDownList(CXFA_Node *pNode)
void RunNodeInitialize(CXFA_Node *pNode)
void OnContainerChanged()
void OnLayoutItemRemoving(CXFA_LayoutProcessor *pLayout, CXFA_LayoutItem *pSender)
void RunSubformIndexChange(CXFA_Subform *pSubformNode)
bool IsFormContainer() const
void SetFlag(XFA_NodeFlag dwFlag)
CXFA_TextLayout * GetCaptionTextLayout()
BoolScriptResult ExecuteBoolScript(CXFA_FFDocView *pDocView, CXFA_Script *script, CXFA_EventParam *pEventParam)
CXFA_Node * GetUIChildNode()
XFA_PacketType GetPacketType() const
XFA_FFWidgetType GetFFWidgetType()
XFA_Element GetElementType() const
bool HasCreatedUIWidget() const
bool IsContainerNode() const
static CXFA_PasswordEdit * FromNode(CXFA_Node *pNode)
CXFA_FFComboBox * ToComboBox(CXFA_FFDropDown *pDropDown)
CXFA_FFDropDown * ToDropDown(CXFA_FFField *field)
XFA_EventError xfa_event_result