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_array.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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 // Callback for timer that's set with ScheduleCallback(). | 240 // Callback for timer that's set with ScheduleCallback(). |
240 virtual void OnCallback(int id) = 0; | 241 virtual void OnCallback(int id) = 0; |
241 // Gets the JSON representation of the PDF file | 242 // Gets the JSON representation of the PDF file |
242 virtual std::string GetPageAsJSON(int index) = 0; | 243 virtual std::string GetPageAsJSON(int index) = 0; |
243 // Gets the PDF document's print scaling preference. True if the document can | 244 // Gets the PDF document's print scaling preference. True if the document can |
244 // be scaled to fit. | 245 // be scaled to fit. |
245 virtual bool GetPrintScaling() = 0; | 246 virtual bool GetPrintScaling() = 0; |
246 // Returns number of copies to be printed. | 247 // Returns number of copies to be printed. |
247 virtual int GetCopiesToPrint() = 0; | 248 virtual int GetCopiesToPrint() = 0; |
248 | 249 |
| 250 // Returns a VarArray of Bookmarks, each a VarDictionary containing the |
| 251 // following key/values: |
| 252 // - "title" - a string Var. |
| 253 // - "page" - an int Var. |
| 254 // - "children" - a VarArray(), with each entry containing a VarDictionary of |
| 255 // the same structure. |
| 256 virtual pp::VarArray GetBookmarks() = 0; |
| 257 |
249 // Append blank pages to make a 1-page document to a |num_pages| document. | 258 // Append blank pages to make a 1-page document to a |num_pages| document. |
250 // Always retain the first page data. | 259 // Always retain the first page data. |
251 virtual void AppendBlankPages(int num_pages) = 0; | 260 virtual void AppendBlankPages(int num_pages) = 0; |
252 // Append the first page of the document loaded with the |engine| to this | 261 // Append the first page of the document loaded with the |engine| to this |
253 // document at page |index|. | 262 // document at page |index|. |
254 virtual void AppendPage(PDFEngine* engine, int index) = 0; | 263 virtual void AppendPage(PDFEngine* engine, int index) = 0; |
255 | 264 |
256 // Allow client to query and reset scroll positions in document coordinates. | 265 // Allow client to query and reset scroll positions in document coordinates. |
257 // Note that this is meant for cases where the device scale factor changes, | 266 // Note that this is meant for cases where the device scale factor changes, |
258 // and not for general scrolling - the engine will not repaint due to this. | 267 // 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... |
314 | 323 |
315 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 324 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
316 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 325 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
317 int pdf_buffer_size, int page_number, | 326 int pdf_buffer_size, int page_number, |
318 double* width, double* height) = 0; | 327 double* width, double* height) = 0; |
319 }; | 328 }; |
320 | 329 |
321 } // namespace chrome_pdf | 330 } // namespace chrome_pdf |
322 | 331 |
323 #endif // PDF_PDF_ENGINE_H_ | 332 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |