| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 virtual void SubmitForm(const std::string& url, | 133 virtual void SubmitForm(const std::string& url, |
| 134 const void* data, | 134 const void* data, |
| 135 int length) = 0; | 135 int length) = 0; |
| 136 | 136 |
| 137 // Pops up a file selection dialog and returns the result. | 137 // Pops up a file selection dialog and returns the result. |
| 138 virtual std::string ShowFileSelectionDialog() = 0; | 138 virtual std::string ShowFileSelectionDialog() = 0; |
| 139 | 139 |
| 140 // Creates and returns new URL loader for partial document requests. | 140 // Creates and returns new URL loader for partial document requests. |
| 141 virtual pp::URLLoader CreateURLLoader() = 0; | 141 virtual pp::URLLoader CreateURLLoader() = 0; |
| 142 | 142 |
| 143 // Calls the client's OnCallback() function in delay_in_ms with the given | 143 // Calls the client's OnCallback() function in |delay_in_ms| with the given |
| 144 // id. | 144 // |id|. |
| 145 virtual void ScheduleCallback(int id, int delay_in_ms) = 0; | 145 virtual void ScheduleCallback(int id, int delay_in_ms) = 0; |
| 146 // Calls the client's OnTouchTimerCallback() function in |delay_in_ms| with |
| 147 // the given |id|. |
| 148 virtual void ScheduleTouchTimerCallback(int id, int delay_in_ms) = 0; |
| 146 | 149 |
| 147 // Searches the given string for "term" and returns the results. Unicode- | 150 // Searches the given string for "term" and returns the results. Unicode- |
| 148 // aware. | 151 // aware. |
| 149 struct SearchStringResult { | 152 struct SearchStringResult { |
| 150 int start_index; | 153 int start_index; |
| 151 int length; | 154 int length; |
| 152 }; | 155 }; |
| 153 virtual void SearchString(const base::char16* string, | 156 virtual void SearchString(const base::char16* string, |
| 154 const base::char16* term, | 157 const base::char16* term, |
| 155 bool case_sensitive, | 158 bool case_sensitive, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 // Returns a page's rect in screen coordinates, as well as its surrounding | 247 // Returns a page's rect in screen coordinates, as well as its surrounding |
| 245 // border areas and bottom separator. | 248 // border areas and bottom separator. |
| 246 virtual pp::Rect GetPageScreenRect(int page_index) const = 0; | 249 virtual pp::Rect GetPageScreenRect(int page_index) const = 0; |
| 247 // Gets the offset of the vertical scrollbar from the top in document | 250 // Gets the offset of the vertical scrollbar from the top in document |
| 248 // coordinates. | 251 // coordinates. |
| 249 virtual int GetVerticalScrollbarYPosition() = 0; | 252 virtual int GetVerticalScrollbarYPosition() = 0; |
| 250 // Set color / grayscale rendering modes. | 253 // Set color / grayscale rendering modes. |
| 251 virtual void SetGrayscale(bool grayscale) = 0; | 254 virtual void SetGrayscale(bool grayscale) = 0; |
| 252 // Callback for timer that's set with ScheduleCallback(). | 255 // Callback for timer that's set with ScheduleCallback(). |
| 253 virtual void OnCallback(int id) = 0; | 256 virtual void OnCallback(int id) = 0; |
| 257 // Callback for timer that's set with ScheduleTouchTimerCallback(). |
| 258 virtual void OnTouchTimerCallback(int id) = 0; |
| 254 // Get the number of characters on a given page. | 259 // Get the number of characters on a given page. |
| 255 virtual int GetCharCount(int page_index) = 0; | 260 virtual int GetCharCount(int page_index) = 0; |
| 256 // Get the bounds in page pixels of a character on a given page. | 261 // Get the bounds in page pixels of a character on a given page. |
| 257 virtual pp::FloatRect GetCharBounds(int page_index, int char_index) = 0; | 262 virtual pp::FloatRect GetCharBounds(int page_index, int char_index) = 0; |
| 258 // Get a given unicode character on a given page. | 263 // Get a given unicode character on a given page. |
| 259 virtual uint32_t GetCharUnicode(int page_index, int char_index) = 0; | 264 virtual uint32_t GetCharUnicode(int page_index, int char_index) = 0; |
| 260 // Given a start char index, find the longest continuous run of text that's | 265 // Given a start char index, find the longest continuous run of text that's |
| 261 // in a single direction and with the same style and font size. Return the | 266 // in a single direction and with the same style and font size. Return the |
| 262 // length of that sequence and its font size and bounding box. | 267 // length of that sequence and its font size and bounding box. |
| 263 virtual void GetTextRunInfo(int page_index, | 268 virtual void GetTextRunInfo(int page_index, |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 367 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
| 363 int pdf_buffer_size, | 368 int pdf_buffer_size, |
| 364 int page_number, | 369 int page_number, |
| 365 double* width, | 370 double* width, |
| 366 double* height) = 0; | 371 double* height) = 0; |
| 367 }; | 372 }; |
| 368 | 373 |
| 369 } // namespace chrome_pdf | 374 } // namespace chrome_pdf |
| 370 | 375 |
| 371 #endif // PDF_PDF_ENGINE_H_ | 376 #endif // PDF_PDF_ENGINE_H_ |
| OLD | NEW |