summaryrefslogtreecommitdiff
path: root/fpdfsdk/include/formfiller/FFL_Notify.h
blob: 8a9c04c5dfa22cae8a5fa79519334409aed6694f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_NOTIFY_H_
#define FPDFSDK_INCLUDE_FORMFILLER_FFL_NOTIFY_H_

#include "../../../core/include/fpdfdoc/fpdf_doc.h"
#include "../../../core/include/fxcrt/fx_string.h"

class CFFL_FormFiller;
class CPDF_FormField;

class CFFL_Notify
{
public:
	CFFL_Notify(CFFL_FormFiller * pFormFiller);
	virtual ~CFFL_Notify();

public:
	bool									OnSetFocus(bool & bExit);
	bool									OnMouseEnter(bool & bExit);
	bool									OnMouseDown(bool & bExit);
	bool									OnMouseUp(bool & bExit);
	bool									OnMouseExit(bool & bExit);
	bool									OnKillFocus(bool & bExit);

	bool									OnCalculate();
	bool									OnFormat(int iCommitKey);
	bool									OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange,
											   const CFX_WideString& strChangeEx, bool bKeyDown, bool bModifier,
											   bool bShift, bool & bRC);
	bool									OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange,
											   const CFX_WideString& strChangeEx, bool bKeyDown, bool bModifier,
											   bool bShift, bool bWillCommit, bool bFieldFull,
											   int& nSelStart, int& nSelEnd, bool& bRC);

	void									BeforeNotify();
	void									AfterNotify();
	bool									IsNotifying() const {return m_nNotifyFlag > 0;}

private:
 	bool									DoAAction(CPDF_AAction::AActionType eAAT, bool & bExit);
 	bool									FindAAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action);
 	bool									FindAAction(CPDF_AAction aaction,CPDF_AAction::AActionType eAAT,CPDF_Action & action);
 	bool									ExecuteActionTree(CPDF_AAction::AActionType eAAT, CPDF_Action & action, bool& bExit);
 	bool									ExecuteAction(CPDF_AAction::AActionType eAAT,CPDF_Action & action,bool& bExit);

	bool									m_bDoActioning;
	int32_t								m_nNotifyFlag;
};

#endif  // FPDFSDK_INCLUDE_FORMFILLER_FFL_NOTIFY_H_