| 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_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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 // code still has a pointer to it. | 502 // code still has a pointer to it. |
| 503 bool defer_page_unload_; | 503 bool defer_page_unload_; |
| 504 std::vector<int> deferred_page_unloads_; | 504 std::vector<int> deferred_page_unloads_; |
| 505 | 505 |
| 506 // Used for selection. There could be more than one range if selection spans | 506 // Used for selection. There could be more than one range if selection spans |
| 507 // more than one page. | 507 // more than one page. |
| 508 std::vector<PDFiumRange> selection_; | 508 std::vector<PDFiumRange> selection_; |
| 509 // True if we're in the middle of selection. | 509 // True if we're in the middle of selection. |
| 510 bool selecting_; | 510 bool selecting_; |
| 511 | 511 |
| 512 // Used to store mouse down state to handle it in other mouse event handlers. |
| 513 struct MouseDownState { |
| 514 MouseDownState() {}; |
| 515 MouseDownState(PDFiumPage::Area area, PDFiumPage::LinkTarget target) |
| 516 : area_(area), target_(target) {}; |
| 517 PDFiumPage::Area area_; |
| 518 PDFiumPage::LinkTarget target_; |
| 519 |
| 520 bool operator==(const MouseDownState& rhs) const { |
| 521 return (area_ == rhs.area_) && (target_.url == rhs.target_.url); |
| 522 } |
| 523 |
| 524 bool operator!=(const MouseDownState rhs) const { |
| 525 return (area_ != rhs.area_) || (target_.url != rhs.target_.url); |
| 526 } |
| 527 }; |
| 528 MouseDownState mouse_down_state_; |
| 529 |
| 512 // Used for searching. | 530 // Used for searching. |
| 513 typedef std::vector<PDFiumRange> FindResults; | 531 typedef std::vector<PDFiumRange> FindResults; |
| 514 FindResults find_results_; | 532 FindResults find_results_; |
| 515 // Which page to search next. | 533 // Which page to search next. |
| 516 int next_page_to_search_; | 534 int next_page_to_search_; |
| 517 // Where to stop searching. | 535 // Where to stop searching. |
| 518 int last_page_to_search_; | 536 int last_page_to_search_; |
| 519 int last_character_index_to_search_; // -1 if search until end of page. | 537 int last_character_index_to_search_; // -1 if search until end of page. |
| 520 // Which result the user has currently selected. | 538 // Which result the user has currently selected. |
| 521 int current_find_index_; | 539 int current_find_index_; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 | 643 |
| 626 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 644 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
| 627 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 645 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
| 628 int pdf_buffer_size, int page_number, | 646 int pdf_buffer_size, int page_number, |
| 629 double* width, double* height); | 647 double* width, double* height); |
| 630 }; | 648 }; |
| 631 | 649 |
| 632 } // namespace chrome_pdf | 650 } // namespace chrome_pdf |
| 633 | 651 |
| 634 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ | 652 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ |
| OLD | NEW |