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 | |
265 virtual unsigned long GetNameDestCount() = 0; | |
raymes
2015/01/14 00:19:00
We don't need this anymore
Deepak
2015/01/14 06:29:01
Done.
| |
266 virtual pp::VarDictionary GetAllNamedDestinations() = 0; | |
raymes
2015/01/14 00:19:00
nit: let's just call it GetNamedDestinations
Deepak
2015/01/14 06:29:01
Done.
| |
263 }; | 267 }; |
264 | 268 |
265 // Interface for exports that wrap the PDF engine. | 269 // Interface for exports that wrap the PDF engine. |
266 class PDFEngineExports { | 270 class PDFEngineExports { |
267 public: | 271 public: |
268 struct RenderingSettings { | 272 struct RenderingSettings { |
269 RenderingSettings(int dpi_x, | 273 RenderingSettings(int dpi_x, |
270 int dpi_y, | 274 int dpi_y, |
271 const pp::Rect& bounds, | 275 const pp::Rect& bounds, |
272 bool fit_to_bounds, | 276 bool fit_to_bounds, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
314 | 318 |
315 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 319 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
316 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 320 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
317 int pdf_buffer_size, int page_number, | 321 int pdf_buffer_size, int page_number, |
318 double* width, double* height) = 0; | 322 double* width, double* height) = 0; |
319 }; | 323 }; |
320 | 324 |
321 } // namespace chrome_pdf | 325 } // namespace chrome_pdf |
322 | 326 |
323 #endif // PDF_PDF_ENGINE_H_ | 327 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |