Chromium Code Reviews| 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; | |
| 266 virtual void GetNameDests(std::vector<std::string>* name_dest) = 0; | |
| 267 virtual void GetAllNameDests(pp::VarDictionary* named_destinations) = 0; | |
|
raymes
2015/01/13 01:59:31
nit: Let's make it verbose: GetAllNamedDestination
Deepak
2015/01/13 08:29:07
Done.
| |
| 263 }; | 268 }; |
| 264 | 269 |
| 265 // Interface for exports that wrap the PDF engine. | 270 // Interface for exports that wrap the PDF engine. |
| 266 class PDFEngineExports { | 271 class PDFEngineExports { |
| 267 public: | 272 public: |
| 268 struct RenderingSettings { | 273 struct RenderingSettings { |
| 269 RenderingSettings(int dpi_x, | 274 RenderingSettings(int dpi_x, |
| 270 int dpi_y, | 275 int dpi_y, |
| 271 const pp::Rect& bounds, | 276 const pp::Rect& bounds, |
| 272 bool fit_to_bounds, | 277 bool fit_to_bounds, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 314 | 319 |
| 315 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 320 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
| 316 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 321 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
| 317 int pdf_buffer_size, int page_number, | 322 int pdf_buffer_size, int page_number, |
| 318 double* width, double* height) = 0; | 323 double* width, double* height) = 0; |
| 319 }; | 324 }; |
| 320 | 325 |
| 321 } // namespace chrome_pdf | 326 } // namespace chrome_pdf |
| 322 | 327 |
| 323 #endif // PDF_PDF_ENGINE_H_ | 328 #endif // PDF_PDF_ENGINE_H_ |
| OLD | NEW |