Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
js_resources.cpp
Go to the documentation of this file.
1
// Copyright 2017 The PDFium Authors
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7
#
include
"fxjs/js_resources.h"
8
9
WideString
JSGetStringFromID
(
JSMessage
msg) {
10
const
char
* msg_string =
""
;
11
switch
(msg) {
12
case
JSMessage
::
kAlert
:
13
msg_string =
"Alert"
;
14
break
;
15
case
JSMessage
::
kParamError
:
16
msg_string =
"Incorrect number of parameters passed to function."
;
17
break
;
18
case
JSMessage
::
kInvalidInputError
:
19
msg_string =
"The input value is invalid."
;
20
break
;
21
case
JSMessage
::
kParamTooLongError
:
22
msg_string =
"The input value is too long."
;
23
break
;
24
case
JSMessage
::
kParseDateError
:
25
msg_string =
26
"The input value can't be parsed as a valid date/time (%ls)."
;
27
break
;
28
case
JSMessage
::
kRangeBetweenError
:
29
msg_string =
30
"The input value must be greater than or equal to %ls"
31
" and less than or equal to %ls."
;
32
break
;
33
case
JSMessage
::
kRangeGreaterError
:
34
msg_string =
"The input value must be greater than or equal to %ls."
;
35
break
;
36
case
JSMessage
::
kRangeLessError
:
37
msg_string =
"The input value must be less than or equal to %ls."
;
38
break
;
39
case
JSMessage
::
kNotSupportedError
:
40
msg_string =
"Operation not supported."
;
41
break
;
42
case
JSMessage
::
kBusyError
:
43
msg_string =
"System is busy."
;
44
break
;
45
case
JSMessage
::
kDuplicateEventError
:
46
msg_string =
"Duplicate formfield event found."
;
47
break
;
48
case
JSMessage
::
kSecondParamNotDateError
:
49
msg_string =
"The second parameter can't be converted to a Date."
;
50
break
;
51
case
JSMessage
::
kSecondParamInvalidDateError
:
52
msg_string =
"The second parameter is an invalid Date."
;
53
break
;
54
case
JSMessage
::
kGlobalNotFoundError
:
55
msg_string =
"Global value not found."
;
56
break
;
57
case
JSMessage
::
kReadOnlyError
:
58
msg_string =
"Cannot assign to readonly property."
;
59
break
;
60
case
JSMessage
::
kTypeError
:
61
msg_string =
"Incorrect parameter type."
;
62
break
;
63
case
JSMessage
::
kValueError
:
64
msg_string =
"Incorrect parameter value."
;
65
break
;
66
case
JSMessage
::
kPermissionError
:
67
msg_string =
"Permission denied."
;
68
break
;
69
case
JSMessage
::
kBadObjectError
:
70
msg_string =
"Object no longer exists."
;
71
break
;
72
case
JSMessage
::
kObjectTypeError
:
73
msg_string =
"Object is of the wrong type."
;
74
break
;
75
case
JSMessage
::
kUnknownProperty
:
76
msg_string =
"Unknown property."
;
77
break
;
78
case
JSMessage
::
kInvalidSetError
:
79
msg_string =
"Set not possible, invalid or unknown."
;
80
break
;
81
case
JSMessage
::
kUserGestureRequiredError
:
82
msg_string =
"User gesture required."
;
83
break
;
84
case
JSMessage
::
kTooManyOccurrences
:
85
msg_string =
"Too many occurrences."
;
86
break
;
87
case
JSMessage
::
kUnknownMethod
:
88
msg_string =
"Unknown method."
;
89
break
;
90
case
JSMessage
::
kWouldBeCyclic
:
91
msg_string =
"Operation would create a cycle."
;
92
break
;
93
}
94
return
WideString
::
FromASCII
(msg_string);
95
}
96
97
WideString
JSFormatErrorString
(
const
char
* class_name,
98
const
char
* property_name,
99
const
WideString
& details) {
100
WideString
result =
WideString
::
FromUTF8
(class_name);
101
if
(property_name) {
102
result
+=
L".";
103
result +=
WideString
::
FromUTF8
(property_name);
104
}
105
result
+=
L": ";
106
result
+=
details;
107
return
result;
108
}
fxcrt::WideString::operator+=
WideString & operator+=(const WideString &str)
Definition
widestring.cpp:491
fxcrt::WideString::FromUTF8
static WideString FromUTF8(ByteStringView str)
Definition
widestring.cpp:738
fxcrt::WideString::operator+=
WideString & operator+=(const wchar_t *str)
Definition
widestring.cpp:479
fxcrt::WideString::FromASCII
static WideString FromASCII(ByteStringView str)
Definition
widestring.cpp:704
JSMessage
JSMessage
Definition
js_resources.h:12
JSMessage::kParamTooLongError
@ kParamTooLongError
Definition
js_resources.h:16
JSMessage::kParseDateError
@ kParseDateError
Definition
js_resources.h:17
JSMessage::kObjectTypeError
@ kObjectTypeError
Definition
js_resources.h:32
JSMessage::kParamError
@ kParamError
Definition
js_resources.h:14
JSMessage::kPermissionError
@ kPermissionError
Definition
js_resources.h:30
JSMessage::kBadObjectError
@ kBadObjectError
Definition
js_resources.h:31
JSMessage::kRangeLessError
@ kRangeLessError
Definition
js_resources.h:20
JSMessage::kRangeBetweenError
@ kRangeBetweenError
Definition
js_resources.h:18
JSMessage::kRangeGreaterError
@ kRangeGreaterError
Definition
js_resources.h:19
JSMessage::kReadOnlyError
@ kReadOnlyError
Definition
js_resources.h:27
JSMessage::kDuplicateEventError
@ kDuplicateEventError
Definition
js_resources.h:23
JSMessage::kWouldBeCyclic
@ kWouldBeCyclic
Definition
js_resources.h:38
JSMessage::kGlobalNotFoundError
@ kGlobalNotFoundError
Definition
js_resources.h:26
JSMessage::kNotSupportedError
@ kNotSupportedError
Definition
js_resources.h:21
JSMessage::kTooManyOccurrences
@ kTooManyOccurrences
Definition
js_resources.h:36
JSMessage::kSecondParamNotDateError
@ kSecondParamNotDateError
Definition
js_resources.h:24
JSMessage::kInvalidInputError
@ kInvalidInputError
Definition
js_resources.h:15
JSMessage::kUserGestureRequiredError
@ kUserGestureRequiredError
Definition
js_resources.h:35
JSMessage::kUnknownProperty
@ kUnknownProperty
Definition
js_resources.h:33
JSMessage::kTypeError
@ kTypeError
Definition
js_resources.h:28
JSMessage::kSecondParamInvalidDateError
@ kSecondParamInvalidDateError
Definition
js_resources.h:25
JSMessage::kUnknownMethod
@ kUnknownMethod
Definition
js_resources.h:37
JSMessage::kBusyError
@ kBusyError
Definition
js_resources.h:22
JSMessage::kAlert
@ kAlert
Definition
js_resources.h:13
JSMessage::kValueError
@ kValueError
Definition
js_resources.h:29
JSMessage::kInvalidSetError
@ kInvalidSetError
Definition
js_resources.h:34
JSFormatErrorString
WideString JSFormatErrorString(const char *class_name, const char *property_name, const WideString &details)
Definition
js_resources.cpp:97
JSGetStringFromID
WideString JSGetStringFromID(JSMessage msg)
Definition
js_resources.cpp:9
WideString
fxcrt::WideString WideString
Definition
widestring.h:207
qtwebengine
src
3rdparty
chromium
third_party
pdfium
fxjs
js_resources.cpp
Generated on
for Qt by
1.18.0