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 // Allow client to query and reset scroll positions in document coordinates. | |
286 // Note that this is meant for cases where the device scale factor changes, | |
287 // and not for general scrolling - the engine will not repaint due to this. | |
288 virtual pp::Point GetScrollPosition() = 0; | |
289 virtual void SetScrollPosition(const pp::Point& position) = 0; | |
290 | |
291 virtual bool IsProgressiveLoad() = 0; | 285 virtual bool IsProgressiveLoad() = 0; |
292 | 286 |
293 virtual std::string GetMetadata(const std::string& key) = 0; | 287 virtual std::string GetMetadata(const std::string& key) = 0; |
294 }; | 288 }; |
295 | 289 |
296 // Interface for exports that wrap the PDF engine. | 290 // Interface for exports that wrap the PDF engine. |
297 class PDFEngineExports { | 291 class PDFEngineExports { |
298 public: | 292 public: |
299 struct RenderingSettings { | 293 struct RenderingSettings { |
300 RenderingSettings(int dpi_x, | 294 RenderingSettings(int dpi_x, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 | 340 |
347 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 341 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
348 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 342 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
349 int pdf_buffer_size, int page_number, | 343 int pdf_buffer_size, int page_number, |
350 double* width, double* height) = 0; | 344 double* width, double* height) = 0; |
351 }; | 345 }; |
352 | 346 |
353 } // namespace chrome_pdf | 347 } // namespace chrome_pdf |
354 | 348 |
355 #endif // PDF_PDF_ENGINE_H_ | 349 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |