Chromium Code Reviews| 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 "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| 11 #include <windows.h> | 11 #include <windows.h> |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 #include <string> | 14 #include <string> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
| 18 | 18 |
| 19 #include "ppapi/c/dev/pp_cursor_type_dev.h" | 19 #include "ppapi/c/dev/pp_cursor_type_dev.h" |
| 20 #include "ppapi/c/dev/ppp_printing_dev.h" | 20 #include "ppapi/c/dev/ppp_printing_dev.h" |
| 21 #include "ppapi/c/ppb_input_event.h" | 21 #include "ppapi/c/ppb_input_event.h" |
| 22 #include "ppapi/cpp/completion_callback.h" | 22 #include "ppapi/cpp/completion_callback.h" |
| 23 #include "ppapi/cpp/image_data.h" | 23 #include "ppapi/cpp/image_data.h" |
| 24 #include "ppapi/cpp/rect.h" | 24 #include "ppapi/cpp/rect.h" |
| 25 #include "ppapi/cpp/size.h" | 25 #include "ppapi/cpp/size.h" |
| 26 #include "ppapi/cpp/url_loader.h" | 26 #include "ppapi/cpp/url_loader.h" |
| 27 #include "ppapi/cpp/var_dictionary.h" | |
| 27 | 28 |
| 28 namespace pp { | 29 namespace pp { |
| 29 class InputEvent; | 30 class InputEvent; |
| 30 } | 31 } |
| 31 | 32 |
| 32 const uint32 kBackgroundColor = 0xFFCCCCCC; | 33 const uint32 kBackgroundColor = 0xFFCCCCCC; |
| 33 | 34 |
| 34 namespace chrome_pdf { | 35 namespace chrome_pdf { |
| 35 | 36 |
| 36 class Stream; | 37 class Stream; |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 240 // Callback for timer that's set with ScheduleCallback(). | 241 // Callback for timer that's set with ScheduleCallback(). |
| 241 virtual void OnCallback(int id) = 0; | 242 virtual void OnCallback(int id) = 0; |
| 242 // Gets the JSON representation of the PDF file | 243 // Gets the JSON representation of the PDF file |
| 243 virtual std::string GetPageAsJSON(int index) = 0; | 244 virtual std::string GetPageAsJSON(int index) = 0; |
| 244 // Gets the PDF document's print scaling preference. True if the document can | 245 // Gets the PDF document's print scaling preference. True if the document can |
| 245 // be scaled to fit. | 246 // be scaled to fit. |
| 246 virtual bool GetPrintScaling() = 0; | 247 virtual bool GetPrintScaling() = 0; |
| 247 // Returns number of copies to be printed. | 248 // Returns number of copies to be printed. |
| 248 virtual int GetCopiesToPrint() = 0; | 249 virtual int GetCopiesToPrint() = 0; |
| 249 | 250 |
| 251 // Returns a nested Dictionary of Bookmarks | |
|
Sam McNally
2014/12/16 05:58:34
Document the structure of the dictionary.
Alexandre Carlton
2014/12/16 22:14:51
Done.
| |
| 252 virtual pp::VarDictionary GetBookmarks() = 0; | |
| 253 | |
| 250 // Append blank pages to make a 1-page document to a |num_pages| document. | 254 // Append blank pages to make a 1-page document to a |num_pages| document. |
| 251 // Always retain the first page data. | 255 // Always retain the first page data. |
| 252 virtual void AppendBlankPages(int num_pages) = 0; | 256 virtual void AppendBlankPages(int num_pages) = 0; |
| 253 // Append the first page of the document loaded with the |engine| to this | 257 // Append the first page of the document loaded with the |engine| to this |
| 254 // document at page |index|. | 258 // document at page |index|. |
| 255 virtual void AppendPage(PDFEngine* engine, int index) = 0; | 259 virtual void AppendPage(PDFEngine* engine, int index) = 0; |
| 256 | 260 |
| 257 // Allow client to query and reset scroll positions in document coordinates. | 261 // Allow client to query and reset scroll positions in document coordinates. |
| 258 // Note that this is meant for cases where the device scale factor changes, | 262 // Note that this is meant for cases where the device scale factor changes, |
| 259 // and not for general scrolling - the engine will not repaint due to this. | 263 // and not for general scrolling - the engine will not repaint due to this. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 | 319 |
| 316 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 320 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
| 317 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 321 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
| 318 int pdf_buffer_size, int page_number, | 322 int pdf_buffer_size, int page_number, |
| 319 double* width, double* height) = 0; | 323 double* width, double* height) = 0; |
| 320 }; | 324 }; |
| 321 | 325 |
| 322 } // namespace chrome_pdf | 326 } // namespace chrome_pdf |
| 323 | 327 |
| 324 #endif // PDF_PDF_ENGINE_H_ | 328 #endif // PDF_PDF_ENGINE_H_ |
| OLD | NEW |