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