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

Side by Side Diff: pdf/pdfium/pdfium_engine.h

Issue 1255403002: Add a scroll offset to PDF documents to account for the top material design toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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_PDFIUM_PDFIUM_ENGINE_H_ 5 #ifndef PDF_PDFIUM_PDFIUM_ENGINE_H_
6 #define PDF_PDFIUM_PDFIUM_ENGINE_H_ 6 #define PDF_PDFIUM_PDFIUM_ENGINE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 virtual bool IsSelecting(); 77 virtual bool IsSelecting();
78 virtual bool HasPermission(DocumentPermission permission) const; 78 virtual bool HasPermission(DocumentPermission permission) const;
79 virtual void SelectAll(); 79 virtual void SelectAll();
80 virtual int GetNumberOfPages(); 80 virtual int GetNumberOfPages();
81 virtual pp::VarArray GetBookmarks(); 81 virtual pp::VarArray GetBookmarks();
82 virtual int GetNamedDestinationPage(const std::string& destination); 82 virtual int GetNamedDestinationPage(const std::string& destination);
83 virtual int GetFirstVisiblePage(); 83 virtual int GetFirstVisiblePage();
84 virtual int GetMostVisiblePage(); 84 virtual int GetMostVisiblePage();
85 virtual pp::Rect GetPageRect(int index); 85 virtual pp::Rect GetPageRect(int index);
86 virtual pp::Rect GetPageContentsRect(int index); 86 virtual pp::Rect GetPageContentsRect(int index);
87 virtual pp::Rect GetPageScreenRect(int page_index) const;
87 virtual int GetVerticalScrollbarYPosition() { return position_.y(); } 88 virtual int GetVerticalScrollbarYPosition() { return position_.y(); }
88 virtual void PaintThumbnail(pp::ImageData* image_data, int index); 89 virtual void PaintThumbnail(pp::ImageData* image_data, int index);
89 virtual void SetGrayscale(bool grayscale); 90 virtual void SetGrayscale(bool grayscale);
90 virtual void OnCallback(int id); 91 virtual void OnCallback(int id);
91 virtual std::string GetPageAsJSON(int index); 92 virtual std::string GetPageAsJSON(int index);
92 virtual bool GetPrintScaling(); 93 virtual bool GetPrintScaling();
93 virtual int GetCopiesToPrint(); 94 virtual int GetCopiesToPrint();
94 virtual int GetDuplexType(); 95 virtual int GetDuplexType();
95 virtual bool GetPageSizeAndUniformity(pp::Size* size); 96 virtual bool GetPageSizeAndUniformity(pp::Size* size);
96 virtual void AppendBlankPages(int num_pages); 97 virtual void AppendBlankPages(int num_pages);
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 // units that PDFium rendering functions expect. 367 // units that PDFium rendering functions expect.
367 void GetPDFiumRect(int page_index, const pp::Rect& rect, int* start_x, 368 void GetPDFiumRect(int page_index, const pp::Rect& rect, int* start_x,
368 int* start_y, int* size_x, int* size_y) const; 369 int* start_y, int* size_x, int* size_y) const;
369 370
370 // Returns the rendering flags to pass to PDFium. 371 // Returns the rendering flags to pass to PDFium.
371 int GetRenderingFlags() const; 372 int GetRenderingFlags() const;
372 373
373 // Returns the currently visible rectangle in document coordinates. 374 // Returns the currently visible rectangle in document coordinates.
374 pp::Rect GetVisibleRect() const; 375 pp::Rect GetVisibleRect() const;
375 376
376 // Returns a page's rect in screen coordinates, as well as its surrounding
377 // border areas and bottom separator.
378 pp::Rect GetPageScreenRect(int page_index) const;
379
380 // Given a rectangle in document coordinates, returns the rectange into screen 377 // Given a rectangle in document coordinates, returns the rectange into screen
381 // coordinates (i.e. 0,0 is top left corner of plugin area). If it's not 378 // coordinates (i.e. 0,0 is top left corner of plugin area). If it's not
382 // visible, an empty rectangle is returned. 379 // visible, an empty rectangle is returned.
383 pp::Rect GetScreenRect(const pp::Rect& rect) const; 380 pp::Rect GetScreenRect(const pp::Rect& rect) const;
384 381
385 // Highlights the given rectangle. 382 // Highlights the given rectangle.
386 void Highlight(void* buffer, 383 void Highlight(void* buffer,
387 int stride, 384 int stride,
388 const pp::Rect& rect, 385 const pp::Rect& rect,
389 std::vector<pp::Rect>* highlighted_rects); 386 std::vector<pp::Rect>* highlighted_rects);
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 751
755 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. 752 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details.
756 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, 753 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer,
757 int pdf_buffer_size, int page_number, 754 int pdf_buffer_size, int page_number,
758 double* width, double* height); 755 double* width, double* height);
759 }; 756 };
760 757
761 } // namespace chrome_pdf 758 } // namespace chrome_pdf
762 759
763 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ 760 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698