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_JAVASCRIPT_DOCUMENT_H_ | 7 #ifndef FPDFSDK_JAVASCRIPT_DOCUMENT_H_ |
8 #define FPDFSDK_JAVASCRIPT_DOCUMENT_H_ | 8 #define FPDFSDK_JAVASCRIPT_DOCUMENT_H_ |
9 | 9 |
10 #include <list> | 10 #include <list> |
11 #include <memory> | 11 #include <memory> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "core/fpdfapi/page/cpdf_pageobject.h" | 14 #include "core/fpdfapi/page/cpdf_pageobject.h" |
15 #include "core/fpdfapi/page/cpdf_textobject.h" | 15 #include "core/fpdfapi/page/cpdf_textobject.h" |
16 #include "fpdfsdk/cpdfsdk_formfillenvironment.h" | 16 #include "fpdfsdk/cpdfsdk_formfillenvironment.h" |
17 #include "fpdfsdk/javascript/JS_Define.h" | 17 #include "fpdfsdk/javascript/JS_Define.h" |
18 | 18 |
19 class PrintParamsObj : public CJS_EmbedObj { | 19 class PrintParamsObj : public CJS_EmbedObj { |
20 public: | 20 public: |
21 PrintParamsObj(CJS_Object* pJSObject); | 21 explicit PrintParamsObj(CJS_Object* pJSObject); |
22 ~PrintParamsObj() override {} | 22 ~PrintParamsObj() override {} |
23 | 23 |
24 public: | 24 public: |
25 FX_BOOL bUI; | 25 FX_BOOL bUI; |
26 int nStart; | 26 int nStart; |
27 int nEnd; | 27 int nEnd; |
28 FX_BOOL bSilent; | 28 FX_BOOL bSilent; |
29 FX_BOOL bShrinkToFit; | 29 FX_BOOL bShrinkToFit; |
30 FX_BOOL bPrintAsImage; | 30 FX_BOOL bPrintAsImage; |
31 FX_BOOL bReverse; | 31 FX_BOOL bReverse; |
32 FX_BOOL bAnnotations; | 32 FX_BOOL bAnnotations; |
33 }; | 33 }; |
34 | 34 |
35 class CJS_PrintParamsObj : public CJS_Object { | 35 class CJS_PrintParamsObj : public CJS_Object { |
36 public: | 36 public: |
37 CJS_PrintParamsObj(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} | 37 explicit CJS_PrintParamsObj(v8::Local<v8::Object> pObject) |
| 38 : CJS_Object(pObject) {} |
38 ~CJS_PrintParamsObj() override {} | 39 ~CJS_PrintParamsObj() override {} |
39 | 40 |
40 DECLARE_JS_CLASS(); | 41 DECLARE_JS_CLASS(); |
41 }; | 42 }; |
42 | 43 |
43 class Icon; | 44 class Icon; |
44 class Field; | 45 class Field; |
45 | 46 |
46 struct IconElement { | 47 struct IconElement { |
47 IconElement(const CFX_WideString& name, Icon* stream) | 48 IconElement(const CFX_WideString& name, Icon* stream) |
48 : IconName(name), IconStream(stream) {} | 49 : IconName(name), IconStream(stream) {} |
49 | 50 |
50 CFX_WideString IconName; | 51 const CFX_WideString IconName; |
51 Icon* IconStream; | 52 Icon* const IconStream; |
52 }; | 53 }; |
53 | 54 |
54 struct CJS_DelayData; | 55 struct CJS_DelayData; |
55 struct CJS_DelayAnnot; | 56 struct CJS_DelayAnnot; |
56 struct CJS_AnnotObj; | 57 struct CJS_AnnotObj; |
57 | 58 |
58 class Document : public CJS_EmbedObj { | 59 class Document : public CJS_EmbedObj { |
59 public: | 60 public: |
60 Document(CJS_Object* pJSObject); | 61 explicit Document(CJS_Object* pJSObject); |
61 ~Document() override; | 62 ~Document() override; |
62 | 63 |
63 FX_BOOL ADBE(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); | 64 FX_BOOL ADBE(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
64 FX_BOOL author(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); | 65 FX_BOOL author(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
65 FX_BOOL baseURL(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); | 66 FX_BOOL baseURL(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
66 FX_BOOL bookmarkRoot(IJS_Context* cc, | 67 FX_BOOL bookmarkRoot(IJS_Context* cc, |
67 CJS_PropValue& vp, | 68 CJS_PropValue& vp, |
68 CFX_WideString& sError); | 69 CFX_WideString& sError); |
69 FX_BOOL calculate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); | 70 FX_BOOL calculate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
70 FX_BOOL Collab(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); | 71 FX_BOOL Collab(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex); | 285 CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex); |
285 | 286 |
286 FX_BOOL getPropertyInternal(IJS_Context* cc, | 287 FX_BOOL getPropertyInternal(IJS_Context* cc, |
287 CJS_PropValue& vp, | 288 CJS_PropValue& vp, |
288 const CFX_ByteString& propName, | 289 const CFX_ByteString& propName, |
289 CFX_WideString& sError); | 290 CFX_WideString& sError); |
290 | 291 |
291 CPDFSDK_FormFillEnvironment::ObservedPtr m_pFormFillEnv; | 292 CPDFSDK_FormFillEnvironment::ObservedPtr m_pFormFillEnv; |
292 CFX_WideString m_cwBaseURL; | 293 CFX_WideString m_cwBaseURL; |
293 std::list<std::unique_ptr<CJS_DelayData>> m_DelayData; | 294 std::list<std::unique_ptr<CJS_DelayData>> m_DelayData; |
294 std::list<std::unique_ptr<IconElement>> m_IconList; | 295 std::vector<std::unique_ptr<IconElement>> m_Icons; |
295 bool m_bDelay; | 296 bool m_bDelay; |
296 }; | 297 }; |
297 | 298 |
298 class CJS_Document : public CJS_Object { | 299 class CJS_Document : public CJS_Object { |
299 public: | 300 public: |
300 explicit CJS_Document(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} | 301 explicit CJS_Document(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} |
301 ~CJS_Document() override {} | 302 ~CJS_Document() override {} |
302 | 303 |
303 // CJS_Object | 304 // CJS_Object |
304 void InitInstance(IJS_Runtime* pIRuntime) override; | 305 void InitInstance(IJS_Runtime* pIRuntime) override; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 JS_STATIC_METHOD(replacePages, Document); | 377 JS_STATIC_METHOD(replacePages, Document); |
377 JS_STATIC_METHOD(removeIcon, Document); | 378 JS_STATIC_METHOD(removeIcon, Document); |
378 JS_STATIC_METHOD(resetForm, Document); | 379 JS_STATIC_METHOD(resetForm, Document); |
379 JS_STATIC_METHOD(saveAs, Document); | 380 JS_STATIC_METHOD(saveAs, Document); |
380 JS_STATIC_METHOD(submitForm, Document); | 381 JS_STATIC_METHOD(submitForm, Document); |
381 JS_STATIC_METHOD(syncAnnotScan, Document); | 382 JS_STATIC_METHOD(syncAnnotScan, Document); |
382 JS_STATIC_METHOD(mailDoc, Document); | 383 JS_STATIC_METHOD(mailDoc, Document); |
383 }; | 384 }; |
384 | 385 |
385 #endif // FPDFSDK_JAVASCRIPT_DOCUMENT_H_ | 386 #endif // FPDFSDK_JAVASCRIPT_DOCUMENT_H_ |
OLD | NEW |