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_PAGE_H_ | 5 #ifndef PDF_PDFIUM_PDFIUM_PAGE_H_ |
6 #define PDF_PDFIUM_PDFIUM_PAGE_H_ | 6 #define PDF_PDFIUM_PDFIUM_PAGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 FPDF_PAGE GetPrintPage(); | 39 FPDF_PAGE GetPrintPage(); |
40 // Close the printing page. | 40 // Close the printing page. |
41 void ClosePrintPage(); | 41 void ClosePrintPage(); |
42 | 42 |
43 // Returns FPDF_TEXTPAGE for the page, loading and parsing it if necessary. | 43 // Returns FPDF_TEXTPAGE for the page, loading and parsing it if necessary. |
44 FPDF_TEXTPAGE GetTextPage(); | 44 FPDF_TEXTPAGE GetTextPage(); |
45 | 45 |
46 // Returns a DictionaryValue version of the page. | 46 // Returns a DictionaryValue version of the page. |
47 base::Value* GetAccessibleContentAsValue(int rotation); | 47 base::Value* GetAccessibleContentAsValue(int rotation); |
48 | 48 |
| 49 // Given a start char index, find the longest continuous run of text that's |
| 50 // in a single direction and with the same style and font size. Return the |
| 51 // length of that sequence and its font size and bounding box. |
| 52 void GetTextRunInfo(int start_char_index, |
| 53 uint32_t* out_len, |
| 54 double* out_font_size, |
| 55 pp::FloatRect* out_bounds); |
| 56 // Get a unicode character from the page. |
| 57 uint32_t GetCharUnicode(int char_index); |
| 58 // Get the width of a character in page pixels. |
| 59 double GetCharWidth(int char_index); |
| 60 |
49 enum Area { | 61 enum Area { |
50 NONSELECTABLE_AREA, | 62 NONSELECTABLE_AREA, |
51 TEXT_AREA, | 63 TEXT_AREA, |
52 WEBLINK_AREA, // Area is a hyperlink. | 64 WEBLINK_AREA, // Area is a hyperlink. |
53 DOCLINK_AREA, // Area is a link to a different part of the same document. | 65 DOCLINK_AREA, // Area is a link to a different part of the same document. |
54 }; | 66 }; |
55 | 67 |
56 struct LinkTarget { | 68 struct LinkTarget { |
57 // We are using std::string here which have a copy contructor. | 69 // We are using std::string here which have a copy contructor. |
58 // That prevents us from using union here. | 70 // That prevents us from using union here. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 int loading_count_; | 144 int loading_count_; |
133 pp::Rect rect_; | 145 pp::Rect rect_; |
134 bool calculated_links_; | 146 bool calculated_links_; |
135 std::vector<Link> links_; | 147 std::vector<Link> links_; |
136 bool available_; | 148 bool available_; |
137 }; | 149 }; |
138 | 150 |
139 } // namespace chrome_pdf | 151 } // namespace chrome_pdf |
140 | 152 |
141 #endif // PDF_PDFIUM_PDFIUM_PAGE_H_ | 153 #endif // PDF_PDFIUM_PDFIUM_PAGE_H_ |
OLD | NEW |