1 // Copyright 2016 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_CXFA_EVENTPARAM_H_
8 #define XFA_FXFA_CXFA_EVENTPARAM_H_
9 
10 #include "core/fxcrt/fx_string.h"
11 #include "core/fxcrt/unowned_ptr.h"
12 #include "xfa/fxfa/fxfa_basic.h"
13 
14 class CXFA_Node;
15 
16 enum XFA_EVENTTYPE : uint8_t {
17   XFA_EVENT_Click,
18   XFA_EVENT_Change,
19   XFA_EVENT_DocClose,
20   XFA_EVENT_DocReady,
21   XFA_EVENT_Enter,
22   XFA_EVENT_Exit,
23   XFA_EVENT_Full,
24   XFA_EVENT_IndexChange,
25   XFA_EVENT_Initialize,
26   XFA_EVENT_MouseDown,
27   XFA_EVENT_MouseEnter,
28   XFA_EVENT_MouseExit,
29   XFA_EVENT_MouseUp,
30   XFA_EVENT_PostExecute,
31   XFA_EVENT_PostOpen,
32   XFA_EVENT_PostPrint,
33   XFA_EVENT_PostSave,
34   XFA_EVENT_PostSign,
35   XFA_EVENT_PostSubmit,
36   XFA_EVENT_PreExecute,
37   XFA_EVENT_PreOpen,
38   XFA_EVENT_PrePrint,
39   XFA_EVENT_PreSave,
40   XFA_EVENT_PreSign,
41   XFA_EVENT_PreSubmit,
42   XFA_EVENT_Ready,
43   XFA_EVENT_InitCalculate,
44   XFA_EVENT_InitVariables,
45   XFA_EVENT_Calculate,
46   XFA_EVENT_Validate,
47   XFA_EVENT_Unknown,
48 };
49 
50 class CXFA_EventParam {
51  public:
52   CXFA_EventParam();
53   CXFA_EventParam(const CXFA_EventParam& other);
54   ~CXFA_EventParam();
55 
56   CXFA_EventParam& operator=(const CXFA_EventParam& other);
57   CXFA_EventParam& operator=(CXFA_EventParam&& other);
58 
59   WideString GetNewText() const;
60 
61   XFA_EVENTTYPE m_eType = XFA_EVENT_Unknown;
62   bool m_bCancelAction = false;
63   bool m_bKeyDown = false;
64   bool m_bModifier = false;
65   bool m_bReenter = false;
66   bool m_bShift = false;
67   bool m_bIsFormReady = false;
68   int32_t m_iCommitKey = 0;
69   int32_t m_iSelEnd = 0;
70   int32_t m_iSelStart = 0;
71   UnownedPtr<CXFA_Node> m_pTarget;
72   WideString m_wsResult;
73   WideString m_wsChange;
74   WideString m_wsFullText;
75   WideString m_wsNewContentType;
76   WideString m_wsPrevContentType;
77   WideString m_wsPrevText;
78   WideString m_wsSoapFaultCode;
79   WideString m_wsSoapFaultString;
80 };
81 
82 #endif  // XFA_FXFA_CXFA_EVENTPARAM_H_
83