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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 virtual void RotateCounterclockwise() = 0; | 213 virtual void RotateCounterclockwise() = 0; |
214 virtual std::string GetSelectedText() = 0; | 214 virtual std::string GetSelectedText() = 0; |
215 virtual std::string GetLinkAtPosition(const pp::Point& point) = 0; | 215 virtual std::string GetLinkAtPosition(const pp::Point& point) = 0; |
216 virtual bool IsSelecting() = 0; | 216 virtual bool IsSelecting() = 0; |
217 // Checks the permissions associated with this document. | 217 // Checks the permissions associated with this document. |
218 virtual bool HasPermission(DocumentPermission permission) const = 0; | 218 virtual bool HasPermission(DocumentPermission permission) const = 0; |
219 virtual void SelectAll() = 0; | 219 virtual void SelectAll() = 0; |
220 // Gets the number of pages in the document. | 220 // Gets the number of pages in the document. |
221 virtual int GetNumberOfPages() = 0; | 221 virtual int GetNumberOfPages() = 0; |
222 // Gets the 0-based page number of |destination|, or -1 if it does not exist. | 222 // Gets the 0-based page number of |destination|, or -1 if it does not exist. |
223 virtual int GetNamedDestinationPage(const std::string& destination) = 0; | 223 virtual int GetNamedDestinationPage(const std::string& destination) = 0; |
raymes
2015/01/11 23:08:41
We can probably remove this function now
Deepak
2015/01/12 09:21:43
This function is currently getting used in instanc
raymes
2015/01/13 01:59:31
Ah right, thanks :)
| |
224 // Gets the index of the first visible page, or -1 if none are visible. | 224 // Gets the index of the first visible page, or -1 if none are visible. |
225 virtual int GetFirstVisiblePage() = 0; | 225 virtual int GetFirstVisiblePage() = 0; |
226 // Gets the index of the most visible page, or -1 if none are visible. | 226 // Gets the index of the most visible page, or -1 if none are visible. |
227 virtual int GetMostVisiblePage() = 0; | 227 virtual int GetMostVisiblePage() = 0; |
228 // Gets the rectangle of the page including shadow. | 228 // Gets the rectangle of the page including shadow. |
229 virtual pp::Rect GetPageRect(int index) = 0; | 229 virtual pp::Rect GetPageRect(int index) = 0; |
230 // Gets the rectangle of the page excluding any additional areas. | 230 // Gets the rectangle of the page excluding any additional areas. |
231 virtual pp::Rect GetPageContentsRect(int index) = 0; | 231 virtual pp::Rect GetPageContentsRect(int index) = 0; |
232 // Gets the offset of the vertical scrollbar from the top in document | 232 // Gets the offset of the vertical scrollbar from the top in document |
233 // coordinates. | 233 // coordinates. |
(...skipping 19 matching lines...) Expand all Loading... | |
253 // document at page |index|. | 253 // document at page |index|. |
254 virtual void AppendPage(PDFEngine* engine, int index) = 0; | 254 virtual void AppendPage(PDFEngine* engine, int index) = 0; |
255 | 255 |
256 // Allow client to query and reset scroll positions in document coordinates. | 256 // 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, | 257 // 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. | 258 // and not for general scrolling - the engine will not repaint due to this. |
259 virtual pp::Point GetScrollPosition() = 0; | 259 virtual pp::Point GetScrollPosition() = 0; |
260 virtual void SetScrollPosition(const pp::Point& position) = 0; | 260 virtual void SetScrollPosition(const pp::Point& position) = 0; |
261 | 261 |
262 virtual bool IsProgressiveLoad() = 0; | 262 virtual bool IsProgressiveLoad() = 0; |
263 | |
264 virtual unsigned long GetNameDestCount() = 0; | |
265 virtual void GetNameDests(std::vector<std::string>* name_dest) = 0; | |
263 }; | 266 }; |
264 | 267 |
265 // Interface for exports that wrap the PDF engine. | 268 // Interface for exports that wrap the PDF engine. |
266 class PDFEngineExports { | 269 class PDFEngineExports { |
267 public: | 270 public: |
268 struct RenderingSettings { | 271 struct RenderingSettings { |
269 RenderingSettings(int dpi_x, | 272 RenderingSettings(int dpi_x, |
270 int dpi_y, | 273 int dpi_y, |
271 const pp::Rect& bounds, | 274 const pp::Rect& bounds, |
272 bool fit_to_bounds, | 275 bool fit_to_bounds, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
314 | 317 |
315 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 318 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
316 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 319 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
317 int pdf_buffer_size, int page_number, | 320 int pdf_buffer_size, int page_number, |
318 double* width, double* height) = 0; | 321 double* width, double* height) = 0; |
319 }; | 322 }; |
320 | 323 |
321 } // namespace chrome_pdf | 324 } // namespace chrome_pdf |
322 | 325 |
323 #endif // PDF_PDF_ENGINE_H_ | 326 #endif // PDF_PDF_ENGINE_H_ |
OLD | NEW |