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) |
(...skipping 13 matching lines...) Expand all Loading... |
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 #include "ppapi/cpp/var_array.h" |
28 | 28 |
29 namespace pp { | 29 namespace pp { |
30 class InputEvent; | 30 class InputEvent; |
31 class VarDictionary; | 31 class VarDictionary; |
32 } | 32 } |
33 | 33 |
34 const uint32 kBackgroundColor = 0xFFCCCCCC; | |
35 | |
36 namespace chrome_pdf { | 34 namespace chrome_pdf { |
37 | 35 |
38 class Stream; | 36 class Stream; |
39 | 37 |
40 #if defined(OS_MACOSX) | 38 #if defined(OS_MACOSX) |
41 const uint32 kDefaultKeyModifier = PP_INPUTEVENT_MODIFIER_METAKEY; | 39 const uint32 kDefaultKeyModifier = PP_INPUTEVENT_MODIFIER_METAKEY; |
42 #else // !OS_MACOSX | 40 #else // !OS_MACOSX |
43 const uint32 kDefaultKeyModifier = PP_INPUTEVENT_MODIFIER_CONTROLKEY; | 41 const uint32 kDefaultKeyModifier = PP_INPUTEVENT_MODIFIER_CONTROLKEY; |
44 #endif // OS_MACOSX | 42 #endif // OS_MACOSX |
45 | 43 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // Callback for timer that's set with ScheduleCallback(). | 239 // Callback for timer that's set with ScheduleCallback(). |
242 virtual void OnCallback(int id) = 0; | 240 virtual void OnCallback(int id) = 0; |
243 // Gets the JSON representation of the PDF file | 241 // Gets the JSON representation of the PDF file |
244 virtual std::string GetPageAsJSON(int index) = 0; | 242 virtual std::string GetPageAsJSON(int index) = 0; |
245 // Gets the PDF document's print scaling preference. True if the document can | 243 // Gets the PDF document's print scaling preference. True if the document can |
246 // be scaled to fit. | 244 // be scaled to fit. |
247 virtual bool GetPrintScaling() = 0; | 245 virtual bool GetPrintScaling() = 0; |
248 // Returns number of copies to be printed. | 246 // Returns number of copies to be printed. |
249 virtual int GetCopiesToPrint() = 0; | 247 virtual int GetCopiesToPrint() = 0; |
250 | 248 |
| 249 // Retrieve the background color of the PDF viewer. |
| 250 virtual uint32 GetBackgroundColor() = 0; |
| 251 // Set the background color of the PDF viewer. |
| 252 virtual void SetBackgroundColor(uint32 background_color) = 0; |
| 253 |
251 // Returns a VarArray of Bookmarks, each a VarDictionary containing the | 254 // Returns a VarArray of Bookmarks, each a VarDictionary containing the |
252 // following key/values: | 255 // following key/values: |
253 // - "title" - a string Var. | 256 // - "title" - a string Var. |
254 // - "page" - an int Var. | 257 // - "page" - an int Var. |
255 // - "children" - a VarArray(), with each entry containing a VarDictionary of | 258 // - "children" - a VarArray(), with each entry containing a VarDictionary of |
256 // the same structure. | 259 // the same structure. |
257 virtual pp::VarArray GetBookmarks() = 0; | 260 virtual pp::VarArray GetBookmarks() = 0; |
258 | 261 |
259 // Append blank pages to make a 1-page document to a |num_pages| document. | 262 // Append blank pages to make a 1-page document to a |num_pages| document. |
260 // Always retain the first page data. | 263 // Always retain the first page data. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 328 |
326 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 329 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
327 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 330 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
328 int pdf_buffer_size, int page_number, | 331 int pdf_buffer_size, int page_number, |
329 double* width, double* height) = 0; | 332 double* width, double* height) = 0; |
330 }; | 333 }; |
331 | 334 |
332 } // namespace chrome_pdf | 335 } // namespace chrome_pdf |
333 | 336 |
334 #endif // PDF_PDF_ENGINE_H_ | 337 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |