OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_RANGE_H_ | 5 #ifndef PDF_PDFIUM_PDFIUM_RANGE_H_ |
6 #define PDF_PDFIUM_PDFIUM_RANGE_H_ | 6 #define PDF_PDFIUM_PDFIUM_RANGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 int page_index() const { return page_->index(); } | 27 int page_index() const { return page_->index(); } |
28 int char_index() const { return char_index_; } | 28 int char_index() const { return char_index_; } |
29 int char_count() const { return char_count_; } | 29 int char_count() const { return char_count_; } |
30 | 30 |
31 // Gets bounding rectangles of range in screen coordinates. | 31 // Gets bounding rectangles of range in screen coordinates. |
32 std::vector<pp::Rect> GetScreenRects(const pp::Point& offset, | 32 std::vector<pp::Rect> GetScreenRects(const pp::Point& offset, |
33 double zoom, | 33 double zoom, |
34 int rotation); | 34 int rotation); |
35 | 35 |
36 // Gets the string of characters in this range. | 36 // Gets the string of characters in this range. |
37 base::string16 GetText(); | 37 base::string16 GetText() const; |
38 | 38 |
39 private: | 39 private: |
40 PDFiumPage* page_; | 40 PDFiumPage* page_; |
41 // Index of first character. | 41 // Index of first character. |
42 int char_index_; | 42 int char_index_; |
43 // How many characters are part of this range (negative if backwards). | 43 // How many characters are part of this range (negative if backwards). |
44 int char_count_; | 44 int char_count_; |
45 | 45 |
46 // Cache of ScreenRect, and the associated variables used when caching it. | 46 // Cache of ScreenRect, and the associated variables used when caching it. |
47 std::vector<pp::Rect> cached_screen_rects_; | 47 std::vector<pp::Rect> cached_screen_rects_; |
48 pp::Point cached_screen_rects_offset_; | 48 pp::Point cached_screen_rects_offset_; |
49 double cached_screen_rects_zoom_; | 49 double cached_screen_rects_zoom_; |
50 }; | 50 }; |
51 | 51 |
52 } // namespace chrome_pdf | 52 } // namespace chrome_pdf |
53 | 53 |
54 #endif // PDF_PDFIUM_PDFIUM_RANGE_H_ | 54 #endif // PDF_PDFIUM_PDFIUM_RANGE_H_ |
OLD | NEW |