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

Side by Side Diff: pdf/pdf_engine.h

Issue 1953053002: Add private PPAPI interfaces for PDFium accessibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback from Lei Created 4 years, 7 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 virtual void FormTextFieldFocusChange(bool in_focus) = 0; 176 virtual void FormTextFieldFocusChange(bool in_focus) = 0;
177 177
178 // Returns true if the plugin has been opened within print preview. 178 // Returns true if the plugin has been opened within print preview.
179 virtual bool IsPrintPreview() = 0; 179 virtual bool IsPrintPreview() = 0;
180 180
181 // Get the background color of the PDF. 181 // Get the background color of the PDF.
182 virtual uint32_t GetBackgroundColor() = 0; 182 virtual uint32_t GetBackgroundColor() = 0;
183 183
184 // Sets selection status. 184 // Sets selection status.
185 virtual void IsSelectingChanged(bool is_selecting) {} 185 virtual void IsSelectingChanged(bool is_selecting) {}
186
187 virtual int GetToolbarHeight() {
188 return 0;
189 }
186 }; 190 };
187 191
188 // Factory method to create an instance of the PDF Engine. 192 // Factory method to create an instance of the PDF Engine.
189 static PDFEngine* Create(Client* client); 193 static PDFEngine* Create(Client* client);
190 194
191 virtual ~PDFEngine() {} 195 virtual ~PDFEngine() {}
192 196
193 // Most of these functions are similar to the Pepper functions of the same 197 // Most of these functions are similar to the Pepper functions of the same
194 // name, so not repeating the description here unless it's different. 198 // name, so not repeating the description here unless it's different.
195 virtual bool New(const char* url, const char* headers) = 0; 199 virtual bool New(const char* url, const char* headers) = 0;
(...skipping 30 matching lines...) Expand all
226 virtual bool HasPermission(DocumentPermission permission) const = 0; 230 virtual bool HasPermission(DocumentPermission permission) const = 0;
227 virtual void SelectAll() = 0; 231 virtual void SelectAll() = 0;
228 // Gets the number of pages in the document. 232 // Gets the number of pages in the document.
229 virtual int GetNumberOfPages() = 0; 233 virtual int GetNumberOfPages() = 0;
230 // Gets the 0-based page number of |destination|, or -1 if it does not exist. 234 // Gets the 0-based page number of |destination|, or -1 if it does not exist.
231 virtual int GetNamedDestinationPage(const std::string& destination) = 0; 235 virtual int GetNamedDestinationPage(const std::string& destination) = 0;
232 // Gets the index of the most visible page, or -1 if none are visible. 236 // Gets the index of the most visible page, or -1 if none are visible.
233 virtual int GetMostVisiblePage() = 0; 237 virtual int GetMostVisiblePage() = 0;
234 // Gets the rectangle of the page including shadow. 238 // Gets the rectangle of the page including shadow.
235 virtual pp::Rect GetPageRect(int index) = 0; 239 virtual pp::Rect GetPageRect(int index) = 0;
236 // Gets the rectangle of the page excluding any additional areas.
237 virtual pp::Rect GetPageContentsRect(int index) = 0; 240 virtual pp::Rect GetPageContentsRect(int index) = 0;
238 // Returns a page's rect in screen coordinates, as well as its surrounding 241 // Returns a page's rect in screen coordinates, as well as its surrounding
239 // border areas and bottom separator. 242 // border areas and bottom separator.
240 virtual pp::Rect GetPageScreenRect(int page_index) const = 0; 243 virtual pp::Rect GetPageScreenRect(int page_index) const = 0;
241 // Gets the offset of the vertical scrollbar from the top in document 244 // Gets the offset of the vertical scrollbar from the top in document
242 // coordinates. 245 // coordinates.
243 virtual int GetVerticalScrollbarYPosition() = 0; 246 virtual int GetVerticalScrollbarYPosition() = 0;
244 // Set color / grayscale rendering modes. 247 // Set color / grayscale rendering modes.
245 virtual void SetGrayscale(bool grayscale) = 0; 248 virtual void SetGrayscale(bool grayscale) = 0;
246 // Callback for timer that's set with ScheduleCallback(). 249 // Callback for timer that's set with ScheduleCallback().
247 virtual void OnCallback(int id) = 0; 250 virtual void OnCallback(int id) = 0;
248 // Gets the JSON representation of the PDF file 251 // Gets the JSON representation of the PDF file
249 virtual std::string GetPageAsJSON(int index) = 0; 252 virtual std::string GetPageAsJSON(int index) = 0;
253 // Enable accessibility support and start sending the accessible text and
254 // other metadata to the client.
255 virtual void EnableAccessibility() = 0;
250 // Gets the PDF document's print scaling preference. True if the document can 256 // Gets the PDF document's print scaling preference. True if the document can
251 // be scaled to fit. 257 // be scaled to fit.
252 virtual bool GetPrintScaling() = 0; 258 virtual bool GetPrintScaling() = 0;
253 // Returns number of copies to be printed. 259 // Returns number of copies to be printed.
254 virtual int GetCopiesToPrint() = 0; 260 virtual int GetCopiesToPrint() = 0;
255 // Returns the duplex setting. 261 // Returns the duplex setting.
256 virtual int GetDuplexType() = 0; 262 virtual int GetDuplexType() = 0;
257 // Returns true if all the pages are the same size. 263 // Returns true if all the pages are the same size.
258 virtual bool GetPageSizeAndUniformity(pp::Size* size) = 0; 264 virtual bool GetPageSizeAndUniformity(pp::Size* size) = 0;
259 265
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 342
337 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. 343 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details.
338 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, 344 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer,
339 int pdf_buffer_size, int page_number, 345 int pdf_buffer_size, int page_number,
340 double* width, double* height) = 0; 346 double* width, double* height) = 0;
341 }; 347 };
342 348
343 } // namespace chrome_pdf 349 } // namespace chrome_pdf
344 350
345 #endif // PDF_PDF_ENGINE_H_ 351 #endif // PDF_PDF_ENGINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698