Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 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 | |
weili | 625ad66 | 2016-06-15 11:21:33 -0700 | [diff] [blame] | 10 | #include "xfa/fxfa/include/cxfa_eventparam.h" |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 11 | #include "xfa/fxfa/parser/xfa_document.h" |
| 12 | |
dsinclair | df4bc59 | 2016-03-31 20:34:43 -0700 | [diff] [blame] | 13 | class CXFA_FFWidgetHandler; |
| 14 | |
| 15 | class CXFA_FFNotify { |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 16 | public: |
| 17 | CXFA_FFNotify(CXFA_FFDoc* pDoc); |
| 18 | ~CXFA_FFNotify(); |
| 19 | |
thestig | b1a5959 | 2016-04-14 18:29:56 -0700 | [diff] [blame] | 20 | void OnPageEvent(CXFA_ContainerLayoutItem* pSender, uint32_t dwEvent); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 21 | |
thestig | b1a5959 | 2016-04-14 18:29:56 -0700 | [diff] [blame] | 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 | |
dsinclair | df4bc59 | 2016-03-31 20:34:43 -0700 | [diff] [blame] | 38 | CXFA_LayoutItem* OnCreateLayoutItem(CXFA_Node* pNode); |
thestig | b1a5959 | 2016-04-14 18:29:56 -0700 | [diff] [blame] | 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); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 45 | |
dsinclair | df4bc59 | 2016-03-31 20:34:43 -0700 | [diff] [blame] | 46 | void StartFieldDrawLayout(CXFA_Node* pItem, |
| 47 | FX_FLOAT& fCalcWidth, |
| 48 | FX_FLOAT& fCalcHeight); |
| 49 | FX_BOOL FindSplitPos(CXFA_Node* pItem, |
| 50 | int32_t iBlockIndex, |
| 51 | FX_FLOAT& fCalcHeightPos); |
| 52 | FX_BOOL RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem); |
| 53 | int32_t ExecEventByDeepFirst(CXFA_Node* pFormNode, |
| 54 | XFA_EVENTTYPE eEventType, |
| 55 | FX_BOOL bIsFormReady = FALSE, |
| 56 | FX_BOOL bRecursive = TRUE, |
dsinclair | 85d1f2c | 2016-06-23 12:40:16 -0700 | [diff] [blame] | 57 | CXFA_WidgetAcc* pExclude = nullptr); |
dsinclair | df4bc59 | 2016-03-31 20:34:43 -0700 | [diff] [blame] | 58 | void AddCalcValidate(CXFA_Node* pNode); |
| 59 | CXFA_FFDoc* GetHDOC(); |
| 60 | IXFA_DocProvider* GetDocProvider(); |
| 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(); |
dsinclair | 85d1f2c | 2016-06-23 12:40:16 -0700 | [diff] [blame] | 66 | void ResetData(CXFA_WidgetData* pWidgetData = nullptr); |
dsinclair | df4bc59 | 2016-03-31 20:34:43 -0700 | [diff] [blame] | 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); |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 72 | |
| 73 | protected: |
thestig | b1a5959 | 2016-04-14 18:29:56 -0700 | [diff] [blame] | 74 | CXFA_FFDoc* const m_pDoc; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 75 | }; |
| 76 | |
| 77 | #endif // XFA_FXFA_APP_XFA_FFNOTIFY_H_ |