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_INCLUDE_JAVASCRIPT_JS_GLOBALDATA_H_ | 7 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_GLOBALDATA_H_ |
8 #define FPDFSDK_INCLUDE_JAVASCRIPT_JS_GLOBALDATA_H_ | 8 #define FPDFSDK_INCLUDE_JAVASCRIPT_JS_GLOBALDATA_H_ |
9 | 9 |
10 #include "../../../core/include/fxcrt/fx_basic.h" | 10 #include "../../../core/include/fxcrt/fx_basic.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 CJS_GlobalVariableArray objData; | 49 CJS_GlobalVariableArray objData; |
50 }; | 50 }; |
51 | 51 |
52 class CJS_GlobalData_Element | 52 class CJS_GlobalData_Element |
53 { | 53 { |
54 public: | 54 public: |
55 CJS_GlobalData_Element(){} | 55 CJS_GlobalData_Element(){} |
56 virtual ~CJS_GlobalData_Element(){} | 56 virtual ~CJS_GlobalData_Element(){} |
57 | 57 |
58 CJS_KeyValue data; | 58 CJS_KeyValue data; |
59 » bool» » » » » bPersistent; | 59 » FX_BOOL»» » » » bPersistent; |
60 }; | 60 }; |
61 | 61 |
62 class CJS_GlobalData | 62 class CJS_GlobalData |
63 { | 63 { |
64 public: | 64 public: |
65 CJS_GlobalData(CPDFDoc_Environment* pApp); | 65 CJS_GlobalData(CPDFDoc_Environment* pApp); |
66 virtual ~CJS_GlobalData(); | 66 virtual ~CJS_GlobalData(); |
67 | 67 |
68 public: | 68 public: |
69 void SetGloba
lVariableNumber(const FX_CHAR* propname, double dData); | 69 void SetGloba
lVariableNumber(const FX_CHAR* propname, double dData); |
70 void SetGloba
lVariableBoolean(const FX_CHAR* propname, bool bData); | 70 void SetGloba
lVariableBoolean(const FX_CHAR* propname, bool bData); |
71 void SetGloba
lVariableString(const FX_CHAR* propname, const CFX_ByteString& sData); | 71 void SetGloba
lVariableString(const FX_CHAR* propname, const CFX_ByteString& sData); |
72 void SetGloba
lVariableObject(const FX_CHAR* propname, const CJS_GlobalVariableArray& array); | 72 void SetGloba
lVariableObject(const FX_CHAR* propname, const CJS_GlobalVariableArray& array); |
73 void SetGloba
lVariableNull(const FX_CHAR* propname); | 73 void SetGloba
lVariableNull(const FX_CHAR* propname); |
74 | 74 |
75 » bool» » » » » » » » SetGloba
lVariablePersistent(const FX_CHAR* propname, bool bPersistent); | 75 » FX_BOOL»» » » » » » » SetGloba
lVariablePersistent(const FX_CHAR* propname, FX_BOOL bPersistent); |
76 » bool» » » » » » » » DeleteGl
obalVariable(const FX_CHAR* propname); | 76 » FX_BOOL»» » » » » » » DeleteGl
obalVariable(const FX_CHAR* propname); |
77 | 77 |
78 int32_t GetSize() const; | 78 int32_t GetSize() const; |
79 CJS_GlobalData_Element* GetAt(int index) const; | 79 CJS_GlobalData_Element* GetAt(int index) const; |
80 | 80 |
81 private: | 81 private: |
82 void LoadGlob
alPersistentVariables(); | 82 void LoadGlob
alPersistentVariables(); |
83 void SaveGlob
alPersisitentVariables(); | 83 void SaveGlob
alPersisitentVariables(); |
84 | 84 |
85 CJS_GlobalData_Element* GetGlobalVariable(const
FX_CHAR* propname); | 85 CJS_GlobalData_Element* GetGlobalVariable(const
FX_CHAR* propname); |
86 int
FindGlobalVariable(const FX_CHAR* propname); | 86 int
FindGlobalVariable(const FX_CHAR* propname); |
87 | 87 |
88 void LoadFile
Buffer(const FX_WCHAR* sFilePath, uint8_t*& pBuffer, int32_t& nLength); | 88 void LoadFile
Buffer(const FX_WCHAR* sFilePath, uint8_t*& pBuffer, int32_t& nLength); |
89 void WriteFil
eBuffer(const FX_WCHAR* sFilePath, const FX_CHAR* pBuffer, int32_t nLength); | 89 void WriteFil
eBuffer(const FX_WCHAR* sFilePath, const FX_CHAR* pBuffer, int32_t nLength); |
90 void MakeByte
String(const CFX_ByteString& name, CJS_KeyValue* pData, CFX_BinaryBuf& sData); | 90 void MakeByte
String(const CFX_ByteString& name, CJS_KeyValue* pData, CFX_BinaryBuf& sData); |
91 | 91 |
92 private: | 92 private: |
93 CFX_ArrayTemplate<CJS_GlobalData_Element*> m_arrayGlobalData; | 93 CFX_ArrayTemplate<CJS_GlobalData_Element*> m_arrayGlobalData; |
94 CFX_WideString
m_sFilePath; | 94 CFX_WideString
m_sFilePath; |
95 }; | 95 }; |
96 | 96 |
97 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_GLOBALDATA_H_ | 97 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_GLOBALDATA_H_ |
OLD | NEW |