1 // Copyright 2017 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 FXJS_XFA_CJX_EVENTPSEUDOMODEL_H_ 8 #define FXJS_XFA_CJX_EVENTPSEUDOMODEL_H_ 9 10 #include "fxjs/xfa/cjx_object.h" 11 #include "fxjs/xfa/jse_define.h" 12 13 class CFXJSE_Value; 14 class CScript_EventPseudoModel; 15 16 enum class XFA_Event { 17 Change = 0, 18 CommitKey, 19 FullText, 20 Keydown, 21 Modifier, 22 NewContentType, 23 NewText, 24 PreviousContentType, 25 PreviousText, 26 Reenter, 27 SelectionEnd, 28 SelectionStart, 29 Shift, 30 SoapFaultCode, 31 SoapFaultString, 32 Target, 33 CancelAction 34 }; 35 36 class CJX_EventPseudoModel final : public CJX_Object { 37 public: 38 explicit CJX_EventPseudoModel(CScript_EventPseudoModel* model); 39 ~CJX_EventPseudoModel() override; 40 41 // CJX_Object: 42 bool DynamicTypeIs(TypeTag eType) const override; 43 44 JSE_METHOD(emit); 45 JSE_METHOD(reset); 46 47 JSE_PROP(cancelAction); 48 JSE_PROP(change); 49 JSE_PROP(commitKey); 50 JSE_PROP(fullText); 51 JSE_PROP(keyDown); 52 JSE_PROP(modifier); 53 JSE_PROP(newContentType); 54 JSE_PROP(newText); 55 JSE_PROP(prevContentType); 56 JSE_PROP(prevText); 57 JSE_PROP(reenter); 58 JSE_PROP(selEnd); 59 JSE_PROP(selStart); 60 JSE_PROP(shift); 61 JSE_PROP(soapFaultCode); 62 JSE_PROP(soapFaultString); 63 JSE_PROP(target); 64 65 private: 66 using Type__ = CJX_EventPseudoModel; 67 using ParentType__ = CJX_Object; 68 69 static const TypeTag static_type__ = TypeTag::EventPseudoModel; 70 static const CJX_MethodSpec MethodSpecs[]; 71 72 void Property(CFXJSE_Value* pValue, XFA_Event dwFlag, bool bSetting); 73 }; 74 75 #endif // FXJS_XFA_CJX_EVENTPSEUDOMODEL_H_ 76