• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef XFA_FXFA_PARSER_CSCRIPT_EVENTPSEUDOMODEL_H_
8 #define XFA_FXFA_PARSER_CSCRIPT_EVENTPSEUDOMODEL_H_
9 
10 #include "fxjs/cfxjse_arguments.h"
11 #include "xfa/fxfa/parser/xfa_object.h"
12 
13 enum class XFA_Event {
14   Change = 0,
15   CommitKey,
16   FullText,
17   Keydown,
18   Modifier,
19   NewContentType,
20   NewText,
21   PreviousContentType,
22   PreviousText,
23   Reenter,
24   SelectionEnd,
25   SelectionStart,
26   Shift,
27   SoapFaultCode,
28   SoapFaultString,
29   Target,
30   CancelAction
31 };
32 
33 class CScript_EventPseudoModel : public CXFA_Object {
34  public:
35   explicit CScript_EventPseudoModel(CXFA_Document* pDocument);
36   ~CScript_EventPseudoModel() override;
37 
38   void Change(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
39   void CommitKey(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
40   void FullText(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
41   void KeyDown(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
42   void Modifier(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
43   void NewContentType(CFXJSE_Value* pValue,
44                       bool bSetting,
45                       XFA_ATTRIBUTE eAttribute);
46   void NewText(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
47   void PrevContentType(CFXJSE_Value* pValue,
48                        bool bSetting,
49                        XFA_ATTRIBUTE eAttribute);
50   void PrevText(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
51   void Reenter(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
52   void SelEnd(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
53   void SelStart(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
54   void Shift(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
55   void SoapFaultCode(CFXJSE_Value* pValue,
56                      bool bSetting,
57                      XFA_ATTRIBUTE eAttribute);
58   void SoapFaultString(CFXJSE_Value* pValue,
59                        bool bSetting,
60                        XFA_ATTRIBUTE eAttribute);
61   void Target(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
62 
63   void Emit(CFXJSE_Arguments* pArguments);
64   void Reset(CFXJSE_Arguments* pArguments);
65 
66  protected:
67   void Property(CFXJSE_Value* pValue, XFA_Event dwFlag, bool bSetting);
68 };
69 
70 #endif  // XFA_FXFA_PARSER_CSCRIPT_EVENTPSEUDOMODEL_H_
71