Chromium Code Reviews| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 442 void RotateInternal(); | 442 void RotateInternal(); |
| 443 | 443 |
| 444 // Sets text selection status of document. This does not include text | 444 // Sets text selection status of document. This does not include text |
| 445 // within form text fields. | 445 // within form text fields. |
| 446 void SetSelecting(bool selecting); | 446 void SetSelecting(bool selecting); |
| 447 | 447 |
| 448 // Sets whether or not focus is in form text field or form combobox text | 448 // Sets whether or not focus is in form text field or form combobox text |
| 449 // field. | 449 // field. |
| 450 void SetInFormTextArea(bool in_form_text_area); | 450 void SetInFormTextArea(bool in_form_text_area); |
| 451 | 451 |
| 452 // Sets whether or not left mouse button is currently being held down. | |
| 453 void SetMouseHeldDown(bool mouse_held_down); | |
| 454 | |
| 452 bool PageIndexInBounds(int index) const; | 455 bool PageIndexInBounds(int index) const; |
| 453 | 456 |
| 454 void ScheduleTouchTimer(const pp::TouchInputEvent& event); | 457 void ScheduleTouchTimer(const pp::TouchInputEvent& event); |
| 455 void KillTouchTimer(int timer_id); | 458 void KillTouchTimer(int timer_id); |
| 456 void HandleLongPress(const pp::TouchInputEvent& event); | 459 void HandleLongPress(const pp::TouchInputEvent& event); |
| 457 | 460 |
| 458 // FPDF_FORMFILLINFO callbacks. | 461 // FPDF_FORMFILLINFO callbacks. |
| 459 static void Form_Invalidate(FPDF_FORMFILLINFO* param, | 462 static void Form_Invalidate(FPDF_FORMFILLINFO* param, |
| 460 FPDF_PAGE page, | 463 FPDF_PAGE page, |
| 461 double left, | 464 double left, |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 642 | 645 |
| 643 // The indexes of the pages pending download. | 646 // The indexes of the pages pending download. |
| 644 std::vector<int> pending_pages_; | 647 std::vector<int> pending_pages_; |
| 645 | 648 |
| 646 // During handling of input events we don't want to unload any pages in | 649 // During handling of input events we don't want to unload any pages in |
| 647 // callbacks to us from PDFium, since the current page can change while PDFium | 650 // callbacks to us from PDFium, since the current page can change while PDFium |
| 648 // code still has a pointer to it. | 651 // code still has a pointer to it. |
| 649 bool defer_page_unload_; | 652 bool defer_page_unload_; |
| 650 std::vector<int> deferred_page_unloads_; | 653 std::vector<int> deferred_page_unloads_; |
| 651 | 654 |
| 652 // Used for text selection, but does not include text within form text fields. | 655 // Used for text selection, but does not include text within form text areas. |
| 653 // There could be more than one range if selection spans more than one page. | 656 // There could be more than one range if selection spans more than one page. |
| 654 std::vector<PDFiumRange> selection_; | 657 std::vector<PDFiumRange> selection_; |
| 655 // True if we're in the middle of text selection. | 658 // True if we're in the middle of text selection. |
| 656 bool selecting_; | 659 bool selecting_; |
| 657 | 660 |
| 661 // Used for selection of text within form text areas (text fields and combo | |
| 662 // box text fields). Represents the currently selected text. | |
| 663 std::string selected_form_text_; | |
| 664 | |
| 665 // Used for selection of text within form text areas (text fields and combo | |
| 666 // box text fields). Represents the previously selected text. | |
| 667 std::string old_selected_form_text_; | |
| 668 | |
| 658 // True if focus is in form text field or form combobox text field. | 669 // True if focus is in form text field or form combobox text field. |
| 659 bool in_form_text_area_; | 670 bool in_form_text_area_; |
| 660 | 671 |
| 672 // True if left mouse button is currently being held down. | |
| 673 bool mouse_held_down_; | |
|
Lei Zhang
2017/06/29 02:52:46
Do we need |mouse_held_down_| if we already have |
drgage
2017/06/29 17:49:59
The reason I added |mouse_held_down_| is because t
| |
| 674 | |
| 661 MouseDownState mouse_down_state_; | 675 MouseDownState mouse_down_state_; |
| 662 | 676 |
| 663 // Used for searching. | 677 // Used for searching. |
| 664 std::vector<PDFiumRange> find_results_; | 678 std::vector<PDFiumRange> find_results_; |
| 665 // Which page to search next. | 679 // Which page to search next. |
| 666 int next_page_to_search_; | 680 int next_page_to_search_; |
| 667 // Where to stop searching. | 681 // Where to stop searching. |
| 668 int last_page_to_search_; | 682 int last_page_to_search_; |
| 669 int last_character_index_to_search_; // -1 if search until end of page. | 683 int last_character_index_to_search_; // -1 if search until end of page. |
| 670 // Which result the user has currently selected. | 684 // Which result the user has currently selected. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 810 bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 824 bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
| 811 int pdf_buffer_size, | 825 int pdf_buffer_size, |
| 812 int page_number, | 826 int page_number, |
| 813 double* width, | 827 double* width, |
| 814 double* height) override; | 828 double* height) override; |
| 815 }; | 829 }; |
| 816 | 830 |
| 817 } // namespace chrome_pdf | 831 } // namespace chrome_pdf |
| 818 | 832 |
| 819 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ | 833 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ |
| OLD | NEW |