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