blob: 322caa3652499bdcae132cc40f6dcca044d5ff0e [file] [log] [blame]
Dan Sinclair1770c022016-03-14 14:14:16 -04001// 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
weili625ad662016-06-15 11:21:33 -070010#include "xfa/fxfa/include/cxfa_eventparam.h"
Dan Sinclair1770c022016-03-14 14:14:16 -040011#include "xfa/fxfa/parser/xfa_document.h"
12
dsinclairdf4bc592016-03-31 20:34:43 -070013class CXFA_FFWidgetHandler;
14
15class CXFA_FFNotify {
Dan Sinclair1770c022016-03-14 14:14:16 -040016 public:
17 CXFA_FFNotify(CXFA_FFDoc* pDoc);
18 ~CXFA_FFNotify();
19
thestigb1a59592016-04-14 18:29:56 -070020 void OnPageEvent(CXFA_ContainerLayoutItem* pSender, uint32_t dwEvent);
Dan Sinclair1770c022016-03-14 14:14:16 -040021
thestigb1a59592016-04-14 18:29:56 -070022 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
dsinclairdf4bc592016-03-31 20:34:43 -070038 CXFA_LayoutItem* OnCreateLayoutItem(CXFA_Node* pNode);
thestigb1a59592016-04-14 18:29:56 -070039 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 Sinclair1770c022016-03-14 14:14:16 -040045
dsinclairdf4bc592016-03-31 20:34:43 -070046 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,
dsinclair85d1f2c2016-06-23 12:40:16 -070057 CXFA_WidgetAcc* pExclude = nullptr);
dsinclairdf4bc592016-03-31 20:34:43 -070058 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();
dsinclair85d1f2c2016-06-23 12:40:16 -070066 void ResetData(CXFA_WidgetData* pWidgetData = nullptr);
dsinclairdf4bc592016-03-31 20:34:43 -070067 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 Sinclair1770c022016-03-14 14:14:16 -040072
73 protected:
thestigb1a59592016-04-14 18:29:56 -070074 CXFA_FFDoc* const m_pDoc;
Dan Sinclair1770c022016-03-14 14:14:16 -040075};
76
77#endif // XFA_FXFA_APP_XFA_FFNOTIFY_H_