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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 | 176 |
177 // Notifies the client about focus changes for form text fields. | 177 // Notifies the client about focus changes for form text fields. |
178 virtual void FormTextFieldFocusChange(bool in_focus) = 0; | 178 virtual void FormTextFieldFocusChange(bool in_focus) = 0; |
179 | 179 |
180 // Returns true if the plugin has been opened within print preview. | 180 // Returns true if the plugin has been opened within print preview. |
181 virtual bool IsPrintPreview() = 0; | 181 virtual bool IsPrintPreview() = 0; |
182 | 182 |
183 // Get the background color of the PDF. | 183 // Get the background color of the PDF. |
184 virtual uint32_t GetBackgroundColor() = 0; | 184 virtual uint32_t GetBackgroundColor() = 0; |
185 | 185 |
186 virtual void CancelBrowserDownload() = 0; | |
Lei Zhang
2016/10/21 09:33:09
Document please.
snake
2016/10/21 15:13:15
Done.
| |
187 | |
186 // Sets selection status. | 188 // Sets selection status. |
187 virtual void IsSelectingChanged(bool is_selecting) {} | 189 virtual void IsSelectingChanged(bool is_selecting) {} |
188 }; | 190 }; |
189 | 191 |
190 // Factory method to create an instance of the PDF Engine. | 192 // Factory method to create an instance of the PDF Engine. |
191 static PDFEngine* Create(Client* client); | 193 static PDFEngine* Create(Client* client); |
192 | 194 |
193 virtual ~PDFEngine() {} | 195 virtual ~PDFEngine() {} |
194 | 196 |
195 // Most of these functions are similar to the Pepper functions of the same | 197 // 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... | |
288 // document at page |index|. | 290 // document at page |index|. |
289 virtual void AppendPage(PDFEngine* engine, int index) = 0; | 291 virtual void AppendPage(PDFEngine* engine, int index) = 0; |
290 | 292 |
291 #if defined(PDF_ENABLE_XFA) | 293 #if defined(PDF_ENABLE_XFA) |
292 // Allow client to set scroll positions in document coordinates. Note that | 294 // Allow client to set scroll positions in document coordinates. Note that |
293 // this is meant for cases where the device scale factor changes, and not for | 295 // this is meant for cases where the device scale factor changes, and not for |
294 // general scrolling - the engine will not repaint due to this. | 296 // general scrolling - the engine will not repaint due to this. |
295 virtual void SetScrollPosition(const pp::Point& position) = 0; | 297 virtual void SetScrollPosition(const pp::Point& position) = 0; |
296 #endif | 298 #endif |
297 | 299 |
298 virtual bool IsProgressiveLoad() = 0; | |
299 | |
300 virtual std::string GetMetadata(const std::string& key) = 0; | 300 virtual std::string GetMetadata(const std::string& key) = 0; |
301 }; | 301 }; |
302 | 302 |
303 // Interface for exports that wrap the PDF engine. | 303 // Interface for exports that wrap the PDF engine. |
304 class PDFEngineExports { | 304 class PDFEngineExports { |
305 public: | 305 public: |
306 struct RenderingSettings { | 306 struct RenderingSettings { |
307 RenderingSettings(int dpi_x, | 307 RenderingSettings(int dpi_x, |
308 int dpi_y, | 308 int dpi_y, |
309 const pp::Rect& bounds, | 309 const pp::Rect& bounds, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
356 | 356 |
357 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 357 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
358 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 358 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
359 int pdf_buffer_size, int page_number, | 359 int pdf_buffer_size, int page_number, |
360 double* width, double* height) = 0; | 360 double* width, double* height) = 0; |
361 }; | 361 }; |
362 | 362 |
363 } // namespace chrome_pdf | 363 } // namespace chrome_pdf |
364 | 364 |
365 #endif // PDF_PDF_ENGINE_H_ | 365 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |