summaryrefslogtreecommitdiff
path: root/fpdfsdk/include/javascript/JS_Value.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-09-16 10:42:08 -0700
committerTom Sepez <tsepez@chromium.org>2015-09-16 10:42:08 -0700
commit506df426d5d64d68e9dc27ffebcf56f6c6a1bccf (patch)
tree3ba8d38a3bef95c0555549953bce0cce90845cdb /fpdfsdk/include/javascript/JS_Value.h
parent615d7aba0f7d53a78eb05fbd4ae0e1a7e1d3b103 (diff)
downloadpdfium-506df426d5d64d68e9dc27ffebcf56f6c6a1bccf.tar.xz
Ensure functions in FXJS_V8 are prefixed by FXJS_.
Currently, its hard to tell which functions come from the JS_ layer at fpdfsdk/include/javascript vs. which functions come from the FXJS_V8 layer at fpdfsdk/include/jsapi. Until we take up the task of using namespaces, at least make the prefix consistent. Move objects out of FXJS_V8 that are really part of JS_. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1347833002 .
Diffstat (limited to 'fpdfsdk/include/javascript/JS_Value.h')
-rw-r--r--fpdfsdk/include/javascript/JS_Value.h35
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_