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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 // Returns a page's rect in screen coordinates, as well as its surrounding | 240 // Returns a page's rect in screen coordinates, as well as its surrounding |
241 // border areas and bottom separator. | 241 // border areas and bottom separator. |
242 virtual pp::Rect GetPageScreenRect(int page_index) const = 0; | 242 virtual pp::Rect GetPageScreenRect(int page_index) const = 0; |
243 // Gets the offset of the vertical scrollbar from the top in document | 243 // Gets the offset of the vertical scrollbar from the top in document |
244 // coordinates. | 244 // coordinates. |
245 virtual int GetVerticalScrollbarYPosition() = 0; | 245 virtual int GetVerticalScrollbarYPosition() = 0; |
246 // Set color / grayscale rendering modes. | 246 // Set color / grayscale rendering modes. |
247 virtual void SetGrayscale(bool grayscale) = 0; | 247 virtual void SetGrayscale(bool grayscale) = 0; |
248 // Callback for timer that's set with ScheduleCallback(). | 248 // Callback for timer that's set with ScheduleCallback(). |
249 virtual void OnCallback(int id) = 0; | 249 virtual void OnCallback(int id) = 0; |
250 // Gets the JSON representation of the PDF file | |
251 virtual std::string GetPageAsJSON(int index) = 0; | |
252 // Get the number of characters on a given page. | 250 // Get the number of characters on a given page. |
253 virtual int GetCharCount(int page_index) = 0; | 251 virtual int GetCharCount(int page_index) = 0; |
254 // Get the bounds in page pixels of a character on a given page. | 252 // Get the bounds in page pixels of a character on a given page. |
255 virtual pp::FloatRect GetCharBounds(int page_index, int char_index) = 0; | 253 virtual pp::FloatRect GetCharBounds(int page_index, int char_index) = 0; |
256 // Get a given unicode character on a given page. | 254 // Get a given unicode character on a given page. |
257 virtual uint32_t GetCharUnicode(int page_index, int char_index) = 0; | 255 virtual uint32_t GetCharUnicode(int page_index, int char_index) = 0; |
258 // Given a start char index, find the longest continuous run of text that's | 256 // Given a start char index, find the longest continuous run of text that's |
259 // in a single direction and with the same style and font size. Return the | 257 // in a single direction and with the same style and font size. Return the |
260 // length of that sequence and its font size and bounding box. | 258 // length of that sequence and its font size and bounding box. |
261 virtual void GetTextRunInfo(int page_index, | 259 virtual void GetTextRunInfo(int page_index, |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 350 |
353 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 351 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
354 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 352 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
355 int pdf_buffer_size, int page_number, | 353 int pdf_buffer_size, int page_number, |
356 double* width, double* height) = 0; | 354 double* width, double* height) = 0; |
357 }; | 355 }; |
358 | 356 |
359 } // namespace chrome_pdf | 357 } // namespace chrome_pdf |
360 | 358 |
361 #endif // PDF_PDF_ENGINE_H_ | 359 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |