OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 #ifndef PDF_PDF_ENGINE_H_ | 5 #ifndef PDF_PDF_ENGINE_H_ |
6 #define PDF_PDF_ENGINE_H_ | 6 #define PDF_PDF_ENGINE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 // Notifies the client about focus changes for form text fields. | 180 // Notifies the client about focus changes for form text fields. |
181 virtual void FormTextFieldFocusChange(bool in_focus) = 0; | 181 virtual void FormTextFieldFocusChange(bool in_focus) = 0; |
182 | 182 |
183 // Returns true if the plugin has been opened within print preview. | 183 // Returns true if the plugin has been opened within print preview. |
184 virtual bool IsPrintPreview() = 0; | 184 virtual bool IsPrintPreview() = 0; |
185 | 185 |
186 // Get the background color of the PDF. | 186 // Get the background color of the PDF. |
187 virtual uint32_t GetBackgroundColor() = 0; | 187 virtual uint32_t GetBackgroundColor() = 0; |
188 | 188 |
| 189 // Cancel browser initiated document download. |
| 190 virtual void CancelBrowserDownload() = 0; |
| 191 |
189 // Sets selection status. | 192 // Sets selection status. |
190 virtual void IsSelectingChanged(bool is_selecting) {} | 193 virtual void IsSelectingChanged(bool is_selecting) {} |
191 }; | 194 }; |
192 | 195 |
193 // Factory method to create an instance of the PDF Engine. | 196 // Factory method to create an instance of the PDF Engine. |
194 static PDFEngine* Create(Client* client); | 197 static PDFEngine* Create(Client* client); |
195 | 198 |
196 virtual ~PDFEngine() {} | 199 virtual ~PDFEngine() {} |
197 | 200 |
198 // Most of these functions are similar to the Pepper functions of the same | 201 // Most of these functions are similar to the Pepper functions of the same |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 // document at page |index|. | 294 // document at page |index|. |
292 virtual void AppendPage(PDFEngine* engine, int index) = 0; | 295 virtual void AppendPage(PDFEngine* engine, int index) = 0; |
293 | 296 |
294 #if defined(PDF_ENABLE_XFA) | 297 #if defined(PDF_ENABLE_XFA) |
295 // Allow client to set scroll positions in document coordinates. Note that | 298 // Allow client to set scroll positions in document coordinates. Note that |
296 // this is meant for cases where the device scale factor changes, and not for | 299 // this is meant for cases where the device scale factor changes, and not for |
297 // general scrolling - the engine will not repaint due to this. | 300 // general scrolling - the engine will not repaint due to this. |
298 virtual void SetScrollPosition(const pp::Point& position) = 0; | 301 virtual void SetScrollPosition(const pp::Point& position) = 0; |
299 #endif | 302 #endif |
300 | 303 |
301 virtual bool IsProgressiveLoad() = 0; | |
302 | |
303 virtual std::string GetMetadata(const std::string& key) = 0; | 304 virtual std::string GetMetadata(const std::string& key) = 0; |
304 }; | 305 }; |
305 | 306 |
306 // Interface for exports that wrap the PDF engine. | 307 // Interface for exports that wrap the PDF engine. |
307 class PDFEngineExports { | 308 class PDFEngineExports { |
308 public: | 309 public: |
309 struct RenderingSettings { | 310 struct RenderingSettings { |
310 RenderingSettings(int dpi_x, | 311 RenderingSettings(int dpi_x, |
311 int dpi_y, | 312 int dpi_y, |
312 const pp::Rect& bounds, | 313 const pp::Rect& bounds, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 360 |
360 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 361 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
361 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 362 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
362 int pdf_buffer_size, int page_number, | 363 int pdf_buffer_size, int page_number, |
363 double* width, double* height) = 0; | 364 double* width, double* height) = 0; |
364 }; | 365 }; |
365 | 366 |
366 } // namespace chrome_pdf | 367 } // namespace chrome_pdf |
367 | 368 |
368 #endif // PDF_PDF_ENGINE_H_ | 369 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |