Merge to XFA: Return error information from pdfium to JS.
[pdfium.git] / fpdfsdk / include / javascript / IJavaScript.h
index 7754537..b0e21c9 100644 (file)
@@ -7,17 +7,21 @@
 #ifndef _IJAVASCRIPT_H_
 #define _IJAVASCRIPT_H_
 
-namespace v8 {
-class Platform;
-}
+#include "../../../core/include/fxcrt/fx_basic.h"
+#include "../../../xfa/include/fxjse/fxjse.h"
 
-class IFXJS_Context  
+class CPDF_Bookmark;
+class CPDF_FormField;
+class CPDFSDK_Annot;
+class CPDFSDK_Document;
+
+class IFXJS_Context
 {
 public:
+        virtual ~IFXJS_Context() { }
        virtual FX_BOOL                         Compile(const CFX_WideString& script, CFX_WideString& info) = 0;
        virtual FX_BOOL                         RunScript(const CFX_WideString& script, CFX_WideString& info) = 0;
 
-public:
        virtual void                            OnApp_Init() = 0;
 
        virtual void                            OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString& strTargetName) = 0;
@@ -31,7 +35,7 @@ public:
        virtual void                            OnPage_Close(CPDFSDK_Document* pTarget) = 0;
        virtual void                            OnPage_InView(CPDFSDK_Document* pTarget) = 0;
        virtual void                            OnPage_OutView(CPDFSDK_Document* pTarget) = 0;
-       
+
        virtual void                            OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
        virtual void                            OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
        virtual void                            OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) = 0;
@@ -78,18 +82,14 @@ public:
        virtual IFXJS_Context*          GetCurrentContext() = 0;
 
        virtual void                            SetReaderDocument(CPDFSDK_Document* pReaderDoc) = 0;
-       virtual CPDFSDK_Document*       GetReaderDocument() = 0;        
 
-       virtual void                            GetObjectNames(CFX_WideStringArray& array) = 0;
-       virtual void                            GetObjectConsts(const CFX_WideString& swObjName, CFX_WideStringArray& array) = 0;
-       virtual void                            GetObjectProps(const CFX_WideString& swObjName, CFX_WideStringArray& array) = 0;
-       virtual void                            GetObjectMethods(const CFX_WideString& swObjName, CFX_WideStringArray& array) = 0;
+       virtual CPDFSDK_Document*       GetReaderDocument() = 0;
 
-       virtual void                            Exit() = 0;
-       virtual void                            Enter() = 0;
-       virtual FX_BOOL                         IsEntered() = 0;
        virtual FX_BOOL                         GetHValueByName(FX_BSTR utf8Name, FXJSE_HVALUE hValue) = 0;
        virtual FX_BOOL                         SetHValueByName(FX_BSTR utf8Name, FXJSE_HVALUE hValue) = 0;
+
+protected:
+         ~IFXJS_Runtime() { }
 };
 
 class CPDFDoc_Environment;
@@ -98,7 +98,7 @@ class CJS_GlobalData;
 class CJS_RuntimeFactory
 {
 public:
-       CJS_RuntimeFactory():m_bInit(FALSE),m_nRef(0),m_pGlobalData(NULL),m_nGlobalDataCount(0),m_platform(NULL) {}
+       CJS_RuntimeFactory():m_bInit(FALSE),m_nRef(0),m_pGlobalData(NULL),m_nGlobalDataCount(0) {}
        ~CJS_RuntimeFactory();
        IFXJS_Runtime*                                  NewJSRuntime(CPDFDoc_Environment* pApp);
        void                                                    DeleteJSRuntime(IFXJS_Runtime* pRuntime);
@@ -112,7 +112,6 @@ private:
        int m_nRef;
        CJS_GlobalData*                                 m_pGlobalData;
        FX_INT32                                                m_nGlobalDataCount;
-        v8::Platform*                                          m_platform;
 };
 
 #endif //_IJAVASCRIPT_H_