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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 | 11 |
12 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
13 #include <windows.h> | 13 #include <windows.h> |
14 #endif | 14 #endif |
15 | 15 |
16 #include <string> | 16 #include <string> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
20 | 20 |
21 #include "ppapi/c/dev/pp_cursor_type_dev.h" | 21 #include "ppapi/c/dev/pp_cursor_type_dev.h" |
22 #include "ppapi/c/dev/ppp_printing_dev.h" | 22 #include "ppapi/c/dev/ppp_printing_dev.h" |
23 #include "ppapi/c/ppb_input_event.h" | 23 #include "ppapi/c/ppb_input_event.h" |
24 #include "ppapi/cpp/completion_callback.h" | 24 #include "ppapi/cpp/completion_callback.h" |
25 #include "ppapi/cpp/image_data.h" | 25 #include "ppapi/cpp/image_data.h" |
26 #include "ppapi/cpp/rect.h" | 26 #include "ppapi/cpp/rect.h" |
27 #include "ppapi/cpp/size.h" | 27 #include "ppapi/cpp/size.h" |
28 #include "ppapi/cpp/url_loader.h" | 28 #include "ppapi/cpp/url_loader.h" |
29 #include "ppapi/cpp/var_array.h" | 29 #include "ppapi/cpp/var_array.h" |
| 30 #include "ui/base/window_open_disposition.h" |
30 | 31 |
31 namespace pp { | 32 namespace pp { |
32 class InputEvent; | 33 class InputEvent; |
33 class VarDictionary; | 34 class VarDictionary; |
34 } | 35 } |
35 | 36 |
36 namespace chrome_pdf { | 37 namespace chrome_pdf { |
37 | 38 |
38 class Stream; | 39 class Stream; |
39 | 40 |
40 #if defined(OS_MACOSX) | |
41 const uint32_t kDefaultKeyModifier = PP_INPUTEVENT_MODIFIER_METAKEY; | |
42 #else // !OS_MACOSX | |
43 const uint32_t kDefaultKeyModifier = PP_INPUTEVENT_MODIFIER_CONTROLKEY; | |
44 #endif // OS_MACOSX | |
45 | |
46 // Do one time initialization of the SDK. | 41 // Do one time initialization of the SDK. |
47 bool InitializeSDK(); | 42 bool InitializeSDK(); |
48 // Tells the SDK that we're shutting down. | 43 // Tells the SDK that we're shutting down. |
49 void ShutdownSDK(); | 44 void ShutdownSDK(); |
50 | 45 |
51 // This class encapsulates a PDF rendering engine. | 46 // This class encapsulates a PDF rendering engine. |
52 class PDFEngine { | 47 class PDFEngine { |
53 public: | 48 public: |
54 enum DocumentPermission { | 49 enum DocumentPermission { |
55 PERMISSION_COPY, | 50 PERMISSION_COPY, |
(...skipping 17 matching lines...) Expand all Loading... |
73 virtual void Scroll(const pp::Point& point) = 0; | 68 virtual void Scroll(const pp::Point& point) = 0; |
74 | 69 |
75 // Scroll the horizontal/vertical scrollbars to a given position. | 70 // Scroll the horizontal/vertical scrollbars to a given position. |
76 virtual void ScrollToX(int position) = 0; | 71 virtual void ScrollToX(int position) = 0; |
77 virtual void ScrollToY(int position) = 0; | 72 virtual void ScrollToY(int position) = 0; |
78 | 73 |
79 // Scroll to the specified page. | 74 // Scroll to the specified page. |
80 virtual void ScrollToPage(int page) = 0; | 75 virtual void ScrollToPage(int page) = 0; |
81 | 76 |
82 // Navigate to the given url. | 77 // Navigate to the given url. |
83 virtual void NavigateTo(const std::string& url, bool open_in_new_tab) = 0; | 78 virtual void NavigateTo(const std::string& url, |
| 79 WindowOpenDisposition disposition) = 0; |
84 | 80 |
85 // Updates the cursor. | 81 // Updates the cursor. |
86 virtual void UpdateCursor(PP_CursorType_Dev cursor) = 0; | 82 virtual void UpdateCursor(PP_CursorType_Dev cursor) = 0; |
87 | 83 |
88 // Updates the tick marks in the vertical scrollbar. | 84 // Updates the tick marks in the vertical scrollbar. |
89 virtual void UpdateTickMarks(const std::vector<pp::Rect>& tickmarks) = 0; | 85 virtual void UpdateTickMarks(const std::vector<pp::Rect>& tickmarks) = 0; |
90 | 86 |
91 // Updates the number of find results for the current search term. If | 87 // Updates the number of find results for the current search term. If |
92 // there are no matches 0 should be passed in. Only when the plugin has | 88 // there are no matches 0 should be passed in. Only when the plugin has |
93 // finished searching should it pass in the final count with final_result | 89 // finished searching should it pass in the final count with final_result |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 | 346 |
351 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 347 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
352 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 348 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
353 int pdf_buffer_size, int page_number, | 349 int pdf_buffer_size, int page_number, |
354 double* width, double* height) = 0; | 350 double* width, double* height) = 0; |
355 }; | 351 }; |
356 | 352 |
357 } // namespace chrome_pdf | 353 } // namespace chrome_pdf |
358 | 354 |
359 #endif // PDF_PDF_ENGINE_H_ | 355 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |