OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PDF_ENGINE_H_ | 5 #ifndef PDF_PDF_ENGINE_H_ |
6 #define PDF_PDF_ENGINE_H_ | 6 #define PDF_PDF_ENGINE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 const PP_PrintSettings_Dev& print_settings) = 0; | 215 const PP_PrintSettings_Dev& print_settings) = 0; |
216 virtual void PrintEnd() = 0; | 216 virtual void PrintEnd() = 0; |
217 virtual void StartFind(const std::string& text, bool case_sensitive) = 0; | 217 virtual void StartFind(const std::string& text, bool case_sensitive) = 0; |
218 virtual bool SelectFindResult(bool forward) = 0; | 218 virtual bool SelectFindResult(bool forward) = 0; |
219 virtual void StopFind() = 0; | 219 virtual void StopFind() = 0; |
220 virtual void ZoomUpdated(double new_zoom_level) = 0; | 220 virtual void ZoomUpdated(double new_zoom_level) = 0; |
221 virtual void RotateClockwise() = 0; | 221 virtual void RotateClockwise() = 0; |
222 virtual void RotateCounterclockwise() = 0; | 222 virtual void RotateCounterclockwise() = 0; |
223 virtual std::string GetSelectedText() = 0; | 223 virtual std::string GetSelectedText() = 0; |
224 virtual std::string GetLinkAtPosition(const pp::Point& point) = 0; | 224 virtual std::string GetLinkAtPosition(const pp::Point& point) = 0; |
225 virtual bool IsSelecting() = 0; | |
226 // Checks the permissions associated with this document. | 225 // Checks the permissions associated with this document. |
227 virtual bool HasPermission(DocumentPermission permission) const = 0; | 226 virtual bool HasPermission(DocumentPermission permission) const = 0; |
228 virtual void SelectAll() = 0; | 227 virtual void SelectAll() = 0; |
229 // Gets the number of pages in the document. | 228 // Gets the number of pages in the document. |
230 virtual int GetNumberOfPages() = 0; | 229 virtual int GetNumberOfPages() = 0; |
231 // Gets the 0-based page number of |destination|, or -1 if it does not exist. | 230 // Gets the 0-based page number of |destination|, or -1 if it does not exist. |
232 virtual int GetNamedDestinationPage(const std::string& destination) = 0; | 231 virtual int GetNamedDestinationPage(const std::string& destination) = 0; |
233 // Gets the index of the first visible page, or -1 if none are visible. | |
234 virtual int GetFirstVisiblePage() = 0; | |
235 // Gets the index of the most visible page, or -1 if none are visible. | 232 // Gets the index of the most visible page, or -1 if none are visible. |
236 virtual int GetMostVisiblePage() = 0; | 233 virtual int GetMostVisiblePage() = 0; |
237 // Gets the rectangle of the page including shadow. | 234 // Gets the rectangle of the page including shadow. |
238 virtual pp::Rect GetPageRect(int index) = 0; | 235 virtual pp::Rect GetPageRect(int index) = 0; |
239 // Gets the rectangle of the page excluding any additional areas. | 236 // Gets the rectangle of the page excluding any additional areas. |
240 virtual pp::Rect GetPageContentsRect(int index) = 0; | 237 virtual pp::Rect GetPageContentsRect(int index) = 0; |
241 // Returns a page's rect in screen coordinates, as well as its surrounding | 238 // Returns a page's rect in screen coordinates, as well as its surrounding |
242 // border areas and bottom separator. | 239 // border areas and bottom separator. |
243 virtual pp::Rect GetPageScreenRect(int page_index) const = 0; | 240 virtual pp::Rect GetPageScreenRect(int page_index) const = 0; |
244 // Gets the offset of the vertical scrollbar from the top in document | 241 // Gets the offset of the vertical scrollbar from the top in document |
245 // coordinates. | 242 // coordinates. |
246 virtual int GetVerticalScrollbarYPosition() = 0; | 243 virtual int GetVerticalScrollbarYPosition() = 0; |
247 // Paints page thumbnail to the ImageData. | |
248 virtual void PaintThumbnail(pp::ImageData* image_data, int index) = 0; | |
249 // Set color / grayscale rendering modes. | 244 // Set color / grayscale rendering modes. |
250 virtual void SetGrayscale(bool grayscale) = 0; | 245 virtual void SetGrayscale(bool grayscale) = 0; |
251 // Callback for timer that's set with ScheduleCallback(). | 246 // Callback for timer that's set with ScheduleCallback(). |
252 virtual void OnCallback(int id) = 0; | 247 virtual void OnCallback(int id) = 0; |
253 // Gets the JSON representation of the PDF file | 248 // Gets the JSON representation of the PDF file |
254 virtual std::string GetPageAsJSON(int index) = 0; | 249 virtual std::string GetPageAsJSON(int index) = 0; |
255 // Gets the PDF document's print scaling preference. True if the document can | 250 // Gets the PDF document's print scaling preference. True if the document can |
256 // be scaled to fit. | 251 // be scaled to fit. |
257 virtual bool GetPrintScaling() = 0; | 252 virtual bool GetPrintScaling() = 0; |
258 // Returns number of copies to be printed. | 253 // Returns number of copies to be printed. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 336 |
342 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 337 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
343 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 338 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
344 int pdf_buffer_size, int page_number, | 339 int pdf_buffer_size, int page_number, |
345 double* width, double* height) = 0; | 340 double* width, double* height) = 0; |
346 }; | 341 }; |
347 | 342 |
348 } // namespace chrome_pdf | 343 } // namespace chrome_pdf |
349 | 344 |
350 #endif // PDF_PDF_ENGINE_H_ | 345 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |