summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_ffnotify.h
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-04-14 18:29:56 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-14 18:29:56 -0700
commitb1a59597db4b8ce3ffc34dbfda2fb1ecb80c2397 (patch)
tree4bef693fc2b5722a86d75ee6110da8c9d5530f6d /xfa/fxfa/app/xfa_ffnotify.h
parentb1c80fb8b843a2a345b2cd6005e591dc731355f4 (diff)
downloadpdfium-b1a59597db4b8ce3ffc34dbfda2fb1ecb80c2397.tar.xz
Simplify XFA event handling.
- Avoid casting to void* - Don't bother firing events that no one listens for Review URL: https://codereview.chromium.org/1890563003
Diffstat (limited to 'xfa/fxfa/app/xfa_ffnotify.h')
-rw-r--r--xfa/fxfa/app/xfa_ffnotify.h73
1 files changed, 24 insertions, 49 deletions
diff --git a/xfa/fxfa/app/xfa_ffnotify.h b/xfa/fxfa/app/xfa_ffnotify.h
index 6bf39ee6d2..6dd400859b 100644
--- a/xfa/fxfa/app/xfa_ffnotify.h
+++ b/xfa/fxfa/app/xfa_ffnotify.h
@@ -16,27 +16,31 @@ class CXFA_FFNotify {
CXFA_FFNotify(CXFA_FFDoc* pDoc);
~CXFA_FFNotify();
- void OnPageEvent(CXFA_ContainerLayoutItem* pSender,
- XFA_PAGEEVENT eEvent,
- void* pParam = NULL);
+ void OnPageEvent(CXFA_ContainerLayoutItem* pSender, uint32_t dwEvent);
+
+ void OnWidgetListItemAdded(CXFA_WidgetData* pSender,
+ const FX_WCHAR* pLabel,
+ const FX_WCHAR* pValue,
+ int32_t iIndex);
+ void OnWidgetListItemRemoved(CXFA_WidgetData* pSender, int32_t iIndex);
+
+ // Node events
+ void OnNodeReady(CXFA_Node* pNode);
+ void OnValueChanging(CXFA_Node* pSender, XFA_ATTRIBUTE eAttr);
+ void OnValueChanged(CXFA_Node* pSender,
+ XFA_ATTRIBUTE eAttr,
+ CXFA_Node* pParentNode,
+ CXFA_Node* pWidgetNode);
+ void OnChildAdded(CXFA_Node* pSender);
+ void OnChildRemoved();
- void OnNodeEvent(CXFA_Node* pSender,
- XFA_NODEEVENT eEvent,
- void* pParam = NULL,
- void* pParam2 = NULL,
- void* pParam3 = NULL,
- void* pParam4 = NULL);
- void OnWidgetDataEvent(CXFA_WidgetData* pSender,
- uint32_t dwEvent,
- void* pParam = NULL,
- void* pAdditional = NULL,
- void* pAdditional2 = NULL);
CXFA_LayoutItem* OnCreateLayoutItem(CXFA_Node* pNode);
- void OnLayoutEvent(CXFA_LayoutProcessor* pLayout,
- CXFA_LayoutItem* pSender,
- XFA_LAYOUTEVENT eEvent,
- void* pParam = NULL,
- void* pParam2 = NULL);
+ void OnLayoutItemAdded(CXFA_LayoutProcessor* pLayout,
+ CXFA_LayoutItem* pSender,
+ int32_t iPageIdx,
+ uint32_t dwStatus);
+ void OnLayoutItemRemoving(CXFA_LayoutProcessor* pLayout,
+ CXFA_LayoutItem* pSender);
void StartFieldDrawLayout(CXFA_Node* pItem,
FX_FLOAT& fCalcWidth,
@@ -66,36 +70,7 @@ class CXFA_FFNotify {
void SetFocusWidgetNode(CXFA_Node* pNode);
protected:
- void OnNodeReady(CXFA_Node* pNode);
- void OnValueChanging(CXFA_Node* pSender, void* pParam, void* pParam2);
- void OnValueChanged(CXFA_Node* pSender,
- void* pParam,
- void* pParam2,
- void* pParam3,
- void* pParam4);
- void OnChildAdded(CXFA_Node* pSender, void* pParam, void* pParam2);
- void OnChildRemoved(CXFA_Node* pSender, void* pParam, void* pParam2);
- void OnLayoutItemAdd(CXFA_FFDocView* pDocView,
- CXFA_LayoutProcessor* pLayout,
- CXFA_LayoutItem* pSender,
- void* pParam,
- void* pParam2);
- void OnLayoutItemRemoving(CXFA_FFDocView* pDocView,
- CXFA_LayoutProcessor* pLayout,
- CXFA_LayoutItem* pSender,
- void* pParam,
- void* pParam2);
- void OnLayoutItemRectChanged(CXFA_FFDocView* pDocView,
- CXFA_LayoutProcessor* pLayout,
- CXFA_LayoutItem* pSender,
- void* pParam,
- void* pParam2);
- void OnLayoutItemStatustChanged(CXFA_FFDocView* pDocView,
- CXFA_LayoutProcessor* pLayout,
- CXFA_LayoutItem* pSender,
- void* pParam,
- void* pParam2);
- CXFA_FFDoc* m_pDoc;
+ CXFA_FFDoc* const m_pDoc;
};
#endif // XFA_FXFA_APP_XFA_FFNOTIFY_H_