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) |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 virtual void DocumentHasUnsupportedFeature(const std::string& feature) = 0; | 166 virtual void DocumentHasUnsupportedFeature(const std::string& feature) = 0; |
167 | 167 |
168 // Notifies the client about document load progress. | 168 // Notifies the client about document load progress. |
169 virtual void DocumentLoadProgress(uint32 available, uint32 doc_size) = 0; | 169 virtual void DocumentLoadProgress(uint32 available, uint32 doc_size) = 0; |
170 | 170 |
171 // Notifies the client about focus changes for form text fields. | 171 // Notifies the client about focus changes for form text fields. |
172 virtual void FormTextFieldFocusChange(bool in_focus) = 0; | 172 virtual void FormTextFieldFocusChange(bool in_focus) = 0; |
173 | 173 |
174 // Returns true if the plugin has been opened within print preview. | 174 // Returns true if the plugin has been opened within print preview. |
175 virtual bool IsPrintPreview() = 0; | 175 virtual bool IsPrintPreview() = 0; |
| 176 |
| 177 // Get the background color of the PDF. |
| 178 virtual uint32 GetBackgroundColor() = 0; |
176 }; | 179 }; |
177 | 180 |
178 // Factory method to create an instance of the PDF Engine. | 181 // Factory method to create an instance of the PDF Engine. |
179 static PDFEngine* Create(Client* client); | 182 static PDFEngine* Create(Client* client); |
180 | 183 |
181 virtual ~PDFEngine() {} | 184 virtual ~PDFEngine() {} |
182 // Most of these functions are similar to the Pepper functions of the same | 185 // Most of these functions are similar to the Pepper functions of the same |
183 // name, so not repeating the description here unless it's different. | 186 // name, so not repeating the description here unless it's different. |
184 virtual bool New(const char* url) = 0; | 187 virtual bool New(const char* url) = 0; |
185 virtual bool New(const char* url, | 188 virtual bool New(const char* url, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 // Callback for timer that's set with ScheduleCallback(). | 242 // Callback for timer that's set with ScheduleCallback(). |
240 virtual void OnCallback(int id) = 0; | 243 virtual void OnCallback(int id) = 0; |
241 // Gets the JSON representation of the PDF file | 244 // Gets the JSON representation of the PDF file |
242 virtual std::string GetPageAsJSON(int index) = 0; | 245 virtual std::string GetPageAsJSON(int index) = 0; |
243 // Gets the PDF document's print scaling preference. True if the document can | 246 // Gets the PDF document's print scaling preference. True if the document can |
244 // be scaled to fit. | 247 // be scaled to fit. |
245 virtual bool GetPrintScaling() = 0; | 248 virtual bool GetPrintScaling() = 0; |
246 // Returns number of copies to be printed. | 249 // Returns number of copies to be printed. |
247 virtual int GetCopiesToPrint() = 0; | 250 virtual int GetCopiesToPrint() = 0; |
248 | 251 |
249 // Retrieve the background color of the PDF viewer. | |
250 virtual uint32 GetBackgroundColor() = 0; | |
251 // Set the background color of the PDF viewer. | |
252 virtual void SetBackgroundColor(uint32 background_color) = 0; | |
253 | |
254 // Returns a VarArray of Bookmarks, each a VarDictionary containing the | 252 // Returns a VarArray of Bookmarks, each a VarDictionary containing the |
255 // following key/values: | 253 // following key/values: |
256 // - "title" - a string Var. | 254 // - "title" - a string Var. |
257 // - "page" - an int Var. | 255 // - "page" - an int Var. |
258 // - "children" - a VarArray(), with each entry containing a VarDictionary of | 256 // - "children" - a VarArray(), with each entry containing a VarDictionary of |
259 // the same structure. | 257 // the same structure. |
260 virtual pp::VarArray GetBookmarks() = 0; | 258 virtual pp::VarArray GetBookmarks() = 0; |
261 | 259 |
262 // Append blank pages to make a 1-page document to a |num_pages| document. | 260 // Append blank pages to make a 1-page document to a |num_pages| document. |
263 // Always retain the first page data. | 261 // Always retain the first page data. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 | 326 |
329 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 327 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
330 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 328 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
331 int pdf_buffer_size, int page_number, | 329 int pdf_buffer_size, int page_number, |
332 double* width, double* height) = 0; | 330 double* width, double* height) = 0; |
333 }; | 331 }; |
334 | 332 |
335 } // namespace chrome_pdf | 333 } // namespace chrome_pdf |
336 | 334 |
337 #endif // PDF_PDF_ENGINE_H_ | 335 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |