OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_FXFA_PARSER_XFA_SCRIPT_H_ | 7 #ifndef XFA_FXFA_PARSER_XFA_SCRIPT_H_ |
8 #define XFA_FXFA_PARSER_XFA_SCRIPT_H_ | 8 #define XFA_FXFA_PARSER_XFA_SCRIPT_H_ |
9 | 9 |
10 #include "xfa/include/fxfa/fxfa.h" | 10 #include "xfa/include/fxfa/fxfa.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 const XFA_SCRIPTATTRIBUTEINFO* pScriptAttribute; | 75 const XFA_SCRIPTATTRIBUTEINFO* pScriptAttribute; |
76 }; | 76 }; |
77 | 77 |
78 struct XFA_JSBUILTININFO { | 78 struct XFA_JSBUILTININFO { |
79 uint32_t uUnicodeHash; | 79 uint32_t uUnicodeHash; |
80 const FX_CHAR* pName; | 80 const FX_CHAR* pName; |
81 }; | 81 }; |
82 | 82 |
83 const XFA_JSBUILTININFO* XFA_GetJSBuiltinByHash(uint32_t uHashCode); | 83 const XFA_JSBUILTININFO* XFA_GetJSBuiltinByHash(uint32_t uHashCode); |
84 | 84 |
85 class IXFA_ScriptContext { | |
86 public: | |
87 virtual ~IXFA_ScriptContext() {} | |
88 virtual void Release() = 0; | |
89 virtual void Initialize(FXJSE_HRUNTIME hRuntime) = 0; | |
90 | |
91 virtual void SetEventParam(CXFA_EventParam param) = 0; | |
92 virtual CXFA_EventParam* GetEventParam() = 0; | |
93 virtual FX_BOOL RunScript(XFA_SCRIPTLANGTYPE eScriptType, | |
94 const CFX_WideStringC& wsScript, | |
95 FXJSE_HVALUE hRetValue, | |
96 CXFA_Object* pThisObject = NULL) = 0; | |
97 virtual int32_t ResolveObjects(CXFA_Object* refNode, | |
98 const CFX_WideStringC& wsExpression, | |
99 XFA_RESOLVENODE_RS& resolveNodeRS, | |
100 uint32_t dwStyles = XFA_RESOLVENODE_Children, | |
101 CXFA_Node* bindNode = NULL) = 0; | |
102 virtual FXJSE_HVALUE GetJSValueFromMap(CXFA_Object* pObject) = 0; | |
103 virtual void CacheList(CXFA_NodeList* pList) = 0; | |
104 virtual CXFA_Object* GetThisObject() const = 0; | |
105 virtual FXJSE_HRUNTIME GetRuntime() const = 0; | |
106 virtual int32_t GetIndexByName(CXFA_Node* refNode) = 0; | |
107 virtual int32_t GetIndexByClassName(CXFA_Node* refNode) = 0; | |
108 virtual void GetSomExpression(CXFA_Node* refNode, | |
109 CFX_WideString& wsExpression) = 0; | |
110 | |
111 virtual void SetNodesOfRunScript(CXFA_NodeArray* pArray) = 0; | |
112 virtual void AddNodesOfRunScript(const CXFA_NodeArray& nodes) = 0; | |
113 virtual void AddNodesOfRunScript(CXFA_Node* pNode) = 0; | |
114 virtual FXJSE_HCLASS GetJseNormalClass() = 0; | |
115 virtual XFA_SCRIPTLANGTYPE GetType() = 0; | |
116 virtual void SetRunAtType(XFA_ATTRIBUTEENUM eRunAt) = 0; | |
117 virtual FX_BOOL IsRunAtClient() = 0; | |
118 }; | |
119 IXFA_ScriptContext* XFA_ScriptContext_Create(CXFA_Document* pDocument); | |
120 | |
121 #endif // XFA_FXFA_PARSER_XFA_SCRIPT_H_ | 85 #endif // XFA_FXFA_PARSER_XFA_SCRIPT_H_ |
OLD | NEW |