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 #if !defined(_FFL_NOTIFY_H_) 8 #define _FFL_NOTIFY_H_ 9 10 class CFFL_FormFiller; 11 12 class CFFL_Notify 13 { 14 public: 15 CFFL_Notify(CFFL_FormFiller * pFormFiller); 16 virtual ~CFFL_Notify(); 17 18 public: 19 FX_BOOL OnSetFocus(FX_BOOL & bExit); 20 FX_BOOL OnMouseEnter(FX_BOOL & bExit); 21 FX_BOOL OnMouseDown(FX_BOOL & bExit); 22 FX_BOOL OnMouseUp(FX_BOOL & bExit); 23 FX_BOOL OnMouseExit(FX_BOOL & bExit); 24 FX_BOOL OnKillFocus(FX_BOOL & bExit); 25 26 FX_BOOL OnCalculate(); 27 FX_BOOL OnFormat(int iCommitKey); 28 FX_BOOL OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange, 29 const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier, 30 FX_BOOL bShift, FX_BOOL & bRC); 31 FX_BOOL OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange, 32 const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier, 33 FX_BOOL bShift, FX_BOOL bWillCommit, FX_BOOL bFieldFull, 34 int& nSelStart, int& nSelEnd, FX_BOOL& bRC); 35 36 void BeforeNotify(); 37 void AfterNotify(); IsNotifying()38 FX_BOOL IsNotifying() const {return m_nNotifyFlag > 0;} 39 40 private: 41 // CReader_InterForm * GetReaderInterForm(); 42 FX_BOOL DoAAction(CPDF_AAction::AActionType eAAT, FX_BOOL & bExit); 43 FX_BOOL FindAAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action); 44 FX_BOOL FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAAT,CPDF_Action & action); 45 FX_BOOL ExecuteActionTree(CPDF_AAction::AActionType eAAT, CPDF_Action & action, FX_BOOL& bExit); 46 FX_BOOL ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,FX_BOOL& bExit); 47 48 CFFL_FormFiller * m_pFormFiller; 49 FX_BOOL m_bDoActioning; 50 FX_INT32 m_nNotifyFlag; 51 }; 52 53 #endif 54 55