| 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> |
| 9 |
| 8 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 9 | 11 |
| 10 #if defined(OS_WIN) | 12 #if defined(OS_WIN) |
| 11 #include <windows.h> | 13 #include <windows.h> |
| 12 #endif | 14 #endif |
| 13 | 15 |
| 14 #include <string> | 16 #include <string> |
| 15 #include <vector> | 17 #include <vector> |
| 16 | 18 |
| 17 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 29 namespace pp { | 31 namespace pp { |
| 30 class InputEvent; | 32 class InputEvent; |
| 31 class VarDictionary; | 33 class VarDictionary; |
| 32 } | 34 } |
| 33 | 35 |
| 34 namespace chrome_pdf { | 36 namespace chrome_pdf { |
| 35 | 37 |
| 36 class Stream; | 38 class Stream; |
| 37 | 39 |
| 38 #if defined(OS_MACOSX) | 40 #if defined(OS_MACOSX) |
| 39 const uint32 kDefaultKeyModifier = PP_INPUTEVENT_MODIFIER_METAKEY; | 41 const uint32_t kDefaultKeyModifier = PP_INPUTEVENT_MODIFIER_METAKEY; |
| 40 #else // !OS_MACOSX | 42 #else // !OS_MACOSX |
| 41 const uint32 kDefaultKeyModifier = PP_INPUTEVENT_MODIFIER_CONTROLKEY; | 43 const uint32_t kDefaultKeyModifier = PP_INPUTEVENT_MODIFIER_CONTROLKEY; |
| 42 #endif // OS_MACOSX | 44 #endif // OS_MACOSX |
| 43 | 45 |
| 44 // Do one time initialization of the SDK. | 46 // Do one time initialization of the SDK. |
| 45 bool InitializeSDK(); | 47 bool InitializeSDK(); |
| 46 // Tells the SDK that we're shutting down. | 48 // Tells the SDK that we're shutting down. |
| 47 void ShutdownSDK(); | 49 void ShutdownSDK(); |
| 48 | 50 |
| 49 // This class encapsulates a PDF rendering engine. | 51 // This class encapsulates a PDF rendering engine. |
| 50 class PDFEngine { | 52 class PDFEngine { |
| 51 public: | 53 public: |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 160 |
| 159 // Notifies the client that the document has failed to load. | 161 // Notifies the client that the document has failed to load. |
| 160 virtual void DocumentLoadFailed() = 0; | 162 virtual void DocumentLoadFailed() = 0; |
| 161 | 163 |
| 162 virtual pp::Instance* GetPluginInstance() = 0; | 164 virtual pp::Instance* GetPluginInstance() = 0; |
| 163 | 165 |
| 164 // Notifies that an unsupported feature in the PDF was encountered. | 166 // Notifies that an unsupported feature in the PDF was encountered. |
| 165 virtual void DocumentHasUnsupportedFeature(const std::string& feature) = 0; | 167 virtual void DocumentHasUnsupportedFeature(const std::string& feature) = 0; |
| 166 | 168 |
| 167 // Notifies the client about document load progress. | 169 // Notifies the client about document load progress. |
| 168 virtual void DocumentLoadProgress(uint32 available, uint32 doc_size) = 0; | 170 virtual void DocumentLoadProgress(uint32_t available, |
| 171 uint32_t doc_size) = 0; |
| 169 | 172 |
| 170 // Notifies the client about focus changes for form text fields. | 173 // Notifies the client about focus changes for form text fields. |
| 171 virtual void FormTextFieldFocusChange(bool in_focus) = 0; | 174 virtual void FormTextFieldFocusChange(bool in_focus) = 0; |
| 172 | 175 |
| 173 // Returns true if the plugin has been opened within print preview. | 176 // Returns true if the plugin has been opened within print preview. |
| 174 virtual bool IsPrintPreview() = 0; | 177 virtual bool IsPrintPreview() = 0; |
| 175 | 178 |
| 176 // Get the background color of the PDF. | 179 // Get the background color of the PDF. |
| 177 virtual uint32 GetBackgroundColor() = 0; | 180 virtual uint32_t GetBackgroundColor() = 0; |
| 178 | 181 |
| 179 // Sets selection status. | 182 // Sets selection status. |
| 180 virtual void IsSelectingChanged(bool is_selecting) {} | 183 virtual void IsSelectingChanged(bool is_selecting) {} |
| 181 }; | 184 }; |
| 182 | 185 |
| 183 // Factory method to create an instance of the PDF Engine. | 186 // Factory method to create an instance of the PDF Engine. |
| 184 static PDFEngine* Create(Client* client); | 187 static PDFEngine* Create(Client* client); |
| 185 | 188 |
| 186 virtual ~PDFEngine() {} | 189 virtual ~PDFEngine() {} |
| 187 | 190 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 338 |
| 336 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 339 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
| 337 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 340 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
| 338 int pdf_buffer_size, int page_number, | 341 int pdf_buffer_size, int page_number, |
| 339 double* width, double* height) = 0; | 342 double* width, double* height) = 0; |
| 340 }; | 343 }; |
| 341 | 344 |
| 342 } // namespace chrome_pdf | 345 } // namespace chrome_pdf |
| 343 | 346 |
| 344 #endif // PDF_PDF_ENGINE_H_ | 347 #endif // PDF_PDF_ENGINE_H_ |
| OLD | NEW |