| 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_PDFIUM_PDFIUM_ENGINE_H_ | 5 #ifndef PDF_PDFIUM_PDFIUM_ENGINE_H_ |
| 6 #define PDF_PDFIUM_PDFIUM_ENGINE_H_ | 6 #define PDF_PDFIUM_PDFIUM_ENGINE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 virtual bool IsSelecting(); | 77 virtual bool IsSelecting(); |
| 78 virtual bool HasPermission(DocumentPermission permission) const; | 78 virtual bool HasPermission(DocumentPermission permission) const; |
| 79 virtual void SelectAll(); | 79 virtual void SelectAll(); |
| 80 virtual int GetNumberOfPages(); | 80 virtual int GetNumberOfPages(); |
| 81 virtual pp::VarArray GetBookmarks(); | 81 virtual pp::VarArray GetBookmarks(); |
| 82 virtual int GetNamedDestinationPage(const std::string& destination); | 82 virtual int GetNamedDestinationPage(const std::string& destination); |
| 83 virtual int GetFirstVisiblePage(); | 83 virtual int GetFirstVisiblePage(); |
| 84 virtual int GetMostVisiblePage(); | 84 virtual int GetMostVisiblePage(); |
| 85 virtual pp::Rect GetPageRect(int index); | 85 virtual pp::Rect GetPageRect(int index); |
| 86 virtual pp::Rect GetPageContentsRect(int index); | 86 virtual pp::Rect GetPageContentsRect(int index); |
| 87 virtual pp::Rect GetPageScreenRect(int page_index) const; | |
| 88 virtual int GetVerticalScrollbarYPosition() { return position_.y(); } | 87 virtual int GetVerticalScrollbarYPosition() { return position_.y(); } |
| 89 virtual void PaintThumbnail(pp::ImageData* image_data, int index); | 88 virtual void PaintThumbnail(pp::ImageData* image_data, int index); |
| 90 virtual void SetGrayscale(bool grayscale); | 89 virtual void SetGrayscale(bool grayscale); |
| 91 virtual void OnCallback(int id); | 90 virtual void OnCallback(int id); |
| 92 virtual std::string GetPageAsJSON(int index); | 91 virtual std::string GetPageAsJSON(int index); |
| 93 virtual bool GetPrintScaling(); | 92 virtual bool GetPrintScaling(); |
| 94 virtual int GetCopiesToPrint(); | 93 virtual int GetCopiesToPrint(); |
| 95 virtual int GetDuplexType(); | 94 virtual int GetDuplexType(); |
| 96 virtual bool GetPageSizeAndUniformity(pp::Size* size); | 95 virtual bool GetPageSizeAndUniformity(pp::Size* size); |
| 97 virtual void AppendBlankPages(int num_pages); | 96 virtual void AppendBlankPages(int num_pages); |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 // units that PDFium rendering functions expect. | 366 // units that PDFium rendering functions expect. |
| 368 void GetPDFiumRect(int page_index, const pp::Rect& rect, int* start_x, | 367 void GetPDFiumRect(int page_index, const pp::Rect& rect, int* start_x, |
| 369 int* start_y, int* size_x, int* size_y) const; | 368 int* start_y, int* size_x, int* size_y) const; |
| 370 | 369 |
| 371 // Returns the rendering flags to pass to PDFium. | 370 // Returns the rendering flags to pass to PDFium. |
| 372 int GetRenderingFlags() const; | 371 int GetRenderingFlags() const; |
| 373 | 372 |
| 374 // Returns the currently visible rectangle in document coordinates. | 373 // Returns the currently visible rectangle in document coordinates. |
| 375 pp::Rect GetVisibleRect() const; | 374 pp::Rect GetVisibleRect() const; |
| 376 | 375 |
| 376 // Returns a page's rect in screen coordinates, as well as its surrounding |
| 377 // border areas and bottom separator. |
| 378 pp::Rect GetPageScreenRect(int page_index) const; |
| 379 |
| 377 // Given a rectangle in document coordinates, returns the rectange into screen | 380 // Given a rectangle in document coordinates, returns the rectange into screen |
| 378 // coordinates (i.e. 0,0 is top left corner of plugin area). If it's not | 381 // coordinates (i.e. 0,0 is top left corner of plugin area). If it's not |
| 379 // visible, an empty rectangle is returned. | 382 // visible, an empty rectangle is returned. |
| 380 pp::Rect GetScreenRect(const pp::Rect& rect) const; | 383 pp::Rect GetScreenRect(const pp::Rect& rect) const; |
| 381 | 384 |
| 382 // Highlights the given rectangle. | 385 // Highlights the given rectangle. |
| 383 void Highlight(void* buffer, | 386 void Highlight(void* buffer, |
| 384 int stride, | 387 int stride, |
| 385 const pp::Rect& rect, | 388 const pp::Rect& rect, |
| 386 std::vector<pp::Rect>* highlighted_rects); | 389 std::vector<pp::Rect>* highlighted_rects); |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 | 754 |
| 752 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 755 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
| 753 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 756 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
| 754 int pdf_buffer_size, int page_number, | 757 int pdf_buffer_size, int page_number, |
| 755 double* width, double* height); | 758 double* width, double* height); |
| 756 }; | 759 }; |
| 757 | 760 |
| 758 } // namespace chrome_pdf | 761 } // namespace chrome_pdf |
| 759 | 762 |
| 760 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ | 763 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ |
| OLD | NEW |