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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 enum DocumentPermission { | 54 enum DocumentPermission { |
55 PERMISSION_COPY, | 55 PERMISSION_COPY, |
56 PERMISSION_COPY_ACCESSIBLE, | 56 PERMISSION_COPY_ACCESSIBLE, |
57 PERMISSION_PRINT_LOW_QUALITY, | 57 PERMISSION_PRINT_LOW_QUALITY, |
58 PERMISSION_PRINT_HIGH_QUALITY, | 58 PERMISSION_PRINT_HIGH_QUALITY, |
59 }; | 59 }; |
60 | 60 |
61 // The interface that's provided to the rendering engine. | 61 // The interface that's provided to the rendering engine. |
62 class Client { | 62 class Client { |
63 public: | 63 public: |
| 64 virtual ~Client() {} |
| 65 |
64 // Informs the client about the document's size in pixels. | 66 // Informs the client about the document's size in pixels. |
65 virtual void DocumentSizeUpdated(const pp::Size& size) = 0; | 67 virtual void DocumentSizeUpdated(const pp::Size& size) = 0; |
66 | 68 |
67 // Informs the client that the given rect needs to be repainted. | 69 // Informs the client that the given rect needs to be repainted. |
68 virtual void Invalidate(const pp::Rect& rect) = 0; | 70 virtual void Invalidate(const pp::Rect& rect) = 0; |
69 | 71 |
70 // Informs the client to scroll the plugin area by the given offset. | 72 // Informs the client to scroll the plugin area by the given offset. |
71 virtual void Scroll(const pp::Point& point) = 0; | 73 virtual void Scroll(const pp::Point& point) = 0; |
72 | 74 |
73 // Scroll the horizontal/vertical scrollbars to a given position. | 75 // Scroll the horizontal/vertical scrollbars to a given position. |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 pp::Rect bounds; | 310 pp::Rect bounds; |
309 bool fit_to_bounds; | 311 bool fit_to_bounds; |
310 bool stretch_to_bounds; | 312 bool stretch_to_bounds; |
311 bool keep_aspect_ratio; | 313 bool keep_aspect_ratio; |
312 bool center_in_bounds; | 314 bool center_in_bounds; |
313 bool autorotate; | 315 bool autorotate; |
314 }; | 316 }; |
315 | 317 |
316 PDFEngineExports() {} | 318 PDFEngineExports() {} |
317 virtual ~PDFEngineExports() {} | 319 virtual ~PDFEngineExports() {} |
318 static PDFEngineExports* Create(); | 320 static PDFEngineExports* Get(); |
| 321 |
319 #if defined(OS_WIN) | 322 #if defined(OS_WIN) |
320 // See the definition of RenderPDFPageToDC in pdf.cc for details. | 323 // See the definition of RenderPDFPageToDC in pdf.cc for details. |
321 virtual bool RenderPDFPageToDC(const void* pdf_buffer, | 324 virtual bool RenderPDFPageToDC(const void* pdf_buffer, |
322 int buffer_size, | 325 int buffer_size, |
323 int page_number, | 326 int page_number, |
324 const RenderingSettings& settings, | 327 const RenderingSettings& settings, |
325 HDC dc) = 0; | 328 HDC dc) = 0; |
326 #endif // OS_WIN | 329 #endif // OS_WIN |
327 // See the definition of RenderPDFPageToBitmap in pdf.cc for details. | 330 // See the definition of RenderPDFPageToBitmap in pdf.cc for details. |
328 virtual bool RenderPDFPageToBitmap(const void* pdf_buffer, | 331 virtual bool RenderPDFPageToBitmap(const void* pdf_buffer, |
329 int pdf_buffer_size, | 332 int pdf_buffer_size, |
330 int page_number, | 333 int page_number, |
331 const RenderingSettings& settings, | 334 const RenderingSettings& settings, |
332 void* bitmap_buffer) = 0; | 335 void* bitmap_buffer) = 0; |
333 | 336 |
334 virtual bool GetPDFDocInfo(const void* pdf_buffer, | 337 virtual bool GetPDFDocInfo(const void* pdf_buffer, |
335 int buffer_size, | 338 int buffer_size, |
336 int* page_count, | 339 int* page_count, |
337 double* max_page_width) = 0; | 340 double* max_page_width) = 0; |
338 | 341 |
339 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 342 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
340 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 343 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
341 int pdf_buffer_size, int page_number, | 344 int pdf_buffer_size, int page_number, |
342 double* width, double* height) = 0; | 345 double* width, double* height) = 0; |
343 }; | 346 }; |
344 | 347 |
345 } // namespace chrome_pdf | 348 } // namespace chrome_pdf |
346 | 349 |
347 #endif // PDF_PDF_ENGINE_H_ | 350 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |