Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: pdf/pdf_engine.h

Issue 810623003: Add functions to collect bookmarks from Pdfium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase master (so PDFiumAPIStringBufferAdapter isn't shown) Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "ppapi/cpp/var_array.h"
27 28
28 namespace pp { 29 namespace pp {
29 class InputEvent; 30 class InputEvent;
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;
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 // Callback for timer that's set with ScheduleCallback(). 240 // Callback for timer that's set with ScheduleCallback().
240 virtual void OnCallback(int id) = 0; 241 virtual void OnCallback(int id) = 0;
241 // Gets the JSON representation of the PDF file 242 // Gets the JSON representation of the PDF file
242 virtual std::string GetPageAsJSON(int index) = 0; 243 virtual std::string GetPageAsJSON(int index) = 0;
243 // Gets the PDF document's print scaling preference. True if the document can 244 // Gets the PDF document's print scaling preference. True if the document can
244 // be scaled to fit. 245 // be scaled to fit.
245 virtual bool GetPrintScaling() = 0; 246 virtual bool GetPrintScaling() = 0;
246 // Returns number of copies to be printed. 247 // Returns number of copies to be printed.
247 virtual int GetCopiesToPrint() = 0; 248 virtual int GetCopiesToPrint() = 0;
248 249
250 // Returns a VarArray of Bookmarks, each a VarDictionary
251 // containing the following key/values:
raymes 2015/01/16 02:44:23 nit: Make sure you fill the full 80chars before ad
Alexandre Carlton 2015/01/16 03:01:40 Done.
252 // - "title" of type Var(std::string)
253 // - "page" of type Var(int)
raymes 2015/01/16 02:44:23 nit: -"title" - a string Var. -"page" - an int Var
Alexandre Carlton 2015/01/16 03:01:40 Done.
254 // - "children" of type VarArray(), with each entry containing a
255 // VarDictionary of the same structure.
256 virtual pp::VarArray GetBookmarks() = 0;
257
249 // Append blank pages to make a 1-page document to a |num_pages| document. 258 // Append blank pages to make a 1-page document to a |num_pages| document.
250 // Always retain the first page data. 259 // Always retain the first page data.
251 virtual void AppendBlankPages(int num_pages) = 0; 260 virtual void AppendBlankPages(int num_pages) = 0;
252 // Append the first page of the document loaded with the |engine| to this 261 // Append the first page of the document loaded with the |engine| to this
253 // document at page |index|. 262 // document at page |index|.
254 virtual void AppendPage(PDFEngine* engine, int index) = 0; 263 virtual void AppendPage(PDFEngine* engine, int index) = 0;
255 264
256 // Allow client to query and reset scroll positions in document coordinates. 265 // 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, 266 // 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. 267 // and not for general scrolling - the engine will not repaint due to this.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 323
315 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. 324 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details.
316 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, 325 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer,
317 int pdf_buffer_size, int page_number, 326 int pdf_buffer_size, int page_number,
318 double* width, double* height) = 0; 327 double* width, double* height) = 0;
319 }; 328 };
320 329
321 } // namespace chrome_pdf 330 } // namespace chrome_pdf
322 331
323 #endif // PDF_PDF_ENGINE_H_ 332 #endif // PDF_PDF_ENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698