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_CXFA_FFNOTIFY_H_ 8 #define XFA_FXFA_CXFA_FFNOTIFY_H_ 9 10 #include <memory> 11 12 #include "xfa/fxfa/cxfa_eventparam.h" 13 #include "xfa/fxfa/fxfa.h" 14 #include "xfa/fxfa/parser/cxfa_document.h" 15 16 class CXFA_ContentLayoutItem; 17 class CXFA_FFWidgetHandler; 18 class CXFA_LayoutItem; 19 class CXFA_LayoutProcessor; 20 class CXFA_Script; 21 class CXFA_ViewLayoutItem; 22 23 class CXFA_FFNotify { 24 public: 25 explicit CXFA_FFNotify(CXFA_FFDoc* pDoc); 26 ~CXFA_FFNotify(); 27 28 void OnPageEvent(CXFA_ViewLayoutItem* pSender, uint32_t dwEvent); 29 30 void OnWidgetListItemAdded(CXFA_Node* pSender, 31 const WideString& wsLabel, 32 int32_t iIndex); 33 void OnWidgetListItemRemoved(CXFA_Node* pSender, int32_t iIndex); 34 35 // Node events 36 void OnNodeReady(CXFA_Node* pNode); 37 void OnValueChanging(CXFA_Node* pSender, XFA_Attribute eAttr); 38 void OnValueChanged(CXFA_Node* pSender, 39 XFA_Attribute eAttr, 40 CXFA_Node* pParentNode, 41 CXFA_Node* pWidgetNode); 42 void OnContainerChanged(CXFA_Node* pNode); 43 void OnChildAdded(CXFA_Node* pSender); 44 void OnChildRemoved(); 45 46 std::unique_ptr<CXFA_FFPageView> OnCreateViewLayoutItem(CXFA_Node* pNode); 47 std::unique_ptr<CXFA_FFWidget> OnCreateContentLayoutItem(CXFA_Node* pNode); 48 49 void OnLayoutItemAdded(CXFA_LayoutProcessor* pLayout, 50 CXFA_LayoutItem* pSender, 51 int32_t iPageIdx, 52 uint32_t dwStatus); 53 void OnLayoutItemRemoving(CXFA_LayoutProcessor* pLayout, 54 CXFA_LayoutItem* pSender); 55 56 void StartFieldDrawLayout(CXFA_Node* pItem, 57 float* pCalcWidth, 58 float* pCalcHeight); 59 bool RunScript(CXFA_Script* pScript, CXFA_Node* pFormItem); 60 XFA_EventError ExecEventByDeepFirst(CXFA_Node* pFormNode, 61 XFA_EVENTTYPE eEventType, 62 bool bIsFormReady, 63 bool bRecursive); 64 void AddCalcValidate(CXFA_Node* pNode); GetHDOC()65 CXFA_FFDoc* GetHDOC() const { return m_pDoc.Get(); } 66 IXFA_AppProvider* GetAppProvider(); 67 CXFA_FFWidgetHandler* GetWidgetHandler(); 68 void OpenDropDownList(CXFA_Node* pNode); 69 void ResetData(CXFA_Node* pNode); 70 int32_t GetLayoutStatus(); 71 void RunNodeInitialize(CXFA_Node* pNode); 72 void RunSubformIndexChange(CXFA_Node* pSubformNode); 73 CXFA_Node* GetFocusWidgetNode(); 74 void SetFocusWidgetNode(CXFA_Node* pNode); 75 76 private: 77 UnownedPtr<CXFA_FFDoc> const m_pDoc; 78 }; 79 80 #endif // XFA_FXFA_CXFA_FFNOTIFY_H_ 81