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, containing: | |
raymes
2014/12/16 23:35:53
nit "containing the following key/values:"
Alexandre Carlton
2014/12/17 00:51:13
Done.
| |
252 // - "title" of type Var(std::string) | |
253 // - "page" of type Var(int) | |
254 // - "children" of type VarArray(), with each entry containing a | |
255 // VarDictionary of the same structure. | |
256 virtual pp::VarDictionary GetBookmarks() = 0; | |
raymes
2014/12/16 23:35:53
Let's return a pp::VarArray here.
| |
257 | |
250 // 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. |
251 // Always retain the first page data. | 259 // Always retain the first page data. |
252 virtual void AppendBlankPages(int num_pages) = 0; | 260 virtual void AppendBlankPages(int num_pages) = 0; |
253 // 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 |
254 // document at page |index|. | 262 // document at page |index|. |
255 virtual void AppendPage(PDFEngine* engine, int index) = 0; | 263 virtual void AppendPage(PDFEngine* engine, int index) = 0; |
256 | 264 |
257 // Allow client to query and reset scroll positions in document coordinates. | 265 // 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, | 266 // 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. | 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... | |
315 | 323 |
316 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 324 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
317 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 325 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
318 int pdf_buffer_size, int page_number, | 326 int pdf_buffer_size, int page_number, |
319 double* width, double* height) = 0; | 327 double* width, double* height) = 0; |
320 }; | 328 }; |
321 | 329 |
322 } // namespace chrome_pdf | 330 } // namespace chrome_pdf |
323 | 331 |
324 #endif // PDF_PDF_ENGINE_H_ | 332 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |