diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-09-17 15:25:23 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-09-17 15:25:23 -0700 |
commit | 39bfe122b4867601051c56562a5ab9cf6be644ad (patch) | |
tree | 73ea2387759b2ba2a80ab344da69dc063fc69172 /fpdfsdk/include/javascript/JS_Value.h | |
parent | 4babdcf9c7abc9edefb179e5ed23db8e7a5840f7 (diff) | |
download | pdfium-39bfe122b4867601051c56562a5ab9cf6be644ad.tar.xz |
Merge to XFA: Ensure functions in FXJS_V8 are prefixed by FXJS_.
Manual edits:
fpdfsdk/include/javascript/JS_Define.h
fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp
fpdfsdk/src/javascript/Document.cpp
fpdfsdk/src/javascript/JS_Runtime.cpp
fpdfsdk/src/jsapi/fxjs_v8.cpp
(cherry picked from commit 506df426d5d64d68e9dc27ffebcf56f6c6a1bccf)
Original Review URL: https://codereview.chromium.org/1347833002 .
(cherry picked from commit 455019ca48f60bd285e043986471f51f17c69a0d)
Original Review URL: https://codereview.chromium.org/1349783003 .
(cherry picked from commit 1af240cc45480520b447be767686e73a29c48f9e)
Original Review URL: https://codereview.chromium.org/1348693003 .
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1356563003 .
Diffstat (limited to 'fpdfsdk/include/javascript/JS_Value.h')
-rw-r--r-- | fpdfsdk/include/javascript/JS_Value.h | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/fpdfsdk/include/javascript/JS_Value.h b/fpdfsdk/include/javascript/JS_Value.h index 771214d968..384e772572 100644 --- a/fpdfsdk/include/javascript/JS_Value.h +++ b/fpdfsdk/include/javascript/JS_Value.h @@ -17,8 +17,20 @@ class CJS_Object; class CJS_Value { public: + enum Type { + VT_unknown, + VT_string, + VT_number, + VT_boolean, + VT_date, + VT_object, + VT_fxobject, + VT_null, + VT_undefined + }; + CJS_Value(v8::Isolate* isolate); - CJS_Value(v8::Isolate* isolate, v8::Local<v8::Value> pValue, FXJSVALUETYPE t); + CJS_Value(v8::Isolate* isolate, v8::Local<v8::Value> pValue, Type t); CJS_Value(v8::Isolate* isolate, const int& iValue); CJS_Value(v8::Isolate* isolate, const double& dValue); CJS_Value(v8::Isolate* isolate, const float& fValue); @@ -33,10 +45,11 @@ class CJS_Value { ~CJS_Value(); void SetNull(); - void Attach(v8::Local<v8::Value> pValue, FXJSVALUETYPE t); + void Attach(v8::Local<v8::Value> pValue, Type t); void Attach(CJS_Value* pValue); void Detach(); + Type GetType() const; int ToInt() const; bool ToBool() const; double ToDouble() const; @@ -63,16 +76,14 @@ class CJS_Value { FX_BOOL IsArrayObject() const; FX_BOOL IsDateObject() const; - FXJSVALUETYPE GetType() const; - FX_BOOL ConvertToArray(CJS_Array&) const; FX_BOOL ConvertToDate(CJS_Date&) const; v8::Isolate* GetIsolate() { return m_isolate; } protected: + Type m_eType; v8::Local<v8::Value> m_pValue; - FXJSVALUETYPE m_eType; v8::Isolate* m_isolate; }; @@ -190,4 +201,18 @@ class CJS_Date { v8::Isolate* m_isolate; }; +double JS_GetDateTime(); +int JS_GetYearFromTime(double dt); +int JS_GetMonthFromTime(double dt); +int JS_GetDayFromTime(double dt); +int JS_GetHourFromTime(double dt); +int JS_GetMinFromTime(double dt); +int JS_GetSecFromTime(double dt); +double JS_DateParse(const wchar_t* string); +double JS_MakeDay(int nYear, int nMonth, int nDay); +double JS_MakeTime(int nHour, int nMin, int nSec, int nMs); +double JS_MakeDate(double day, double time); +bool JS_PortIsNan(double d); +double JS_LocalTime(double d); + #endif // FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_ |