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 | 27 |
28 namespace pp { | 28 namespace pp { |
29 class InputEvent; | 29 class InputEvent; |
| 30 class VarDictionary; |
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; |
37 | 38 |
38 #if defined(OS_MACOSX) | 39 #if defined(OS_MACOSX) |
39 const uint32 kDefaultKeyModifier = PP_INPUTEVENT_MODIFIER_METAKEY; | 40 const uint32 kDefaultKeyModifier = PP_INPUTEVENT_MODIFIER_METAKEY; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // document at page |index|. | 254 // document at page |index|. |
254 virtual void AppendPage(PDFEngine* engine, int index) = 0; | 255 virtual void AppendPage(PDFEngine* engine, int index) = 0; |
255 | 256 |
256 // Allow client to query and reset scroll positions in document coordinates. | 257 // 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, | 258 // 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. | 259 // and not for general scrolling - the engine will not repaint due to this. |
259 virtual pp::Point GetScrollPosition() = 0; | 260 virtual pp::Point GetScrollPosition() = 0; |
260 virtual void SetScrollPosition(const pp::Point& position) = 0; | 261 virtual void SetScrollPosition(const pp::Point& position) = 0; |
261 | 262 |
262 virtual bool IsProgressiveLoad() = 0; | 263 virtual bool IsProgressiveLoad() = 0; |
| 264 virtual pp::VarDictionary GetNamedDestinations() = 0; |
263 }; | 265 }; |
264 | 266 |
265 // Interface for exports that wrap the PDF engine. | 267 // Interface for exports that wrap the PDF engine. |
266 class PDFEngineExports { | 268 class PDFEngineExports { |
267 public: | 269 public: |
268 struct RenderingSettings { | 270 struct RenderingSettings { |
269 RenderingSettings(int dpi_x, | 271 RenderingSettings(int dpi_x, |
270 int dpi_y, | 272 int dpi_y, |
271 const pp::Rect& bounds, | 273 const pp::Rect& bounds, |
272 bool fit_to_bounds, | 274 bool fit_to_bounds, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 316 |
315 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 317 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
316 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 318 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
317 int pdf_buffer_size, int page_number, | 319 int pdf_buffer_size, int page_number, |
318 double* width, double* height) = 0; | 320 double* width, double* height) = 0; |
319 }; | 321 }; |
320 | 322 |
321 } // namespace chrome_pdf | 323 } // namespace chrome_pdf |
322 | 324 |
323 #endif // PDF_PDF_ENGINE_H_ | 325 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |