| 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_VALUE_H_ | 7 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_ |
| 8 #define FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_ | 8 #define FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_ |
| 9 | 9 |
| 10 #include "../../../core/include/fxcrt/fx_basic.h" | 10 #include "../../../core/include/fxcrt/fx_basic.h" |
| 11 #include "../jsapi/fxjs_v8.h" | 11 #include "../jsapi/fxjs_v8.h" |
| 12 | 12 |
| 13 class CJS_Array; | 13 class CJS_Array; |
| 14 class CJS_Date; | 14 class CJS_Date; |
| 15 class CJS_Document; | 15 class CJS_Document; |
| 16 class CJS_Object; | 16 class CJS_Object; |
| 17 | 17 |
| 18 class CJS_Value | 18 class CJS_Value |
| 19 { | 19 { |
| 20 public: | 20 public: |
| 21 CJS_Value(v8::Isolate* isolate); | 21 CJS_Value(v8::Isolate* isolate); |
| 22 CJS_Value(v8::Isolate* isolate, v8::Local<v8::Value> pValue,FXJSVALUETYP
E t); | 22 CJS_Value(v8::Isolate* isolate, v8::Local<v8::Value> pValue,FXJSVALUETYP
E t); |
| 23 CJS_Value(v8::Isolate* isolate, const int &iValue); | 23 CJS_Value(v8::Isolate* isolate, const int &iValue); |
| 24 CJS_Value(v8::Isolate* isolate, const double &dValue); | 24 CJS_Value(v8::Isolate* isolate, const double &dValue); |
| 25 CJS_Value(v8::Isolate* isolate, const float &fValue); | 25 CJS_Value(v8::Isolate* isolate, const float &fValue); |
| 26 CJS_Value(v8::Isolate* isolate, const bool &bValue); | 26 CJS_Value(v8::Isolate* isolate, const bool &bValue); |
| 27 CJS_Value(v8::Isolate* isolate, JSFXObject); | 27 CJS_Value(v8::Isolate* isolate, JSFXObject); |
| 28 CJS_Value(v8::Isolate* isolate, CJS_Object*); | 28 CJS_Value(v8::Isolate* isolate, CJS_Object*); |
| 29 CJS_Value(v8::Isolate* isolate, CJS_Document*); | 29 CJS_Value(v8::Isolate* isolate, CJS_Document*); |
| 30 » CJS_Value(v8::Isolate* isolate, FX_LPCSTR pStr); | 30 » CJS_Value(v8::Isolate* isolate, const FX_CHAR* pStr); |
| 31 » CJS_Value(v8::Isolate* isolate, FX_LPCWSTR pWstr); | 31 » CJS_Value(v8::Isolate* isolate, const FX_WCHAR* pWstr); |
| 32 CJS_Value(v8::Isolate* isolate, CJS_Array& array); | 32 CJS_Value(v8::Isolate* isolate, CJS_Array& array); |
| 33 | 33 |
| 34 ~CJS_Value(); | 34 ~CJS_Value(); |
| 35 | 35 |
| 36 void SetNull(); | 36 void SetNull(); |
| 37 void Attach(v8::Local<v8::Value> pValue,FXJSVALUETYPE t); | 37 void Attach(v8::Local<v8::Value> pValue,FXJSVALUETYPE t); |
| 38 void Attach(CJS_Value *pValue); | 38 void Attach(CJS_Value *pValue); |
| 39 void Detach(); | 39 void Detach(); |
| 40 | 40 |
| 41 | 41 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 52 | 52 |
| 53 void operator = (int iValue); | 53 void operator = (int iValue); |
| 54 void operator = (bool bValue); | 54 void operator = (bool bValue); |
| 55 void operator = (double); | 55 void operator = (double); |
| 56 void operator = (float); | 56 void operator = (float); |
| 57 void operator = (CJS_Object*); | 57 void operator = (CJS_Object*); |
| 58 void operator = (CJS_Document*); | 58 void operator = (CJS_Document*); |
| 59 void operator = (v8::Local<v8::Object>); | 59 void operator = (v8::Local<v8::Object>); |
| 60 void operator = (CJS_Array &); | 60 void operator = (CJS_Array &); |
| 61 void operator = (CJS_Date &); | 61 void operator = (CJS_Date &); |
| 62 » void operator = (FX_LPCWSTR pWstr); | 62 » void operator = (const FX_WCHAR* pWstr); |
| 63 » void operator = (FX_LPCSTR pStr); | 63 » void operator = (const FX_CHAR* pStr); |
| 64 void operator = (CJS_Value value); | 64 void operator = (CJS_Value value); |
| 65 | 65 |
| 66 FX_BOOL IsArrayObject() const; | 66 FX_BOOL IsArrayObject() const; |
| 67 FX_BOOL IsDateObject() const; | 67 FX_BOOL IsDateObject() const; |
| 68 FXJSVALUETYPE GetType() const; | 68 FXJSVALUETYPE GetType() const; |
| 69 | 69 |
| 70 FX_BOOL ConvertToArray(CJS_Array &) const; | 70 FX_BOOL ConvertToArray(CJS_Array &) const; |
| 71 FX_BOOL ConvertToDate(CJS_Date &) const; | 71 FX_BOOL ConvertToDate(CJS_Date &) const; |
| 72 | 72 |
| 73 v8::Isolate* GetIsolate() {return m_isolate;} | 73 v8::Isolate* GetIsolate() {return m_isolate;} |
| (...skipping 30 matching lines...) Expand all Loading... |
| 104 void operator<<(double); | 104 void operator<<(double); |
| 105 void operator>>(double&) const; | 105 void operator>>(double&) const; |
| 106 void operator<<(CJS_Object* pObj); | 106 void operator<<(CJS_Object* pObj); |
| 107 void operator>>(CJS_Object*& ppObj) const; | 107 void operator>>(CJS_Object*& ppObj) const; |
| 108 void operator<<(CJS_Document* pJsDoc); | 108 void operator<<(CJS_Document* pJsDoc); |
| 109 void operator>>(CJS_Document*& ppJsDoc) const; | 109 void operator>>(CJS_Document*& ppJsDoc) const; |
| 110 void operator<<(CFX_ByteString); | 110 void operator<<(CFX_ByteString); |
| 111 void operator>>(CFX_ByteString&) const; | 111 void operator>>(CFX_ByteString&) const; |
| 112 void operator<<(CFX_WideString); | 112 void operator<<(CFX_WideString); |
| 113 void operator>>(CFX_WideString&) const; | 113 void operator>>(CFX_WideString&) const; |
| 114 » void operator<<(FX_LPCWSTR c_string); | 114 » void operator<<(const FX_WCHAR* c_string); |
| 115 void operator<<(JSFXObject); | 115 void operator<<(JSFXObject); |
| 116 void operator>>(JSFXObject&) const; | 116 void operator>>(JSFXObject&) const; |
| 117 void operator>>(CJS_Array& array) const; | 117 void operator>>(CJS_Array& array) const; |
| 118 void operator<<(CJS_Array& array); | 118 void operator<<(CJS_Array& array); |
| 119 void operator<<(CJS_Date& date); | 119 void operator<<(CJS_Date& date); |
| 120 void operator>>(CJS_Date& date) const; | 120 void operator>>(CJS_Date& date) const; |
| 121 operator v8::Local<v8::Value>() const; | 121 operator v8::Local<v8::Value>() const; |
| 122 void StartSetting(); | 122 void StartSetting(); |
| 123 void StartGetting(); | 123 void StartGetting(); |
| 124 private: | 124 private: |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 static double MakeDate(int year, int mon, int mday,int hour, int min,
int sec,int ms); | 180 static double MakeDate(int year, int mon, int mday,int hour, int min,
int sec,int ms); |
| 181 | 181 |
| 182 FX_BOOL IsValidDate(); | 182 FX_BOOL IsValidDate(); |
| 183 | 183 |
| 184 protected: | 184 protected: |
| 185 v8::Local<v8::Value> m_pDate; | 185 v8::Local<v8::Value> m_pDate; |
| 186 v8::Isolate* m_isolate; | 186 v8::Isolate* m_isolate; |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_ | 189 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_ |
| OLD | NEW |