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_SRC_JAVASCRIPT_JS_VALUE_H_ | 7 #ifndef FPDFSDK_SRC_JAVASCRIPT_JS_VALUE_H_ |
8 #define FPDFSDK_SRC_JAVASCRIPT_JS_VALUE_H_ | 8 #define FPDFSDK_SRC_JAVASCRIPT_JS_VALUE_H_ |
9 | 9 |
10 #include "../../include/jsapi/fxjs_v8.h" | 10 #include "../../include/jsapi/fxjs_v8.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 FX_BOOL ConvertToDate(CJS_Date&) const; | 81 FX_BOOL ConvertToDate(CJS_Date&) const; |
82 | 82 |
83 CJS_Runtime* GetJSRuntime() const { return m_pJSRuntime; } | 83 CJS_Runtime* GetJSRuntime() const { return m_pJSRuntime; } |
84 | 84 |
85 protected: | 85 protected: |
86 Type m_eType; | 86 Type m_eType; |
87 v8::Local<v8::Value> m_pValue; | 87 v8::Local<v8::Value> m_pValue; |
88 CJS_Runtime* m_pJSRuntime; | 88 CJS_Runtime* m_pJSRuntime; |
89 }; | 89 }; |
90 | 90 |
91 class CJS_Parameters : public CFX_ArrayTemplate<CJS_Value> { | 91 using CJS_Parameters = std::vector<CJS_Value>; |
92 public: | |
93 void push_back(const CJS_Value& newElement) { | |
94 CFX_ArrayTemplate<CJS_Value>::Add(newElement); | |
95 } | |
96 int size() const { return CFX_ArrayTemplate<CJS_Value>::GetSize(); } | |
97 }; | |
98 | 92 |
99 class CJS_PropValue : public CJS_Value { | 93 class CJS_PropValue : public CJS_Value { |
100 public: | 94 public: |
101 CJS_PropValue(const CJS_Value&); | 95 CJS_PropValue(const CJS_Value&); |
102 CJS_PropValue(CJS_Runtime* pRuntime); | 96 CJS_PropValue(CJS_Runtime* pRuntime); |
103 ~CJS_PropValue(); | 97 ~CJS_PropValue(); |
104 | 98 |
105 FX_BOOL IsSetting() const { return m_bIsSetting; } | 99 FX_BOOL IsSetting() const { return m_bIsSetting; } |
106 FX_BOOL IsGetting() const { return !m_bIsSetting; } | 100 FX_BOOL IsGetting() const { return !m_bIsSetting; } |
107 | 101 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 int JS_GetMinFromTime(double dt); | 204 int JS_GetMinFromTime(double dt); |
211 int JS_GetSecFromTime(double dt); | 205 int JS_GetSecFromTime(double dt); |
212 double JS_DateParse(const wchar_t* string); | 206 double JS_DateParse(const wchar_t* string); |
213 double JS_MakeDay(int nYear, int nMonth, int nDay); | 207 double JS_MakeDay(int nYear, int nMonth, int nDay); |
214 double JS_MakeTime(int nHour, int nMin, int nSec, int nMs); | 208 double JS_MakeTime(int nHour, int nMin, int nSec, int nMs); |
215 double JS_MakeDate(double day, double time); | 209 double JS_MakeDate(double day, double time); |
216 bool JS_PortIsNan(double d); | 210 bool JS_PortIsNan(double d); |
217 double JS_LocalTime(double d); | 211 double JS_LocalTime(double d); |
218 | 212 |
219 #endif // FPDFSDK_SRC_JAVASCRIPT_JS_VALUE_H_ | 213 #endif // FPDFSDK_SRC_JAVASCRIPT_JS_VALUE_H_ |
OLD | NEW |