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 #include "app.h" | 7 #include "app.h" |
8 | 8 |
9 #include "Document.h" | 9 #include "Document.h" |
10 #include "JS_Context.h" | 10 #include "JS_Context.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 CJS_Timer* TimerObj::GetTimer() const { | 41 CJS_Timer* TimerObj::GetTimer() const { |
42 return m_pTimer; | 42 return m_pTimer; |
43 } | 43 } |
44 | 44 |
45 #define JS_STR_VIEWERTYPE L"pdfium" | 45 #define JS_STR_VIEWERTYPE L"pdfium" |
46 #define JS_STR_VIEWERVARIATION L"Full" | 46 #define JS_STR_VIEWERVARIATION L"Full" |
47 #define JS_STR_PLATFORM L"WIN" | 47 #define JS_STR_PLATFORM L"WIN" |
48 #define JS_STR_LANGUANGE L"ENU" | 48 #define JS_STR_LANGUANGE L"ENU" |
49 #define JS_NUM_VIEWERVERSION 8 | 49 #define JS_NUM_VIEWERVERSION 8 |
| 50 #ifdef PDF_ENABLE_XFA |
| 51 #define JS_NUM_VIEWERVERSION_XFA 11 |
| 52 #endif |
50 #define JS_NUM_FORMSVERSION 7 | 53 #define JS_NUM_FORMSVERSION 7 |
51 | 54 |
52 BEGIN_JS_STATIC_CONST(CJS_App) | 55 BEGIN_JS_STATIC_CONST(CJS_App) |
53 END_JS_STATIC_CONST() | 56 END_JS_STATIC_CONST() |
54 | 57 |
55 BEGIN_JS_STATIC_PROP(CJS_App) | 58 BEGIN_JS_STATIC_PROP(CJS_App) |
56 JS_STATIC_PROP_ENTRY(activeDocs) | 59 JS_STATIC_PROP_ENTRY(activeDocs) |
57 JS_STATIC_PROP_ENTRY(calculate) | 60 JS_STATIC_PROP_ENTRY(calculate) |
58 JS_STATIC_PROP_ENTRY(formsVersion) | 61 JS_STATIC_PROP_ENTRY(formsVersion) |
59 JS_STATIC_PROP_ENTRY(fs) | 62 JS_STATIC_PROP_ENTRY(fs) |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 193 |
191 return FALSE; | 194 return FALSE; |
192 } | 195 } |
193 | 196 |
194 FX_BOOL app::viewerVersion(IJS_Context* cc, | 197 FX_BOOL app::viewerVersion(IJS_Context* cc, |
195 CJS_PropValue& vp, | 198 CJS_PropValue& vp, |
196 CFX_WideString& sError) { | 199 CFX_WideString& sError) { |
197 if (!vp.IsGetting()) | 200 if (!vp.IsGetting()) |
198 return FALSE; | 201 return FALSE; |
199 | 202 |
| 203 #ifdef PDF_ENABLE_XFA |
| 204 CJS_Context* pContext = (CJS_Context*)cc; |
| 205 CPDFSDK_Document* pCurDoc = pContext->GetReaderDocument(); |
| 206 CPDFXFA_Document* pDoc = pCurDoc->GetXFADocument(); |
| 207 if (pDoc->GetDocType() == 1 || pDoc->GetDocType() == 2) { |
| 208 vp << JS_NUM_VIEWERVERSION_XFA; |
| 209 return TRUE; |
| 210 } |
| 211 |
| 212 #endif |
200 vp << JS_NUM_VIEWERVERSION; | 213 vp << JS_NUM_VIEWERVERSION; |
201 return TRUE; | 214 return TRUE; |
202 } | 215 } |
203 | 216 |
204 FX_BOOL app::platform(IJS_Context* cc, | 217 FX_BOOL app::platform(IJS_Context* cc, |
205 CJS_PropValue& vp, | 218 CJS_PropValue& vp, |
206 CFX_WideString& sError) { | 219 CFX_WideString& sError) { |
207 if (vp.IsGetting()) { | 220 if (vp.IsGetting()) { |
208 vp << JS_STR_PLATFORM; | 221 vp << JS_STR_PLATFORM; |
209 return TRUE; | 222 return TRUE; |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 FX_BOOL app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { | 814 FX_BOOL app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { |
802 return FALSE; | 815 return FALSE; |
803 } | 816 } |
804 | 817 |
805 FX_BOOL app::execDialog(IJS_Context* cc, | 818 FX_BOOL app::execDialog(IJS_Context* cc, |
806 const std::vector<CJS_Value>& params, | 819 const std::vector<CJS_Value>& params, |
807 CJS_Value& vRet, | 820 CJS_Value& vRet, |
808 CFX_WideString& sError) { | 821 CFX_WideString& sError) { |
809 return TRUE; | 822 return TRUE; |
810 } | 823 } |
OLD | NEW |