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 explicit PrintParamsObj(CJS_Object* pJSObject); | 21 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 explicit CJS_PrintParamsObj(v8::Local<v8::Object> pObject) | 37 CJS_PrintParamsObj(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} |
38 : CJS_Object(pObject) {} | |
39 ~CJS_PrintParamsObj() override {} | 38 ~CJS_PrintParamsObj() override {} |
40 | 39 |
41 DECLARE_JS_CLASS(); | 40 DECLARE_JS_CLASS(); |
42 }; | 41 }; |
43 | 42 |
44 class Icon; | 43 class Icon; |
45 class Field; | 44 class Field; |
46 | 45 |
47 struct IconElement { | 46 struct IconElement { |
48 IconElement(const CFX_WideString& name, Icon* stream) | 47 IconElement(const CFX_WideString& name, Icon* stream) |
49 : IconName(name), IconStream(stream) {} | 48 : IconName(name), IconStream(stream) {} |
50 | 49 |
51 const CFX_WideString IconName; | 50 CFX_WideString IconName; |
52 Icon* const IconStream; | 51 Icon* IconStream; |
53 }; | 52 }; |
54 | 53 |
55 struct CJS_DelayData; | 54 struct CJS_DelayData; |
56 struct CJS_DelayAnnot; | 55 struct CJS_DelayAnnot; |
57 struct CJS_AnnotObj; | 56 struct CJS_AnnotObj; |
58 | 57 |
59 class Document : public CJS_EmbedObj { | 58 class Document : public CJS_EmbedObj { |
60 public: | 59 public: |
61 explicit Document(CJS_Object* pJSObject); | 60 Document(CJS_Object* pJSObject); |
62 ~Document() override; | 61 ~Document() override; |
63 | 62 |
64 FX_BOOL ADBE(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); | 63 FX_BOOL ADBE(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
65 FX_BOOL author(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); | 64 FX_BOOL author(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
66 FX_BOOL baseURL(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); | 65 FX_BOOL baseURL(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
67 FX_BOOL bookmarkRoot(IJS_Context* cc, | 66 FX_BOOL bookmarkRoot(IJS_Context* cc, |
68 CJS_PropValue& vp, | 67 CJS_PropValue& vp, |
69 CFX_WideString& sError); | 68 CFX_WideString& sError); |
70 FX_BOOL calculate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); | 69 FX_BOOL calculate(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); |
71 FX_BOOL Collab(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); | 70 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... |
285 CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex); | 284 CFX_WideString GetObjWordStr(CPDF_TextObject* pTextObj, int nWordIndex); |
286 | 285 |
287 FX_BOOL getPropertyInternal(IJS_Context* cc, | 286 FX_BOOL getPropertyInternal(IJS_Context* cc, |
288 CJS_PropValue& vp, | 287 CJS_PropValue& vp, |
289 const CFX_ByteString& propName, | 288 const CFX_ByteString& propName, |
290 CFX_WideString& sError); | 289 CFX_WideString& sError); |
291 | 290 |
292 CPDFSDK_FormFillEnvironment::ObservedPtr m_pFormFillEnv; | 291 CPDFSDK_FormFillEnvironment::ObservedPtr m_pFormFillEnv; |
293 CFX_WideString m_cwBaseURL; | 292 CFX_WideString m_cwBaseURL; |
294 std::list<std::unique_ptr<CJS_DelayData>> m_DelayData; | 293 std::list<std::unique_ptr<CJS_DelayData>> m_DelayData; |
295 std::vector<IconElement> m_Icons; | 294 std::list<std::unique_ptr<IconElement>> m_IconList; |
296 bool m_bDelay; | 295 bool m_bDelay; |
297 }; | 296 }; |
298 | 297 |
299 class CJS_Document : public CJS_Object { | 298 class CJS_Document : public CJS_Object { |
300 public: | 299 public: |
301 explicit CJS_Document(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} | 300 explicit CJS_Document(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} |
302 ~CJS_Document() override {} | 301 ~CJS_Document() override {} |
303 | 302 |
304 // CJS_Object | 303 // CJS_Object |
305 void InitInstance(IJS_Runtime* pIRuntime) override; | 304 void InitInstance(IJS_Runtime* pIRuntime) override; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 JS_STATIC_METHOD(replacePages, Document); | 376 JS_STATIC_METHOD(replacePages, Document); |
378 JS_STATIC_METHOD(removeIcon, Document); | 377 JS_STATIC_METHOD(removeIcon, Document); |
379 JS_STATIC_METHOD(resetForm, Document); | 378 JS_STATIC_METHOD(resetForm, Document); |
380 JS_STATIC_METHOD(saveAs, Document); | 379 JS_STATIC_METHOD(saveAs, Document); |
381 JS_STATIC_METHOD(submitForm, Document); | 380 JS_STATIC_METHOD(submitForm, Document); |
382 JS_STATIC_METHOD(syncAnnotScan, Document); | 381 JS_STATIC_METHOD(syncAnnotScan, Document); |
383 JS_STATIC_METHOD(mailDoc, Document); | 382 JS_STATIC_METHOD(mailDoc, Document); |
384 }; | 383 }; |
385 | 384 |
386 #endif // FPDFSDK_JAVASCRIPT_DOCUMENT_H_ | 385 #endif // FPDFSDK_JAVASCRIPT_DOCUMENT_H_ |
OLD | NEW |