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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // the same structure. | 275 // the same structure. |
276 virtual pp::VarArray GetBookmarks() = 0; | 276 virtual pp::VarArray GetBookmarks() = 0; |
277 | 277 |
278 // Append blank pages to make a 1-page document to a |num_pages| document. | 278 // Append blank pages to make a 1-page document to a |num_pages| document. |
279 // Always retain the first page data. | 279 // Always retain the first page data. |
280 virtual void AppendBlankPages(int num_pages) = 0; | 280 virtual void AppendBlankPages(int num_pages) = 0; |
281 // Append the first page of the document loaded with the |engine| to this | 281 // Append the first page of the document loaded with the |engine| to this |
282 // document at page |index|. | 282 // document at page |index|. |
283 virtual void AppendPage(PDFEngine* engine, int index) = 0; | 283 virtual void AppendPage(PDFEngine* engine, int index) = 0; |
284 | 284 |
| 285 #if defined(PDF_USE_XFA) |
| 286 // Allow client to set scroll positions in document coordinates. Note that |
| 287 // this is meant for cases where the device scale factor changes, and not for |
| 288 // general scrolling - the engine will not repaint due to this. |
| 289 virtual void SetScrollPosition(const pp::Point& position) = 0; |
| 290 #endif |
| 291 |
285 virtual bool IsProgressiveLoad() = 0; | 292 virtual bool IsProgressiveLoad() = 0; |
286 | 293 |
287 virtual std::string GetMetadata(const std::string& key) = 0; | 294 virtual std::string GetMetadata(const std::string& key) = 0; |
288 }; | 295 }; |
289 | 296 |
290 // Interface for exports that wrap the PDF engine. | 297 // Interface for exports that wrap the PDF engine. |
291 class PDFEngineExports { | 298 class PDFEngineExports { |
292 public: | 299 public: |
293 struct RenderingSettings { | 300 struct RenderingSettings { |
294 RenderingSettings(int dpi_x, | 301 RenderingSettings(int dpi_x, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 347 |
341 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 348 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
342 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 349 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
343 int pdf_buffer_size, int page_number, | 350 int pdf_buffer_size, int page_number, |
344 double* width, double* height) = 0; | 351 double* width, double* height) = 0; |
345 }; | 352 }; |
346 | 353 |
347 } // namespace chrome_pdf | 354 } // namespace chrome_pdf |
348 | 355 |
349 #endif // PDF_PDF_ENGINE_H_ | 356 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |