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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 const PP_PrintSettings_Dev& print_settings) override; | 70 const PP_PrintSettings_Dev& print_settings) override; |
71 void PrintEnd() override; | 71 void PrintEnd() override; |
72 void StartFind(const std::string& text, bool case_sensitive) override; | 72 void StartFind(const std::string& text, bool case_sensitive) override; |
73 bool SelectFindResult(bool forward) override; | 73 bool SelectFindResult(bool forward) override; |
74 void StopFind() override; | 74 void StopFind() override; |
75 void ZoomUpdated(double new_zoom_level) override; | 75 void ZoomUpdated(double new_zoom_level) override; |
76 void RotateClockwise() override; | 76 void RotateClockwise() override; |
77 void RotateCounterclockwise() override; | 77 void RotateCounterclockwise() override; |
78 std::string GetSelectedText() override; | 78 std::string GetSelectedText() override; |
79 std::string GetLinkAtPosition(const pp::Point& point) override; | 79 std::string GetLinkAtPosition(const pp::Point& point) override; |
| 80 bool IsSelecting() override; |
80 bool HasPermission(DocumentPermission permission) const override; | 81 bool HasPermission(DocumentPermission permission) const override; |
81 void SelectAll() override; | 82 void SelectAll() override; |
82 int GetNumberOfPages() override; | 83 int GetNumberOfPages() override; |
83 pp::VarArray GetBookmarks() override; | 84 pp::VarArray GetBookmarks() override; |
84 int GetNamedDestinationPage(const std::string& destination) override; | 85 int GetNamedDestinationPage(const std::string& destination) override; |
| 86 int GetFirstVisiblePage() override; |
85 int GetMostVisiblePage() override; | 87 int GetMostVisiblePage() override; |
86 pp::Rect GetPageRect(int index) override; | 88 pp::Rect GetPageRect(int index) override; |
87 pp::Rect GetPageContentsRect(int index) override; | 89 pp::Rect GetPageContentsRect(int index) override; |
88 pp::Rect GetPageScreenRect(int page_index) const override; | 90 pp::Rect GetPageScreenRect(int page_index) const override; |
89 int GetVerticalScrollbarYPosition() override { return position_.y(); } | 91 int GetVerticalScrollbarYPosition() override { return position_.y(); } |
| 92 void PaintThumbnail(pp::ImageData* image_data, int index) override; |
90 void SetGrayscale(bool grayscale) override; | 93 void SetGrayscale(bool grayscale) override; |
91 void OnCallback(int id) override; | 94 void OnCallback(int id) override; |
92 std::string GetPageAsJSON(int index) override; | 95 std::string GetPageAsJSON(int index) override; |
93 bool GetPrintScaling() override; | 96 bool GetPrintScaling() override; |
94 int GetCopiesToPrint() override; | 97 int GetCopiesToPrint() override; |
95 int GetDuplexType() override; | 98 int GetDuplexType() override; |
96 bool GetPageSizeAndUniformity(pp::Size* size) override; | 99 bool GetPageSizeAndUniformity(pp::Size* size) override; |
97 void AppendBlankPages(int num_pages) override; | 100 void AppendBlankPages(int num_pages) override; |
98 void AppendPage(PDFEngine* engine, int index) override; | 101 void AppendPage(PDFEngine* engine, int index) override; |
99 pp::Point GetScrollPosition() override; | 102 pp::Point GetScrollPosition() override; |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 pp::Size default_page_size_; | 663 pp::Size default_page_size_; |
661 | 664 |
662 // Used to manage timers that form fill API needs. The pair holds the timer | 665 // Used to manage timers that form fill API needs. The pair holds the timer |
663 // period, in ms, and the callback function. | 666 // period, in ms, and the callback function. |
664 std::map<int, std::pair<int, TimerCallback> > timers_; | 667 std::map<int, std::pair<int, TimerCallback> > timers_; |
665 int next_timer_id_; | 668 int next_timer_id_; |
666 | 669 |
667 // Holds the page index of the last page that the mouse clicked on. | 670 // Holds the page index of the last page that the mouse clicked on. |
668 int last_page_mouse_down_; | 671 int last_page_mouse_down_; |
669 | 672 |
| 673 // Holds the page index of the first visible page; refreshed by calling |
| 674 // CalculateVisiblePages() |
| 675 int first_visible_page_; |
| 676 |
670 // Holds the page index of the most visible page; refreshed by calling | 677 // Holds the page index of the most visible page; refreshed by calling |
671 // CalculateVisiblePages() | 678 // CalculateVisiblePages() |
672 int most_visible_page_; | 679 int most_visible_page_; |
673 | 680 |
674 // Set to true after FORM_DoDocumentJSAction/FORM_DoDocumentOpenAction have | 681 // Set to true after FORM_DoDocumentJSAction/FORM_DoDocumentOpenAction have |
675 // been called. Only after that can we call FORM_DoPageAAction. | 682 // been called. Only after that can we call FORM_DoPageAAction. |
676 bool called_do_document_action_; | 683 bool called_do_document_action_; |
677 | 684 |
678 // Records parts of form fields that need to be highlighted at next paint, in | 685 // Records parts of form fields that need to be highlighted at next paint, in |
679 // screen coordinates. | 686 // screen coordinates. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 755 bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
749 int pdf_buffer_size, | 756 int pdf_buffer_size, |
750 int page_number, | 757 int page_number, |
751 double* width, | 758 double* width, |
752 double* height) override; | 759 double* height) override; |
753 }; | 760 }; |
754 | 761 |
755 } // namespace chrome_pdf | 762 } // namespace chrome_pdf |
756 | 763 |
757 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ | 764 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ |
OLD | NEW |