| 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 bool GetTextRunInfo(int start_char_index, |
| 53 uint32_t* out_len, |
| 54 double* out_font_size, |
| 55 pp::FloatRect* out_bounds); |
| 56 // Get the width of a character in page pixels. |
| 57 double GetCharWidth(int char_index); |
| 58 |
| 49 enum Area { | 59 enum Area { |
| 50 NONSELECTABLE_AREA, | 60 NONSELECTABLE_AREA, |
| 51 TEXT_AREA, | 61 TEXT_AREA, |
| 52 WEBLINK_AREA, // Area is a hyperlink. | 62 WEBLINK_AREA, // Area is a hyperlink. |
| 53 DOCLINK_AREA, // Area is a link to a different part of the same document. | 63 DOCLINK_AREA, // Area is a link to a different part of the same document. |
| 54 }; | 64 }; |
| 55 | 65 |
| 56 struct LinkTarget { | 66 struct LinkTarget { |
| 57 // We are using std::string here which have a copy contructor. | 67 // We are using std::string here which have a copy contructor. |
| 58 // That prevents us from using union here. | 68 // That prevents us from using union here. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 int loading_count_; | 142 int loading_count_; |
| 133 pp::Rect rect_; | 143 pp::Rect rect_; |
| 134 bool calculated_links_; | 144 bool calculated_links_; |
| 135 std::vector<Link> links_; | 145 std::vector<Link> links_; |
| 136 bool available_; | 146 bool available_; |
| 137 }; | 147 }; |
| 138 | 148 |
| 139 } // namespace chrome_pdf | 149 } // namespace chrome_pdf |
| 140 | 150 |
| 141 #endif // PDF_PDFIUM_PDFIUM_PAGE_H_ | 151 #endif // PDF_PDFIUM_PDFIUM_PAGE_H_ |
| OLD | NEW |