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_APP_H_ | 7 #ifndef FPDFSDK_SRC_JAVASCRIPT_APP_H_ |
8 #define FPDFSDK_SRC_JAVASCRIPT_APP_H_ | 8 #define FPDFSDK_SRC_JAVASCRIPT_APP_H_ |
9 | 9 |
10 #include "JS_Define.h" | 10 #include "JS_Define.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 DECLARE_JS_CLASS(); | 36 DECLARE_JS_CLASS(); |
37 }; | 37 }; |
38 | 38 |
39 class app : public CJS_EmbedObj { | 39 class app : public CJS_EmbedObj { |
40 public: | 40 public: |
41 app(CJS_Object* pJSObject); | 41 app(CJS_Object* pJSObject); |
42 ~app() override; | 42 ~app() override; |
43 | 43 |
44 public: | 44 public: |
45 FX_BOOL activeDocs(IFXJS_Context* cc, | 45 FX_BOOL activeDocs(IJS_Context* cc, |
46 CJS_PropValue& vp, | 46 CJS_PropValue& vp, |
47 CFX_WideString& sError); | 47 CFX_WideString& sError); |
48 FX_BOOL calculate(IFXJS_Context* cc, | 48 FX_BOOL calculate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
49 CJS_PropValue& vp, | 49 FX_BOOL formsVersion(IJS_Context* cc, |
50 CFX_WideString& sError); | |
51 FX_BOOL formsVersion(IFXJS_Context* cc, | |
52 CJS_PropValue& vp, | 50 CJS_PropValue& vp, |
53 CFX_WideString& sError); | 51 CFX_WideString& sError); |
54 FX_BOOL fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); | 52 FX_BOOL fs(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
55 FX_BOOL fullscreen(IFXJS_Context* cc, | 53 FX_BOOL fullscreen(IJS_Context* cc, |
56 CJS_PropValue& vp, | 54 CJS_PropValue& vp, |
57 CFX_WideString& sError); | 55 CFX_WideString& sError); |
58 FX_BOOL language(IFXJS_Context* cc, | 56 FX_BOOL language(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
59 CJS_PropValue& vp, | 57 FX_BOOL media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
60 CFX_WideString& sError); | 58 FX_BOOL platform(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
61 FX_BOOL media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); | 59 FX_BOOL runtimeHighlight(IJS_Context* cc, |
62 FX_BOOL platform(IFXJS_Context* cc, | |
63 CJS_PropValue& vp, | |
64 CFX_WideString& sError); | |
65 FX_BOOL runtimeHighlight(IFXJS_Context* cc, | |
66 CJS_PropValue& vp, | 60 CJS_PropValue& vp, |
67 CFX_WideString& sError); | 61 CFX_WideString& sError); |
68 FX_BOOL viewerType(IFXJS_Context* cc, | 62 FX_BOOL viewerType(IJS_Context* cc, |
69 CJS_PropValue& vp, | 63 CJS_PropValue& vp, |
70 CFX_WideString& sError); | 64 CFX_WideString& sError); |
71 FX_BOOL viewerVariation(IFXJS_Context* cc, | 65 FX_BOOL viewerVariation(IJS_Context* cc, |
72 CJS_PropValue& vp, | 66 CJS_PropValue& vp, |
73 CFX_WideString& sError); | 67 CFX_WideString& sError); |
74 FX_BOOL viewerVersion(IFXJS_Context* cc, | 68 FX_BOOL viewerVersion(IJS_Context* cc, |
75 CJS_PropValue& vp, | 69 CJS_PropValue& vp, |
76 CFX_WideString& sError); | 70 CFX_WideString& sError); |
77 | 71 |
78 FX_BOOL alert(IFXJS_Context* cc, | 72 FX_BOOL alert(IJS_Context* cc, |
79 const CJS_Parameters& params, | 73 const CJS_Parameters& params, |
80 CJS_Value& vRet, | 74 CJS_Value& vRet, |
81 CFX_WideString& sError); | 75 CFX_WideString& sError); |
82 FX_BOOL beep(IFXJS_Context* cc, | 76 FX_BOOL beep(IJS_Context* cc, |
83 const CJS_Parameters& params, | 77 const CJS_Parameters& params, |
84 CJS_Value& vRet, | 78 CJS_Value& vRet, |
85 CFX_WideString& sError); | 79 CFX_WideString& sError); |
86 FX_BOOL browseForDoc(IFXJS_Context* cc, | 80 FX_BOOL browseForDoc(IJS_Context* cc, |
87 const CJS_Parameters& params, | 81 const CJS_Parameters& params, |
88 CJS_Value& vRet, | 82 CJS_Value& vRet, |
89 CFX_WideString& sError); | 83 CFX_WideString& sError); |
90 FX_BOOL clearInterval(IFXJS_Context* cc, | 84 FX_BOOL clearInterval(IJS_Context* cc, |
91 const CJS_Parameters& params, | 85 const CJS_Parameters& params, |
92 CJS_Value& vRet, | 86 CJS_Value& vRet, |
93 CFX_WideString& sError); | 87 CFX_WideString& sError); |
94 FX_BOOL clearTimeOut(IFXJS_Context* cc, | 88 FX_BOOL clearTimeOut(IJS_Context* cc, |
95 const CJS_Parameters& params, | 89 const CJS_Parameters& params, |
96 CJS_Value& vRet, | 90 CJS_Value& vRet, |
97 CFX_WideString& sError); | 91 CFX_WideString& sError); |
98 FX_BOOL execDialog(IFXJS_Context* cc, | 92 FX_BOOL execDialog(IJS_Context* cc, |
99 const CJS_Parameters& params, | 93 const CJS_Parameters& params, |
100 CJS_Value& vRet, | 94 CJS_Value& vRet, |
101 CFX_WideString& sError); | 95 CFX_WideString& sError); |
102 FX_BOOL execMenuItem(IFXJS_Context* cc, | 96 FX_BOOL execMenuItem(IJS_Context* cc, |
103 const CJS_Parameters& params, | 97 const CJS_Parameters& params, |
104 CJS_Value& vRet, | 98 CJS_Value& vRet, |
105 CFX_WideString& sError); | 99 CFX_WideString& sError); |
106 FX_BOOL findComponent(IFXJS_Context* cc, | 100 FX_BOOL findComponent(IJS_Context* cc, |
107 const CJS_Parameters& params, | 101 const CJS_Parameters& params, |
108 CJS_Value& vRet, | 102 CJS_Value& vRet, |
109 CFX_WideString& sError); | 103 CFX_WideString& sError); |
110 FX_BOOL goBack(IFXJS_Context* cc, | 104 FX_BOOL goBack(IJS_Context* cc, |
111 const CJS_Parameters& params, | 105 const CJS_Parameters& params, |
112 CJS_Value& vRet, | 106 CJS_Value& vRet, |
113 CFX_WideString& sError); | 107 CFX_WideString& sError); |
114 FX_BOOL goForward(IFXJS_Context* cc, | 108 FX_BOOL goForward(IJS_Context* cc, |
115 const CJS_Parameters& params, | 109 const CJS_Parameters& params, |
116 CJS_Value& vRet, | 110 CJS_Value& vRet, |
117 CFX_WideString& sError); | 111 CFX_WideString& sError); |
118 FX_BOOL launchURL(IFXJS_Context* cc, | 112 FX_BOOL launchURL(IJS_Context* cc, |
119 const CJS_Parameters& params, | 113 const CJS_Parameters& params, |
120 CJS_Value& vRet, | 114 CJS_Value& vRet, |
121 CFX_WideString& sError); | 115 CFX_WideString& sError); |
122 FX_BOOL mailMsg(IFXJS_Context* cc, | 116 FX_BOOL mailMsg(IJS_Context* cc, |
123 const CJS_Parameters& params, | 117 const CJS_Parameters& params, |
124 CJS_Value& vRet, | 118 CJS_Value& vRet, |
125 CFX_WideString& sError); | 119 CFX_WideString& sError); |
126 FX_BOOL newFDF(IFXJS_Context* cc, | 120 FX_BOOL newFDF(IJS_Context* cc, |
127 const CJS_Parameters& params, | 121 const CJS_Parameters& params, |
128 CJS_Value& vRet, | 122 CJS_Value& vRet, |
129 CFX_WideString& sError); | 123 CFX_WideString& sError); |
130 FX_BOOL newDoc(IFXJS_Context* cc, | 124 FX_BOOL newDoc(IJS_Context* cc, |
131 const CJS_Parameters& params, | 125 const CJS_Parameters& params, |
132 CJS_Value& vRet, | 126 CJS_Value& vRet, |
133 CFX_WideString& sError); | 127 CFX_WideString& sError); |
134 FX_BOOL openDoc(IFXJS_Context* cc, | 128 FX_BOOL openDoc(IJS_Context* cc, |
135 const CJS_Parameters& params, | 129 const CJS_Parameters& params, |
136 CJS_Value& vRet, | 130 CJS_Value& vRet, |
137 CFX_WideString& sError); | 131 CFX_WideString& sError); |
138 FX_BOOL openFDF(IFXJS_Context* cc, | 132 FX_BOOL openFDF(IJS_Context* cc, |
139 const CJS_Parameters& params, | 133 const CJS_Parameters& params, |
140 CJS_Value& vRet, | 134 CJS_Value& vRet, |
141 CFX_WideString& sError); | 135 CFX_WideString& sError); |
142 FX_BOOL popUpMenuEx(IFXJS_Context* cc, | 136 FX_BOOL popUpMenuEx(IJS_Context* cc, |
143 const CJS_Parameters& params, | 137 const CJS_Parameters& params, |
144 CJS_Value& vRet, | 138 CJS_Value& vRet, |
145 CFX_WideString& sError); | 139 CFX_WideString& sError); |
146 FX_BOOL popUpMenu(IFXJS_Context* cc, | 140 FX_BOOL popUpMenu(IJS_Context* cc, |
147 const CJS_Parameters& params, | 141 const CJS_Parameters& params, |
148 CJS_Value& vRet, | 142 CJS_Value& vRet, |
149 CFX_WideString& sError); | 143 CFX_WideString& sError); |
150 FX_BOOL response(IFXJS_Context* cc, | 144 FX_BOOL response(IJS_Context* cc, |
151 const CJS_Parameters& params, | 145 const CJS_Parameters& params, |
152 CJS_Value& vRet, | 146 CJS_Value& vRet, |
153 CFX_WideString& sError); | 147 CFX_WideString& sError); |
154 FX_BOOL setInterval(IFXJS_Context* cc, | 148 FX_BOOL setInterval(IJS_Context* cc, |
155 const CJS_Parameters& params, | 149 const CJS_Parameters& params, |
156 CJS_Value& vRet, | 150 CJS_Value& vRet, |
157 CFX_WideString& sError); | 151 CFX_WideString& sError); |
158 FX_BOOL setTimeOut(IFXJS_Context* cc, | 152 FX_BOOL setTimeOut(IJS_Context* cc, |
159 const CJS_Parameters& params, | 153 const CJS_Parameters& params, |
160 CJS_Value& vRet, | 154 CJS_Value& vRet, |
161 CFX_WideString& sError); | 155 CFX_WideString& sError); |
162 | 156 |
163 static CFX_WideString SysPathToPDFPath(const CFX_WideString& sOldPath); | 157 static CFX_WideString SysPathToPDFPath(const CFX_WideString& sOldPath); |
164 | 158 |
165 private: | 159 private: |
166 // CJS_EmbedObj | 160 // CJS_EmbedObj |
167 void TimerProc(CJS_Timer* pTimer) override; | 161 void TimerProc(CJS_Timer* pTimer) override; |
168 void RunJsScript(CJS_Runtime* pRuntime, const CFX_WideString& wsScript); | 162 void RunJsScript(CJS_Runtime* pRuntime, const CFX_WideString& wsScript); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 JS_STATIC_METHOD(openDoc, app); | 203 JS_STATIC_METHOD(openDoc, app); |
210 JS_STATIC_METHOD(openFDF, app); | 204 JS_STATIC_METHOD(openFDF, app); |
211 JS_STATIC_METHOD(popUpMenuEx, app); | 205 JS_STATIC_METHOD(popUpMenuEx, app); |
212 JS_STATIC_METHOD(popUpMenu, app); | 206 JS_STATIC_METHOD(popUpMenu, app); |
213 JS_STATIC_METHOD(response, app); | 207 JS_STATIC_METHOD(response, app); |
214 JS_STATIC_METHOD(setInterval, app); | 208 JS_STATIC_METHOD(setInterval, app); |
215 JS_STATIC_METHOD(setTimeOut, app); | 209 JS_STATIC_METHOD(setTimeOut, app); |
216 }; | 210 }; |
217 | 211 |
218 #endif // FPDFSDK_SRC_JAVASCRIPT_APP_H_ | 212 #endif // FPDFSDK_SRC_JAVASCRIPT_APP_H_ |
OLD | NEW |