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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 uint32_t* out_len, | 44 uint32_t* out_len, |
45 double* out_font_size, | 45 double* out_font_size, |
46 pp::FloatRect* out_bounds); | 46 pp::FloatRect* out_bounds); |
47 // Get a unicode character from the page. | 47 // Get a unicode character from the page. |
48 uint32_t GetCharUnicode(int char_index); | 48 uint32_t GetCharUnicode(int char_index); |
49 // Get the bounds of a character in page pixels. | 49 // Get the bounds of a character in page pixels. |
50 pp::FloatRect GetCharBounds(int char_index); | 50 pp::FloatRect GetCharBounds(int char_index); |
51 | 51 |
52 enum Area { | 52 enum Area { |
53 NONSELECTABLE_AREA, | 53 NONSELECTABLE_AREA, |
54 TEXT_AREA, | 54 TEXT_AREA, // Area contains regular, selectable text not |
55 WEBLINK_AREA, // Area is a hyperlink. | 55 // within form fields. |
56 DOCLINK_AREA, // Area is a link to a different part of the same document. | 56 WEBLINK_AREA, // Area is a hyperlink. |
| 57 DOCLINK_AREA, // Area is a link to a different part of the same |
| 58 // document. |
| 59 FORM_TEXT_AREA, // Area is a form text field or form combobox text |
| 60 // field. |
57 }; | 61 }; |
58 | 62 |
59 struct LinkTarget { | 63 struct LinkTarget { |
60 // We are using std::string here which have a copy contructor. | 64 // We are using std::string here which have a copy contructor. |
61 // That prevents us from using union here. | 65 // That prevents us from using union here. |
62 std::string url; // Valid for WEBLINK_AREA only. | 66 std::string url; // Valid for WEBLINK_AREA only. |
63 int page; // Valid for DOCLINK_AREA only. | 67 int page; // Valid for DOCLINK_AREA only. |
64 }; | 68 }; |
65 | 69 |
66 // Given a point in the document that's in this page, returns its character | 70 // Given a point in the document that's in this page, returns its character |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 int loading_count_; | 143 int loading_count_; |
140 pp::Rect rect_; | 144 pp::Rect rect_; |
141 bool calculated_links_; | 145 bool calculated_links_; |
142 std::vector<Link> links_; | 146 std::vector<Link> links_; |
143 bool available_; | 147 bool available_; |
144 }; | 148 }; |
145 | 149 |
146 } // namespace chrome_pdf | 150 } // namespace chrome_pdf |
147 | 151 |
148 #endif // PDF_PDFIUM_PDFIUM_PAGE_H_ | 152 #endif // PDF_PDFIUM_PDFIUM_PAGE_H_ |
OLD | NEW |