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_INCLUDE_FSDK_ACTIONHANDLER_H_ | 7 #ifndef FPDFSDK_INCLUDE_FSDK_ACTIONHANDLER_H_ |
8 #define FPDFSDK_INCLUDE_FSDK_ACTIONHANDLER_H_ | 8 #define FPDFSDK_INCLUDE_FSDK_ACTIONHANDLER_H_ |
9 | 9 |
10 #include "../../core/include/fpdfdoc/fpdf_doc.h" | 10 #include "../../core/include/fpdfdoc/fpdf_doc.h" |
11 #include "../../core/include/fxcrt/fx_string.h" | 11 #include "../../core/include/fxcrt/fx_string.h" |
12 #include "../../third_party/base/nonstd_unique_ptr.h" | 12 #include "../../third_party/base/nonstd_unique_ptr.h" |
13 #include "fsdk_baseform.h" | 13 #include "fsdk_baseform.h" |
14 | 14 |
15 class CFX_PtrList; | 15 class CFX_PtrList; |
16 class CPDFDoc_Environment; | 16 class CPDFDoc_Environment; |
17 class CPDFSDK_Annot; | 17 class CPDFSDK_Annot; |
18 class CPDFSDK_Document; | 18 class CPDFSDK_Document; |
19 class CPDF_Bookmark; | 19 class CPDF_Bookmark; |
20 class CPDF_Dictionary; | 20 class CPDF_Dictionary; |
21 class IFXJS_Runtime; | 21 class IFXJS_Runtime; |
22 | 22 |
23 class CPDFSDK_FormActionHandler | 23 class CPDFSDK_FormActionHandler { |
24 { | 24 public: |
25 public: | 25 FX_BOOL DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocument); |
26 » FX_BOOL»DoAction_Hide(const CPDF_Action& action, CPDFSDK_Document* pDocu
ment); | 26 FX_BOOL DoAction_SubmitForm(const CPDF_Action& action, |
27 » FX_BOOL»DoAction_SubmitForm(const CPDF_Action& action, CPDFSDK_Document*
pDocument); | 27 CPDFSDK_Document* pDocument); |
28 » FX_BOOL»DoAction_ResetForm(const CPDF_Action& action, CPDFSDK_Document*
pDocument); | 28 FX_BOOL DoAction_ResetForm(const CPDF_Action& action, |
29 » FX_BOOL»DoAction_ImportData(const CPDF_Action& action, CPDFSDK_Document*
pDocument); | 29 CPDFSDK_Document* pDocument); |
| 30 FX_BOOL DoAction_ImportData(const CPDF_Action& action, |
| 31 CPDFSDK_Document* pDocument); |
30 }; | 32 }; |
31 | 33 |
32 class CPDFSDK_MediaActionHandler | 34 class CPDFSDK_MediaActionHandler { |
33 { | 35 public: |
34 public: | 36 FX_BOOL DoAction_Rendition(const CPDF_Action& action, |
35 » FX_BOOL»DoAction_Rendition(const CPDF_Action& action, CPDFSDK_Document*
pDocument); | 37 CPDFSDK_Document* pDocument); |
36 » FX_BOOL»DoAction_Sound(const CPDF_Action& action, CPDFSDK_Document* pDoc
ument); | 38 FX_BOOL DoAction_Sound(const CPDF_Action& action, |
37 » FX_BOOL»DoAction_Movie(const CPDF_Action& action, CPDFSDK_Document* pDoc
ument); | 39 CPDFSDK_Document* pDocument); |
| 40 FX_BOOL DoAction_Movie(const CPDF_Action& action, |
| 41 CPDFSDK_Document* pDocument); |
38 }; | 42 }; |
39 | 43 |
40 class CPDFSDK_ActionHandler | 44 class CPDFSDK_ActionHandler { |
41 { | 45 public: |
42 public: | 46 CPDFSDK_ActionHandler(CPDFDoc_Environment* pEvi); |
43 » CPDFSDK_ActionHandler(CPDFDoc_Environment* pEvi); | |
44 | 47 |
45 » void SetMediaActionHandler(CPDFSDK_MediaActionHandler* pHandler); | 48 void SetMediaActionHandler(CPDFSDK_MediaActionHandler* pHandler); |
46 | 49 |
47 » FX_BOOL»» DoAction_DocOpen(const CPDF_Action& action, CPDFSDK_Docu
ment* pDocument); | 50 FX_BOOL DoAction_DocOpen(const CPDF_Action& action, |
48 » FX_BOOL»» DoAction_JavaScript(const CPDF_Action& JsAction,CFX_Wide
String csJSName, CPDFSDK_Document* pDocument); | 51 CPDFSDK_Document* pDocument); |
49 » FX_BOOL»» DoAction_Page(const CPDF_Action& action, enum CPDF_AActi
on::AActionType eType, CPDFSDK_Document* pDocument); | 52 FX_BOOL DoAction_JavaScript(const CPDF_Action& JsAction, |
50 » FX_BOOL»» DoAction_Document(const CPDF_Action& action, enum CPDF_A
Action::AActionType eType, CPDFSDK_Document* pDocument); | 53 CFX_WideString csJSName, |
51 » FX_BOOL»» DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_A
ction& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument); | 54 CPDFSDK_Document* pDocument); |
52 » FX_BOOL»» DoAction_Screen(const CPDF_Action& action, CPDF_AAction:
:AActionType type, CPDFSDK_Document* pDocument, CPDFSDK_Annot* pScreen); | 55 FX_BOOL DoAction_Page(const CPDF_Action& action, |
53 » FX_BOOL»» DoAction_Link(const CPDF_Action& action, CPDFSDK_Documen
t* pDocument); | 56 enum CPDF_AAction::AActionType eType, |
54 » FX_BOOL»» DoAction_Field(const CPDF_Action& action, CPDF_AAction::
AActionType type, CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, PDFS
DK_FieldAction& data); | 57 CPDFSDK_Document* pDocument); |
55 » FX_BOOL»» DoAction_FieldJavaScript(const CPDF_Action& JsAction, CP
DF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDF_FormField* pForm
Field, PDFSDK_FieldAction& data); | 58 FX_BOOL DoAction_Document(const CPDF_Action& action, |
| 59 enum CPDF_AAction::AActionType eType, |
| 60 CPDFSDK_Document* pDocument); |
| 61 FX_BOOL DoAction_BookMark(CPDF_Bookmark* pBookMark, |
| 62 const CPDF_Action& action, |
| 63 CPDF_AAction::AActionType type, |
| 64 CPDFSDK_Document* pDocument); |
| 65 FX_BOOL DoAction_Screen(const CPDF_Action& action, |
| 66 CPDF_AAction::AActionType type, |
| 67 CPDFSDK_Document* pDocument, |
| 68 CPDFSDK_Annot* pScreen); |
| 69 FX_BOOL DoAction_Link(const CPDF_Action& action, CPDFSDK_Document* pDocument); |
| 70 FX_BOOL DoAction_Field(const CPDF_Action& action, |
| 71 CPDF_AAction::AActionType type, |
| 72 CPDFSDK_Document* pDocument, |
| 73 CPDF_FormField* pFormField, |
| 74 PDFSDK_FieldAction& data); |
| 75 FX_BOOL DoAction_FieldJavaScript(const CPDF_Action& JsAction, |
| 76 CPDF_AAction::AActionType type, |
| 77 CPDFSDK_Document* pDocument, |
| 78 CPDF_FormField* pFormField, |
| 79 PDFSDK_FieldAction& data); |
56 | 80 |
57 private: | 81 private: |
58 » FX_BOOL»» » » ExecuteDocumentOpenAction(const CPDF_Act
ion& action, CPDFSDK_Document* pDocument, CFX_PtrList& list); | 82 FX_BOOL ExecuteDocumentOpenAction(const CPDF_Action& action, |
59 » FX_BOOL»» » » ExecuteDocumentPageAction(const CPDF_Act
ion& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CFX_P
trList& list); | 83 CPDFSDK_Document* pDocument, |
60 » FX_BOOL»» » » ExecuteFieldAction(const CPDF_Action& ac
tion, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDF_FormFie
ld* pFormField, PDFSDK_FieldAction& data, CFX_PtrList& list); | 84 CFX_PtrList& list); |
61 » FX_BOOL»» » » ExecuteScreenAction(const CPDF_Action& a
ction, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, CPDFSDK_Ann
ot* pScreen, CFX_PtrList& list); | 85 FX_BOOL ExecuteDocumentPageAction(const CPDF_Action& action, |
62 » FX_BOOL»» » » ExecuteBookMark(const CPDF_Action& actio
n, CPDFSDK_Document* pDocument, CPDF_Bookmark* pBookmark, CFX_PtrList& list); | 86 CPDF_AAction::AActionType type, |
63 » FX_BOOL»» » » ExecuteLinkAction(const CPDF_Action& act
ion, CPDFSDK_Document* pDocument, CFX_PtrList& list); | 87 CPDFSDK_Document* pDocument, |
| 88 CFX_PtrList& list); |
| 89 FX_BOOL ExecuteFieldAction(const CPDF_Action& action, |
| 90 CPDF_AAction::AActionType type, |
| 91 CPDFSDK_Document* pDocument, |
| 92 CPDF_FormField* pFormField, |
| 93 PDFSDK_FieldAction& data, |
| 94 CFX_PtrList& list); |
| 95 FX_BOOL ExecuteScreenAction(const CPDF_Action& action, |
| 96 CPDF_AAction::AActionType type, |
| 97 CPDFSDK_Document* pDocument, |
| 98 CPDFSDK_Annot* pScreen, |
| 99 CFX_PtrList& list); |
| 100 FX_BOOL ExecuteBookMark(const CPDF_Action& action, |
| 101 CPDFSDK_Document* pDocument, |
| 102 CPDF_Bookmark* pBookmark, |
| 103 CFX_PtrList& list); |
| 104 FX_BOOL ExecuteLinkAction(const CPDF_Action& action, |
| 105 CPDFSDK_Document* pDocument, |
| 106 CFX_PtrList& list); |
64 | 107 |
65 » void» » » » DoAction_NoJs(const CPDF_Action& action,
CPDFSDK_Document* pDocument); | 108 void DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Document* pDocument); |
66 » void» » » » RunDocumentPageJavaScript(CPDFSDK_Docume
nt* pDocument, CPDF_AAction::AActionType type, const CFX_WideString& script); | 109 void RunDocumentPageJavaScript(CPDFSDK_Document* pDocument, |
67 » void» » » » RunDocumentOpenJavaScript(CPDFSDK_Docume
nt* pDocument, const CFX_WideString& sScriptName, const CFX_WideString& script); | 110 CPDF_AAction::AActionType type, |
68 » void» » » » RunFieldJavaScript(CPDFSDK_Document* pDo
cument, CPDF_FormField* pFormField, CPDF_AAction::AActionType type, PDFSDK_Field
Action& data, const CFX_WideString& script); | 111 const CFX_WideString& script); |
| 112 void RunDocumentOpenJavaScript(CPDFSDK_Document* pDocument, |
| 113 const CFX_WideString& sScriptName, |
| 114 const CFX_WideString& script); |
| 115 void RunFieldJavaScript(CPDFSDK_Document* pDocument, |
| 116 CPDF_FormField* pFormField, |
| 117 CPDF_AAction::AActionType type, |
| 118 PDFSDK_FieldAction& data, |
| 119 const CFX_WideString& script); |
69 | 120 |
70 » FX_BOOL»» » » IsValidField(CPDFSDK_Document* pDocument
, CPDF_Dictionary* pFieldDict); | 121 FX_BOOL IsValidField(CPDFSDK_Document* pDocument, |
71 » FX_BOOL»» » » IsValidDocView(CPDFSDK_Document* pDocume
nt); | 122 CPDF_Dictionary* pFieldDict); |
| 123 FX_BOOL IsValidDocView(CPDFSDK_Document* pDocument); |
72 | 124 |
73 » void» » » » DoAction_GoTo(CPDFSDK_Document* pDocumen
t, const CPDF_Action& action); | 125 void DoAction_GoTo(CPDFSDK_Document* pDocument, const CPDF_Action& action); |
74 » void» » » » DoAction_GoToR(CPDFSDK_Document* pDocume
nt, const CPDF_Action& action); | 126 void DoAction_GoToR(CPDFSDK_Document* pDocument, const CPDF_Action& action); |
75 » void» » » » DoAction_Launch(CPDFSDK_Document* pDocum
ent, const CPDF_Action& action); | 127 void DoAction_Launch(CPDFSDK_Document* pDocument, const CPDF_Action& action); |
76 » void» » » » DoAction_URI(CPDFSDK_Document* pDocument
, const CPDF_Action& action); | 128 void DoAction_URI(CPDFSDK_Document* pDocument, const CPDF_Action& action); |
77 » void» » » » DoAction_Named(CPDFSDK_Document* pDocume
nt, const CPDF_Action& action); | 129 void DoAction_Named(CPDFSDK_Document* pDocument, const CPDF_Action& action); |
78 » void» » » » DoAction_SetOCGState(CPDFSDK_Document* p
Document, const CPDF_Action& action); | 130 void DoAction_SetOCGState(CPDFSDK_Document* pDocument, |
| 131 const CPDF_Action& action); |
79 | 132 |
80 nonstd::unique_ptr<CPDFSDK_FormActionHandler> m_pFormActionHandler; | 133 nonstd::unique_ptr<CPDFSDK_FormActionHandler> m_pFormActionHandler; |
81 CPDFSDK_MediaActionHandler* m_pMediaActionHandler; | 134 CPDFSDK_MediaActionHandler* m_pMediaActionHandler; |
82 }; | 135 }; |
83 | 136 |
84 #endif // FPDFSDK_INCLUDE_FSDK_ACTIONHANDLER_H_ | 137 #endif // FPDFSDK_INCLUDE_FSDK_ACTIONHANDLER_H_ |
OLD | NEW |