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 FPDFSDK_JAVASCRIPT_GLOBAL_H_ | 7 #ifndef FPDFSDK_JAVASCRIPT_GLOBAL_H_ |
8 #define FPDFSDK_JAVASCRIPT_GLOBAL_H_ | 8 #define FPDFSDK_JAVASCRIPT_GLOBAL_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 29 matching lines...) Expand all Loading... |
40 CJS_Value& vRet, | 40 CJS_Value& vRet, |
41 CFX_WideString& sError); | 41 CFX_WideString& sError); |
42 FX_BOOL QueryProperty(const FX_WCHAR* propname); | 42 FX_BOOL QueryProperty(const FX_WCHAR* propname); |
43 FX_BOOL DoProperty(IJS_Context* cc, | 43 FX_BOOL DoProperty(IJS_Context* cc, |
44 const FX_WCHAR* propname, | 44 const FX_WCHAR* propname, |
45 CJS_PropValue& vp, | 45 CJS_PropValue& vp, |
46 CFX_WideString& sError); | 46 CFX_WideString& sError); |
47 FX_BOOL DelProperty(IJS_Context* cc, | 47 FX_BOOL DelProperty(IJS_Context* cc, |
48 const FX_WCHAR* propname, | 48 const FX_WCHAR* propname, |
49 CFX_WideString& sError); | 49 CFX_WideString& sError); |
50 void Initial(CPDFSDK_FormFillEnvironment* pEnv); | 50 void Initial(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
51 | 51 |
52 private: | 52 private: |
53 void UpdateGlobalPersistentVariables(); | 53 void UpdateGlobalPersistentVariables(); |
54 void CommitGlobalPersisitentVariables(IJS_Context* cc); | 54 void CommitGlobalPersisitentVariables(IJS_Context* cc); |
55 void DestroyGlobalPersisitentVariables(); | 55 void DestroyGlobalPersisitentVariables(); |
56 FX_BOOL SetGlobalVariables(const CFX_ByteString& propname, | 56 FX_BOOL SetGlobalVariables(const CFX_ByteString& propname, |
57 JS_GlobalDataType nType, | 57 JS_GlobalDataType nType, |
58 double dData, | 58 double dData, |
59 bool bData, | 59 bool bData, |
60 const CFX_ByteString& sData, | 60 const CFX_ByteString& sData, |
61 v8::Local<v8::Object> pData, | 61 v8::Local<v8::Object> pData, |
62 bool bDefaultPersistent); | 62 bool bDefaultPersistent); |
63 void ObjectToArray(IJS_Context* cc, | 63 void ObjectToArray(IJS_Context* cc, |
64 v8::Local<v8::Object> pObj, | 64 v8::Local<v8::Object> pObj, |
65 CJS_GlobalVariableArray& array); | 65 CJS_GlobalVariableArray& array); |
66 void PutObjectProperty(v8::Local<v8::Object> obj, CJS_KeyValue* pData); | 66 void PutObjectProperty(v8::Local<v8::Object> obj, CJS_KeyValue* pData); |
67 | 67 |
68 std::map<CFX_ByteString, JSGlobalData*> m_mapGlobal; | 68 std::map<CFX_ByteString, JSGlobalData*> m_mapGlobal; |
69 CFX_WideString m_sFilePath; | 69 CFX_WideString m_sFilePath; |
70 CJS_GlobalData* m_pGlobalData; | 70 CJS_GlobalData* m_pGlobalData; |
71 CPDFSDK_FormFillEnvironment* m_pEnv; | 71 CPDFSDK_FormFillEnvironment* m_pFormFillEnv; |
72 }; | 72 }; |
73 | 73 |
74 class CJS_Global : public CJS_Object { | 74 class CJS_Global : public CJS_Object { |
75 public: | 75 public: |
76 explicit CJS_Global(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} | 76 explicit CJS_Global(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} |
77 ~CJS_Global() override {} | 77 ~CJS_Global() override {} |
78 | 78 |
79 // CJS_Object | 79 // CJS_Object |
80 void InitInstance(IJS_Runtime* pIRuntime) override; | 80 void InitInstance(IJS_Runtime* pIRuntime) override; |
81 | 81 |
82 DECLARE_SPECIAL_JS_CLASS(); | 82 DECLARE_SPECIAL_JS_CLASS(); |
83 JS_SPECIAL_STATIC_METHOD(setPersistent, JSGlobalAlternate, global); | 83 JS_SPECIAL_STATIC_METHOD(setPersistent, JSGlobalAlternate, global); |
84 }; | 84 }; |
85 | 85 |
86 #endif // FPDFSDK_JAVASCRIPT_GLOBAL_H_ | 86 #endif // FPDFSDK_JAVASCRIPT_GLOBAL_H_ |
OLD | NEW |