| 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_PUBLICMETHODS_H_ | 7 #ifndef FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_ |
| 8 #define FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_ | 8 #define FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_ |
| 9 | 9 |
| 10 #include "JS_Define.h" | 10 #include "JS_Define.h" |
| 11 | 11 |
| 12 class CJS_PublicMethods : public CJS_Object { | 12 class CJS_PublicMethods : public CJS_Object { |
| 13 public: | 13 public: |
| 14 CJS_PublicMethods(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} | 14 explicit CJS_PublicMethods(v8::Local<v8::Object> pObject) |
| 15 : CJS_Object(pObject) {} |
| 15 ~CJS_PublicMethods() override {} | 16 ~CJS_PublicMethods() override {} |
| 16 | 17 |
| 17 public: | 18 public: |
| 18 static FX_BOOL AFNumber_Format(IJS_Context* cc, | 19 static FX_BOOL AFNumber_Format(IJS_Context* cc, |
| 19 const std::vector<CJS_Value>& params, | 20 const std::vector<CJS_Value>& params, |
| 20 CJS_Value& vRet, | 21 CJS_Value& vRet, |
| 21 CFX_WideString& sError); | 22 CFX_WideString& sError); |
| 22 static FX_BOOL AFNumber_Keystroke(IJS_Context* cc, | 23 static FX_BOOL AFNumber_Keystroke(IJS_Context* cc, |
| 23 const std::vector<CJS_Value>& params, | 24 const std::vector<CJS_Value>& params, |
| 24 CJS_Value& vRet, | 25 CJS_Value& vRet, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 public: | 134 public: |
| 134 static int ParseStringInteger(const CFX_WideString& string, | 135 static int ParseStringInteger(const CFX_WideString& string, |
| 135 int nStart, | 136 int nStart, |
| 136 int& nSkip, | 137 int& nSkip, |
| 137 int nMaxStep); | 138 int nMaxStep); |
| 138 static CFX_WideString ParseStringString(const CFX_WideString& string, | 139 static CFX_WideString ParseStringString(const CFX_WideString& string, |
| 139 int nStart, | 140 int nStart, |
| 140 int& nSkip); | 141 int& nSkip); |
| 141 static double MakeRegularDate(const CFX_WideString& value, | 142 static double MakeRegularDate(const CFX_WideString& value, |
| 142 const CFX_WideString& format, | 143 const CFX_WideString& format, |
| 143 FX_BOOL& bWrongFormat); | 144 bool* bWrongFormat); |
| 144 static CFX_WideString MakeFormatDate(double dDate, | 145 static CFX_WideString MakeFormatDate(double dDate, |
| 145 const CFX_WideString& format); | 146 const CFX_WideString& format); |
| 146 static FX_BOOL ConvertStringToNumber(const FX_WCHAR* swSource, | 147 static FX_BOOL ConvertStringToNumber(const FX_WCHAR* swSource, |
| 147 double& dRet, | 148 double& dRet, |
| 148 FX_BOOL& bDot); | 149 FX_BOOL& bDot); |
| 149 static double ParseStringToNumber(const FX_WCHAR* swSource); | 150 static double ParseStringToNumber(const FX_WCHAR* swSource); |
| 150 static double ParseNormalDate(const CFX_WideString& value, | 151 static double ParseNormalDate(const CFX_WideString& value, |
| 151 FX_BOOL& bWrongFormat); | 152 bool* bWrongFormat); |
| 152 static double MakeInterDate(CFX_WideString strValue); | 153 static double MakeInterDate(CFX_WideString strValue); |
| 153 static double ParseNumber(const FX_WCHAR* swSource, | 154 static double ParseNumber(const FX_WCHAR* swSource, |
| 154 FX_BOOL& bAllDigits, | 155 FX_BOOL& bAllDigits, |
| 155 FX_BOOL& bDot, | 156 FX_BOOL& bDot, |
| 156 FX_BOOL& bSign, | 157 FX_BOOL& bSign, |
| 157 FX_BOOL& bKXJS); | 158 FX_BOOL& bKXJS); |
| 158 | 159 |
| 159 public: | 160 public: |
| 160 static CFX_WideString StrLTrim(const FX_WCHAR* pStr); | 161 static CFX_WideString StrLTrim(const FX_WCHAR* pStr); |
| 161 static CFX_WideString StrRTrim(const FX_WCHAR* pStr); | 162 static CFX_WideString StrRTrim(const FX_WCHAR* pStr); |
| 162 static CFX_WideString StrTrim(const FX_WCHAR* pStr); | 163 static CFX_WideString StrTrim(const FX_WCHAR* pStr); |
| 163 | 164 |
| 164 static CFX_ByteString StrLTrim(const FX_CHAR* pStr); | 165 static CFX_ByteString StrLTrim(const FX_CHAR* pStr); |
| 165 static CFX_ByteString StrRTrim(const FX_CHAR* pStr); | 166 static CFX_ByteString StrRTrim(const FX_CHAR* pStr); |
| 166 static CFX_ByteString StrTrim(const FX_CHAR* pStr); | 167 static CFX_ByteString StrTrim(const FX_CHAR* pStr); |
| 167 | 168 |
| 168 static FX_BOOL IsNumber(const FX_CHAR* string); | 169 static FX_BOOL IsNumber(const FX_CHAR* string); |
| 169 static FX_BOOL IsNumber(const FX_WCHAR* string); | 170 static FX_BOOL IsNumber(const FX_WCHAR* string); |
| 170 | 171 |
| 171 static FX_BOOL IsDigit(char ch); | |
| 172 static FX_BOOL IsDigit(wchar_t ch); | |
| 173 static FX_BOOL IsAlphabetic(wchar_t ch); | |
| 174 static FX_BOOL IsAlphaNumeric(wchar_t ch); | |
| 175 | |
| 176 static FX_BOOL maskSatisfied(wchar_t c_Change, wchar_t c_Mask); | 172 static FX_BOOL maskSatisfied(wchar_t c_Change, wchar_t c_Mask); |
| 177 static FX_BOOL isReservedMaskChar(wchar_t ch); | 173 static FX_BOOL isReservedMaskChar(wchar_t ch); |
| 178 | 174 |
| 179 static double AF_Simple(const FX_WCHAR* sFuction, | 175 static double AF_Simple(const FX_WCHAR* sFuction, |
| 180 double dValue1, | 176 double dValue1, |
| 181 double dValue2); | 177 double dValue2); |
| 182 static CJS_Array AF_MakeArrayFromList(CJS_Runtime* pRuntime, CJS_Value val); | 178 static CJS_Array AF_MakeArrayFromList(CJS_Runtime* pRuntime, CJS_Value val); |
| 183 }; | 179 }; |
| 184 | 180 |
| 185 #endif // FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_ | 181 #endif // FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_ |
| OLD | NEW |