diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-10-30 20:20:42 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-10-30 20:20:42 +0000 |
commit | e0345a4aecfd16264d393234cf8fe22250d771fe (patch) | |
tree | 046f8e6c074b8525d6cf71daf4f2039582fb572a /fxjs/cjs_publicmethods.h | |
parent | 341ec6256457c53d50f2d0a0667e61041d4d89be (diff) | |
download | pdfium-e0345a4aecfd16264d393234cf8fe22250d771fe.tar.xz |
Move fpdfsdk/javascript to fxjs/
This CL moves all of the CJS files into fxjs. The :javascript build rule
is removed and :fxjs is used instead.
Change-Id: I1701b308f51317d0346c7401b43812c3f43a27bf
Reviewed-on: https://pdfium-review.googlesource.com/17047
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs/cjs_publicmethods.h')
-rw-r--r-- | fxjs/cjs_publicmethods.h | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/fxjs/cjs_publicmethods.h b/fxjs/cjs_publicmethods.h new file mode 100644 index 0000000000..95ee4995c9 --- /dev/null +++ b/fxjs/cjs_publicmethods.h @@ -0,0 +1,159 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef FXJS_CJS_PUBLICMETHODS_H_ +#define FXJS_CJS_PUBLICMETHODS_H_ + +#include <string> +#include <vector> + +#include "fxjs/JS_Define.h" + +class CJS_PublicMethods : public CJS_Object { + public: + explicit CJS_PublicMethods(v8::Local<v8::Object> pObject) + : CJS_Object(pObject) {} + ~CJS_PublicMethods() override {} + + static CJS_Return AFNumber_Format( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFNumber_Keystroke( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFPercent_Format( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFPercent_Keystroke( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFDate_FormatEx( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFDate_KeystrokeEx( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFDate_Format( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFDate_Keystroke( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFTime_FormatEx( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFTime_KeystrokeEx( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFTime_Format( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFTime_Keystroke( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFSpecial_Format( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFSpecial_Keystroke( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFSpecial_KeystrokeEx( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFSimple(CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFMakeNumber( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFSimple_Calculate( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFRange_Validate( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFMergeChange( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFParseDateEx( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + static CJS_Return AFExtractNums( + CJS_Runtime* pRuntime, + const std::vector<v8::Local<v8::Value>>& params); + + static void AFNumber_Format_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFNumber_Keystroke_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFPercent_Format_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFPercent_Keystroke_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFDate_FormatEx_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFDate_KeystrokeEx_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFDate_Format_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFDate_Keystroke_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFTime_FormatEx_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFTime_KeystrokeEx_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFTime_Format_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFTime_Keystroke_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFSpecial_Format_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFSpecial_Keystroke_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFSpecial_KeystrokeEx_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFSimple_static(const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFMakeNumber_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFSimple_Calculate_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFRange_Validate_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFMergeChange_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFParseDateEx_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + static void AFExtractNums_static( + const v8::FunctionCallbackInfo<v8::Value>& info); + + static const JSMethodSpec GlobalFunctionSpecs[]; + static void DefineJSObjects(CFXJS_Engine* pEngine); + static int ParseStringInteger(const WideString& string, + size_t nStart, + size_t& nSkip, + size_t nMaxStep); + static WideString ParseStringString(const WideString& string, + size_t nStart, + size_t& nSkip); + static double MakeRegularDate(const WideString& value, + const WideString& format, + bool* bWrongFormat); + static WideString MakeFormatDate(double dDate, const WideString& format); + static double ParseNormalDate(const WideString& value, bool* bWrongFormat); + static double MakeInterDate(const WideString& value); + + static bool IsNumber(const WideString& str); + + static bool maskSatisfied(wchar_t c_Change, wchar_t c_Mask); + static bool isReservedMaskChar(wchar_t ch); + + static double AF_Simple(const wchar_t* sFuction, + double dValue1, + double dValue2); + static v8::Local<v8::Array> AF_MakeArrayFromList(CJS_Runtime* pRuntime, + v8::Local<v8::Value> val); +}; + +#endif // FXJS_CJS_PUBLICMETHODS_H_ |