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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 250 // Gets the JSON representation of the PDF file |
251 virtual std::string GetPageAsJSON(int index) = 0; | 251 virtual std::string GetPageAsJSON(int index) = 0; |
252 // Get the number of characters on a given page. | 252 // Get the number of characters on a given page. |
253 virtual int GetCharCount(int page_index) = 0; | 253 virtual int GetCharCount(int page_index) = 0; |
254 // Get the width in pixels of a character on a given page. | 254 // Get the bounds in page pixels of a character on a given page. |
255 virtual double GetCharWidth(int page_index, int char_index) = 0; | 255 virtual pp::FloatRect GetCharBounds(int page_index, int char_index) = 0; |
256 // Get a given unicode character on a given page. | 256 // Get a given unicode character on a given page. |
257 virtual uint32_t GetCharUnicode(int page_index, int char_index) = 0; | 257 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 | 258 // 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 | 259 // 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. | 260 // length of that sequence and its font size and bounding box. |
261 virtual void GetTextRunInfo(int page_index, | 261 virtual void GetTextRunInfo(int page_index, |
262 int start_char_index, | 262 int start_char_index, |
263 uint32_t* out_len, | 263 uint32_t* out_len, |
264 double* out_font_size, | 264 double* out_font_size, |
265 pp::FloatRect* out_bounds) = 0; | 265 pp::FloatRect* out_bounds) = 0; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 352 |
353 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 353 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
354 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 354 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
355 int pdf_buffer_size, int page_number, | 355 int pdf_buffer_size, int page_number, |
356 double* width, double* height) = 0; | 356 double* width, double* height) = 0; |
357 }; | 357 }; |
358 | 358 |
359 } // namespace chrome_pdf | 359 } // namespace chrome_pdf |
360 | 360 |
361 #endif // PDF_PDF_ENGINE_H_ | 361 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |