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

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

Issue 2924343005: Add functionality for copying text within form text fields and form combobox text fields (Closed)
Patch Set: Selection bug fix Created 3 years, 6 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
« no previous file with comments | « no previous file | pdf/pdfium/pdfium_engine.cc » ('j') | pdf/pdfium/pdfium_engine.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 pp::Buffer_Dev PrintPagesAsPDF(const PP_PrintPageNumberRange_Dev* page_ranges, 311 pp::Buffer_Dev PrintPagesAsPDF(const PP_PrintPageNumberRange_Dev* page_ranges,
312 uint32_t page_range_count, 312 uint32_t page_range_count,
313 const PP_PrintSettings_Dev& print_settings); 313 const PP_PrintSettings_Dev& print_settings);
314 314
315 pp::Buffer_Dev GetFlattenedPrintData(const FPDF_DOCUMENT& doc); 315 pp::Buffer_Dev GetFlattenedPrintData(const FPDF_DOCUMENT& doc);
316 void FitContentsToPrintableAreaIfRequired( 316 void FitContentsToPrintableAreaIfRequired(
317 const FPDF_DOCUMENT& doc, 317 const FPDF_DOCUMENT& doc,
318 const PP_PrintSettings_Dev& print_settings); 318 const PP_PrintSettings_Dev& print_settings);
319 void SaveSelectedFormForPrint(); 319 void SaveSelectedFormForPrint();
320 320
321 // Sets plugin's selected text to be selected text in form text field
322 // if available.
323 void SetFormSelectedText(const FPDF_FORMHANDLE& hHandle,
Lei Zhang 2017/06/16 21:34:53 hHandle -> PDFium variable naming style leaking ou
drgage 2017/06/16 23:15:04 Done.
324 const FPDF_PAGE& page);
325
321 // Given a mouse event, returns which page and character location it's closest 326 // Given a mouse event, returns which page and character location it's closest
322 // to. 327 // to.
323 PDFiumPage::Area GetCharIndex(const pp::MouseInputEvent& event, 328 PDFiumPage::Area GetCharIndex(const pp::MouseInputEvent& event,
324 int* page_index, 329 int* page_index,
325 int* char_index, 330 int* char_index,
326 int* form_type, 331 int* form_type,
327 PDFiumPage::LinkTarget* target); 332 PDFiumPage::LinkTarget* target);
328 PDFiumPage::Area GetCharIndex(const pp::Point& point, 333 PDFiumPage::Area GetCharIndex(const pp::Point& point,
329 int* page_index, 334 int* page_index,
330 int* char_index, 335 int* char_index,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 pp::ImageData* image_data, 435 pp::ImageData* image_data,
431 void** region, 436 void** region,
432 int* stride) const; 437 int* stride) const;
433 438
434 // Called when the selection changes. 439 // Called when the selection changes.
435 void OnSelectionChanged(); 440 void OnSelectionChanged();
436 441
437 // Common code shared by RotateClockwise() and RotateCounterclockwise(). 442 // Common code shared by RotateClockwise() and RotateCounterclockwise().
438 void RotateInternal(); 443 void RotateInternal();
439 444
440 // Setting selection status of document. 445 // Setting text selection status of document. This does not include text
446 // within form text fields.
441 void SetSelecting(bool selecting); 447 void SetSelecting(bool selecting);
442 448
449 // Sets status of whether or not focus is in form text field.
450 void SetInFormTextField(bool in_form_text_field);
451
443 bool PageIndexInBounds(int index) const; 452 bool PageIndexInBounds(int index) const;
444 453
445 void ScheduleTouchTimer(const pp::TouchInputEvent& event); 454 void ScheduleTouchTimer(const pp::TouchInputEvent& event);
446 void KillTouchTimer(int timer_id); 455 void KillTouchTimer(int timer_id);
447 void HandleLongPress(const pp::TouchInputEvent& event); 456 void HandleLongPress(const pp::TouchInputEvent& event);
448 457
449 // FPDF_FORMFILLINFO callbacks. 458 // FPDF_FORMFILLINFO callbacks.
450 static void Form_Invalidate(FPDF_FORMFILLINFO* param, 459 static void Form_Invalidate(FPDF_FORMFILLINFO* param,
451 FPDF_PAGE page, 460 FPDF_PAGE page,
452 double left, 461 double left,
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 642
634 // The indexes of the pages pending download. 643 // The indexes of the pages pending download.
635 std::vector<int> pending_pages_; 644 std::vector<int> pending_pages_;
636 645
637 // During handling of input events we don't want to unload any pages in 646 // During handling of input events we don't want to unload any pages in
638 // callbacks to us from PDFium, since the current page can change while PDFium 647 // callbacks to us from PDFium, since the current page can change while PDFium
639 // code still has a pointer to it. 648 // code still has a pointer to it.
640 bool defer_page_unload_; 649 bool defer_page_unload_;
641 std::vector<int> deferred_page_unloads_; 650 std::vector<int> deferred_page_unloads_;
642 651
643 // Used for selection. There could be more than one range if selection spans 652 // Used for text selection, but does not include text within form text fields.
644 // more than one page. 653 // There could be more than one range if selection spans more than one page.
645 std::vector<PDFiumRange> selection_; 654 std::vector<PDFiumRange> selection_;
646 // True if we're in the middle of selection. 655 // True if we're in the middle of text selection.
647 bool selecting_; 656 bool selecting_;
648 657
658 // True if focus is on form text field.
659 bool in_form_text_field_;
660
649 MouseDownState mouse_down_state_; 661 MouseDownState mouse_down_state_;
650 662
651 // Used for searching. 663 // Used for searching.
652 std::vector<PDFiumRange> find_results_; 664 std::vector<PDFiumRange> find_results_;
653 // Which page to search next. 665 // Which page to search next.
654 int next_page_to_search_; 666 int next_page_to_search_;
655 // Where to stop searching. 667 // Where to stop searching.
656 int last_page_to_search_; 668 int last_page_to_search_;
657 int last_character_index_to_search_; // -1 if search until end of page. 669 int last_character_index_to_search_; // -1 if search until end of page.
658 // Which result the user has currently selected. 670 // Which result the user has currently selected.
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 bool GetPDFPageSizeByIndex(const void* pdf_buffer, 810 bool GetPDFPageSizeByIndex(const void* pdf_buffer,
799 int pdf_buffer_size, 811 int pdf_buffer_size,
800 int page_number, 812 int page_number,
801 double* width, 813 double* width,
802 double* height) override; 814 double* height) override;
803 }; 815 };
804 816
805 } // namespace chrome_pdf 817 } // namespace chrome_pdf
806 818
807 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ 819 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_
OLDNEW
« no previous file with comments | « no previous file | pdf/pdfium/pdfium_engine.cc » ('j') | pdf/pdfium/pdfium_engine.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698