1 // Copyright 2014 PDFium Authors. All rights reserved. 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 #ifndef XFA_FXFA_APP_XFA_FFNOTIFY_H_ 8 #define XFA_FXFA_APP_XFA_FFNOTIFY_H_ 9 10 #include "xfa/fxfa/cxfa_eventparam.h" 11 #include "xfa/fxfa/parser/cxfa_document.h" 12 13 class CXFA_FFWidgetHandler; 14 15 class CXFA_FFNotify { 16 public: 17 explicit CXFA_FFNotify(CXFA_FFDoc* pDoc); 18 ~CXFA_FFNotify(); 19 20 void OnPageEvent(CXFA_ContainerLayoutItem* pSender, uint32_t dwEvent); 21 22 void OnWidgetListItemAdded(CXFA_WidgetData* pSender, 23 const FX_WCHAR* pLabel, 24 const FX_WCHAR* pValue, 25 int32_t iIndex); 26 void OnWidgetListItemRemoved(CXFA_WidgetData* pSender, int32_t iIndex); 27 28 // Node events 29 void OnNodeReady(CXFA_Node* pNode); 30 void OnValueChanging(CXFA_Node* pSender, XFA_ATTRIBUTE eAttr); 31 void OnValueChanged(CXFA_Node* pSender, 32 XFA_ATTRIBUTE eAttr, 33 CXFA_Node* pParentNode, 34 CXFA_Node* pWidgetNode); 35 void OnChildAdded(CXFA_Node* pSender); 36 void OnChildRemoved(); 37 38 CXFA_LayoutItem* OnCreateLayoutItem(CXFA_Node* pNode); 39 void OnLayoutItemAdded(CXFA_LayoutProcessor* pLayout, 40 CXFA_LayoutItem* pSender, 41 int32_t iPageIdx, 42 uint32_t dwStatus); 43 void OnLayoutItemRemoving(CXFA_LayoutProcessor* pLayout, 44 CXFA_LayoutItem* pSender); 45 46 void StartFieldDrawLayout(CXFA_Node* pItem, 47 FX_FLOAT& fCalcWidth, 48 FX_FLOAT& fCalcHeight); 49 bool FindSplitPos(CXFA_Node* pItem, 50 int32_t iBlockIndex, 51 FX_FLOAT& fCalcHeightPos); 52 bool RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem); 53 int32_t ExecEventByDeepFirst(CXFA_Node* pFormNode, 54 XFA_EVENTTYPE eEventType, 55 bool bIsFormReady = false, 56 bool bRecursive = true, 57 CXFA_WidgetAcc* pExclude = nullptr); 58 void AddCalcValidate(CXFA_Node* pNode); 59 CXFA_FFDoc* GetHDOC(); 60 IXFA_DocEnvironment* GetDocEnvironment() const; 61 IXFA_AppProvider* GetAppProvider(); 62 CXFA_FFWidgetHandler* GetWidgetHandler(); 63 CXFA_FFWidget* GetHWidget(CXFA_LayoutItem* pLayoutItem); 64 void OpenDropDownList(CXFA_FFWidget* hWidget); 65 CFX_WideString GetCurrentDateTime(); 66 void ResetData(CXFA_WidgetData* pWidgetData = nullptr); 67 int32_t GetLayoutStatus(); 68 void RunNodeInitialize(CXFA_Node* pNode); 69 void RunSubformIndexChange(CXFA_Node* pSubformNode); 70 CXFA_Node* GetFocusWidgetNode(); 71 void SetFocusWidgetNode(CXFA_Node* pNode); 72 73 private: 74 CXFA_FFDoc* const m_pDoc; 75 }; 76 77 #endif // XFA_FXFA_APP_XFA_FFNOTIFY_H_ 78