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 | |
192 // Sets selection status. | 189 // Sets selection status. |
193 virtual void IsSelectingChanged(bool is_selecting) {} | 190 virtual void IsSelectingChanged(bool is_selecting) {} |
194 }; | 191 }; |
195 | 192 |
196 // Factory method to create an instance of the PDF Engine. | 193 // Factory method to create an instance of the PDF Engine. |
197 static PDFEngine* Create(Client* client); | 194 static PDFEngine* Create(Client* client); |
198 | 195 |
199 virtual ~PDFEngine() {} | 196 virtual ~PDFEngine() {} |
200 | 197 |
201 // Most of these functions are similar to the Pepper functions of the same | 198 // 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... |
294 // document at page |index|. | 291 // document at page |index|. |
295 virtual void AppendPage(PDFEngine* engine, int index) = 0; | 292 virtual void AppendPage(PDFEngine* engine, int index) = 0; |
296 | 293 |
297 #if defined(PDF_ENABLE_XFA) | 294 #if defined(PDF_ENABLE_XFA) |
298 // Allow client to set scroll positions in document coordinates. Note that | 295 // Allow client to set scroll positions in document coordinates. Note that |
299 // this is meant for cases where the device scale factor changes, and not for | 296 // this is meant for cases where the device scale factor changes, and not for |
300 // general scrolling - the engine will not repaint due to this. | 297 // general scrolling - the engine will not repaint due to this. |
301 virtual void SetScrollPosition(const pp::Point& position) = 0; | 298 virtual void SetScrollPosition(const pp::Point& position) = 0; |
302 #endif | 299 #endif |
303 | 300 |
| 301 virtual bool IsProgressiveLoad() = 0; |
| 302 |
304 virtual std::string GetMetadata(const std::string& key) = 0; | 303 virtual std::string GetMetadata(const std::string& key) = 0; |
305 }; | 304 }; |
306 | 305 |
307 // Interface for exports that wrap the PDF engine. | 306 // Interface for exports that wrap the PDF engine. |
308 class PDFEngineExports { | 307 class PDFEngineExports { |
309 public: | 308 public: |
310 struct RenderingSettings { | 309 struct RenderingSettings { |
311 RenderingSettings(int dpi_x, | 310 RenderingSettings(int dpi_x, |
312 int dpi_y, | 311 int dpi_y, |
313 const pp::Rect& bounds, | 312 const pp::Rect& bounds, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 361 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
363 int pdf_buffer_size, | 362 int pdf_buffer_size, |
364 int page_number, | 363 int page_number, |
365 double* width, | 364 double* width, |
366 double* height) = 0; | 365 double* height) = 0; |
367 }; | 366 }; |
368 | 367 |
369 } // namespace chrome_pdf | 368 } // namespace chrome_pdf |
370 | 369 |
371 #endif // PDF_PDF_ENGINE_H_ | 370 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |