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_FM2JS_API_H
8 #define _XFA_FM2JS_API_H
9 #define FOXIT_XFA_FM2JS_FORMCALC_RUNTIME "foxit_xfa_formcalc_runtime"
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 typedef struct XFA_HFM2JSCONTEXT_ { void** pData; } * XFA_HFM2JSCONTEXT;
14 int32_t XFA_FM2JS_Translate(const CFX_WideStringC& wsFormcalc,
15                             CFX_WideTextBuf& wsJavascript,
16                             CFX_WideString& wsError);
17 XFA_HFM2JSCONTEXT XFA_FM2JS_ContextCreate();
18 void XFA_FM2JS_ContextInitialize(XFA_HFM2JSCONTEXT hFM2JSContext,
19                                  FXJSE_HRUNTIME hScriptRuntime,
20                                  FXJSE_HCONTEXT hScriptContext,
21                                  CXFA_Document* pDocument);
22 void XFA_FM2JS_GlobalPropertyGetter(XFA_HFM2JSCONTEXT hFM2JSContext,
23                                     FXJSE_HVALUE hValue);
24 void XFA_FM2JS_ContextRelease(XFA_HFM2JSCONTEXT hFM2JSContext);
25 #ifdef __cplusplus
26 }
27 #endif
28 #endif
29