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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // empty vector otherwise. | 98 // empty vector otherwise. |
99 std::vector<int> GetLinks(pp::Rect text_area, | 99 std::vector<int> GetLinks(pp::Rect text_area, |
100 std::vector<LinkTarget>* targets); | 100 std::vector<LinkTarget>* targets); |
101 // Calculate the locations of any links on the page. | 101 // Calculate the locations of any links on the page. |
102 void CalculateLinks(); | 102 void CalculateLinks(); |
103 // Returns link type and target associated with a link. Returns | 103 // Returns link type and target associated with a link. Returns |
104 // NONSELECTABLE_AREA if link detection failed. | 104 // NONSELECTABLE_AREA if link detection failed. |
105 Area GetLinkTarget(FPDF_LINK link, LinkTarget* target); | 105 Area GetLinkTarget(FPDF_LINK link, LinkTarget* target); |
106 // Returns target associated with a destination. | 106 // Returns target associated with a destination. |
107 Area GetDestinationTarget(FPDF_DEST destination, LinkTarget* target); | 107 Area GetDestinationTarget(FPDF_DEST destination, LinkTarget* target); |
108 // Returns the text in the supplied box as a Value Node | |
109 base::Value* GetTextBoxAsValue(double page_height, double left, double top, | |
110 double right, double bottom, int rotation); | |
111 // Helper functions for JSON generation | |
112 base::Value* CreateTextNode(const std::string& text); | |
113 base::Value* CreateURLNode(const std::string& text, const std::string& url); | |
114 | 108 |
115 class ScopedLoadCounter { | 109 class ScopedLoadCounter { |
116 public: | 110 public: |
117 explicit ScopedLoadCounter(PDFiumPage* page); | 111 explicit ScopedLoadCounter(PDFiumPage* page); |
118 ~ScopedLoadCounter(); | 112 ~ScopedLoadCounter(); |
119 | 113 |
120 private: | 114 private: |
121 PDFiumPage* const page_; | 115 PDFiumPage* const page_; |
122 }; | 116 }; |
123 | 117 |
(...skipping 13 matching lines...) Expand all Loading... |
137 int loading_count_; | 131 int loading_count_; |
138 pp::Rect rect_; | 132 pp::Rect rect_; |
139 bool calculated_links_; | 133 bool calculated_links_; |
140 std::vector<Link> links_; | 134 std::vector<Link> links_; |
141 bool available_; | 135 bool available_; |
142 }; | 136 }; |
143 | 137 |
144 } // namespace chrome_pdf | 138 } // namespace chrome_pdf |
145 | 139 |
146 #endif // PDF_PDFIUM_PDFIUM_PAGE_H_ | 140 #endif // PDF_PDFIUM_PDFIUM_PAGE_H_ |
OLD | NEW |