Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Side by Side Diff: fpdfsdk/include/fsdk_mgr.h

Issue 1658853002: Tidy up CPDF_DocEnvironment::JS_* methods (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Missing ! Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | fpdfsdk/src/fsdk_mgr.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_MGR_H_ 7 #ifndef FPDFSDK_INCLUDE_FSDK_MGR_H_
8 #define FPDFSDK_INCLUDE_FSDK_MGR_H_ 8 #define FPDFSDK_INCLUDE_FSDK_MGR_H_
9 9
10 #include <map> 10 #include <map>
(...skipping 13 matching lines...) Expand all
24 24
25 class CFFL_IFormFiller; 25 class CFFL_IFormFiller;
26 class CPDFSDK_ActionHandler; 26 class CPDFSDK_ActionHandler;
27 class CPDFSDK_Annot; 27 class CPDFSDK_Annot;
28 class CPDFSDK_Document; 28 class CPDFSDK_Document;
29 class CPDFSDK_InterForm; 29 class CPDFSDK_InterForm;
30 class CPDFSDK_PageView; 30 class CPDFSDK_PageView;
31 class CPDFSDK_Widget; 31 class CPDFSDK_Widget;
32 class IFX_SystemHandler; 32 class IFX_SystemHandler;
33 33
34 // NOTE: |bsUTF16LE| must outlive the use of the result. Care must be taken
35 // since modifying the result would impact |bsUTF16LE|.
36 FPDF_WIDESTRING AsFPDFWideString(CFX_ByteString* bsUTF16LE);
37
34 class CPDFDoc_Environment final { 38 class CPDFDoc_Environment final {
35 public: 39 public:
36 CPDFDoc_Environment(UnderlyingDocumentType* pDoc, FPDF_FORMFILLINFO* pFFinfo); 40 CPDFDoc_Environment(UnderlyingDocumentType* pDoc, FPDF_FORMFILLINFO* pFFinfo);
37 ~CPDFDoc_Environment(); 41 ~CPDFDoc_Environment();
38 42
39 void FFI_Invalidate(FPDF_PAGE page, 43 void FFI_Invalidate(FPDF_PAGE page,
40 double left, 44 double left,
41 double top, 45 double top,
42 double right, 46 double right,
43 double bottom) { 47 double bottom) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 FX_BOOL FFI_IsCTRLKeyDown(FX_DWORD nFlag) const { 102 FX_BOOL FFI_IsCTRLKeyDown(FX_DWORD nFlag) const {
99 return (nFlag & FWL_EVENTFLAG_ControlKey) != 0; 103 return (nFlag & FWL_EVENTFLAG_ControlKey) != 0;
100 } 104 }
101 105
102 FX_BOOL FFI_IsALTKeyDown(FX_DWORD nFlag) const { 106 FX_BOOL FFI_IsALTKeyDown(FX_DWORD nFlag) const {
103 return (nFlag & FWL_EVENTFLAG_AltKey) != 0; 107 return (nFlag & FWL_EVENTFLAG_AltKey) != 0;
104 } 108 }
105 109
106 FX_BOOL FFI_IsINSERTKeyDown(FX_DWORD nFlag) const { return FALSE; } 110 FX_BOOL FFI_IsINSERTKeyDown(FX_DWORD nFlag) const { return FALSE; }
107 111
108 int JS_appAlert(const FX_WCHAR* Msg,
109 const FX_WCHAR* Title,
110 FX_UINT Type,
111 FX_UINT Icon);
112 int JS_appResponse(const FX_WCHAR* Question,
113 const FX_WCHAR* Title,
114 const FX_WCHAR* Default,
115 const FX_WCHAR* cLabel,
116 FPDF_BOOL bPassword,
117 void* response,
118 int length);
119
120 void JS_appBeep(int nType) {
121 if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_beep)
122 m_pInfo->m_pJsPlatform->app_beep(m_pInfo->m_pJsPlatform, nType);
123 }
124
125 CFX_WideString JS_fieldBrowse();
126 CFX_WideString JS_docGetFilePath();
127
128 void JS_docSubmitForm(void* formData, int length, const FX_WCHAR* URL);
129 void JS_docmailForm(void* mailData,
130 int length,
131 FPDF_BOOL bUI,
132 const FX_WCHAR* To,
133 const FX_WCHAR* Subject,
134 const FX_WCHAR* CC,
135 const FX_WCHAR* BCC,
136 const FX_WCHAR* Msg);
137
138 void JS_docprint(FPDF_BOOL bUI,
139 int nStart,
140 int nEnd,
141 FPDF_BOOL bSilent,
142 FPDF_BOOL bShrinkToFit,
143 FPDF_BOOL bPrintAsImage,
144 FPDF_BOOL bReverse,
145 FPDF_BOOL bAnnotations) {
146 if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_print)
147 m_pInfo->m_pJsPlatform->Doc_print(m_pInfo->m_pJsPlatform, bUI, nStart,
148 nEnd, bSilent, bShrinkToFit,
149 bPrintAsImage, bReverse, bAnnotations);
150 }
151
152 void JS_docgotoPage(int nPageNum) {
153 if (m_pInfo && m_pInfo->m_pJsPlatform &&
154 m_pInfo->m_pJsPlatform->Doc_gotoPage)
155 m_pInfo->m_pJsPlatform->Doc_gotoPage(m_pInfo->m_pJsPlatform, nPageNum);
156 }
157
158 FPDF_PAGE FFI_GetPage(FPDF_DOCUMENT document, int nPageIndex) { 112 FPDF_PAGE FFI_GetPage(FPDF_DOCUMENT document, int nPageIndex) {
159 if (m_pInfo && m_pInfo->FFI_GetPage) 113 if (m_pInfo && m_pInfo->FFI_GetPage)
160 return m_pInfo->FFI_GetPage(m_pInfo, document, nPageIndex); 114 return m_pInfo->FFI_GetPage(m_pInfo, document, nPageIndex);
161 return NULL; 115 return NULL;
162 } 116 }
163 117
164 FPDF_PAGE FFI_GetCurrentPage(FPDF_DOCUMENT document) { 118 FPDF_PAGE FFI_GetCurrentPage(FPDF_DOCUMENT document) {
165 if (m_pInfo && m_pInfo->FFI_GetCurrentPage) 119 if (m_pInfo && m_pInfo->FFI_GetCurrentPage)
166 return m_pInfo->FFI_GetCurrentPage(m_pInfo, document); 120 return m_pInfo->FFI_GetCurrentPage(m_pInfo, document);
167 return NULL; 121 return NULL;
(...skipping 25 matching lines...) Expand all
193 147
194 void FFI_DoGoToAction(int nPageIndex, 148 void FFI_DoGoToAction(int nPageIndex,
195 int zoomMode, 149 int zoomMode,
196 float* fPosArray, 150 float* fPosArray,
197 int sizeOfArray) { 151 int sizeOfArray) {
198 if (m_pInfo && m_pInfo->FFI_DoGoToAction) 152 if (m_pInfo && m_pInfo->FFI_DoGoToAction)
199 m_pInfo->FFI_DoGoToAction(m_pInfo, nPageIndex, zoomMode, fPosArray, 153 m_pInfo->FFI_DoGoToAction(m_pInfo, nPageIndex, zoomMode, fPosArray,
200 sizeOfArray); 154 sizeOfArray);
201 } 155 }
202 156
157 int JS_appAlert(const FX_WCHAR* Msg,
158 const FX_WCHAR* Title,
159 FX_UINT Type,
160 FX_UINT Icon);
161 int JS_appResponse(const FX_WCHAR* Question,
162 const FX_WCHAR* Title,
163 const FX_WCHAR* Default,
164 const FX_WCHAR* cLabel,
165 FPDF_BOOL bPassword,
166 void* response,
167 int length);
168 void JS_appBeep(int nType);
169 CFX_WideString JS_fieldBrowse();
170 CFX_WideString JS_docGetFilePath();
171 void JS_docSubmitForm(void* formData, int length, const FX_WCHAR* URL);
172 void JS_docmailForm(void* mailData,
173 int length,
174 FPDF_BOOL bUI,
175 const FX_WCHAR* To,
176 const FX_WCHAR* Subject,
177 const FX_WCHAR* CC,
178 const FX_WCHAR* BCC,
179 const FX_WCHAR* Msg);
180 void JS_docprint(FPDF_BOOL bUI,
181 int nStart,
182 int nEnd,
183 FPDF_BOOL bSilent,
184 FPDF_BOOL bShrinkToFit,
185 FPDF_BOOL bPrintAsImage,
186 FPDF_BOOL bReverse,
187 FPDF_BOOL bAnnotations);
188 void JS_docgotoPage(int nPageNum);
189
203 FX_BOOL IsJSInitiated() const { return m_pInfo && m_pInfo->m_pJsPlatform; } 190 FX_BOOL IsJSInitiated() const { return m_pInfo && m_pInfo->m_pJsPlatform; }
204 void SetSDKDocument(CPDFSDK_Document* pFXDoc) { m_pSDKDoc = pFXDoc; } 191 void SetSDKDocument(CPDFSDK_Document* pFXDoc) { m_pSDKDoc = pFXDoc; }
205 CPDFSDK_Document* GetSDKDocument() const { return m_pSDKDoc; } 192 CPDFSDK_Document* GetSDKDocument() const { return m_pSDKDoc; }
206 UnderlyingDocumentType* GetUnderlyingDocument() const { 193 UnderlyingDocumentType* GetUnderlyingDocument() const {
207 return m_pUnderlyingDoc; 194 return m_pUnderlyingDoc;
208 } 195 }
209 CFX_ByteString GetAppName() const { return ""; } 196 CFX_ByteString GetAppName() const { return ""; }
210 IFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); } 197 IFX_SystemHandler* GetSysHandler() const { return m_pSysHandler.get(); }
211 FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; } 198 FPDF_FORMFILLINFO* GetFormFillInfo() const { return m_pInfo; }
212 199
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 CPDFSDK_Widget* m_CaptureWidget; 350 CPDFSDK_Widget* m_CaptureWidget;
364 FX_BOOL m_bEnterWidget; 351 FX_BOOL m_bEnterWidget;
365 FX_BOOL m_bExitWidget; 352 FX_BOOL m_bExitWidget;
366 FX_BOOL m_bOnWidget; 353 FX_BOOL m_bOnWidget;
367 FX_BOOL m_bValid; 354 FX_BOOL m_bValid;
368 FX_BOOL m_bLocked; 355 FX_BOOL m_bLocked;
369 FX_BOOL m_bTakeOverPage; 356 FX_BOOL m_bTakeOverPage;
370 }; 357 };
371 358
372 #endif // FPDFSDK_INCLUDE_FSDK_MGR_H_ 359 #endif // FPDFSDK_INCLUDE_FSDK_MGR_H_
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/src/fsdk_mgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698