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

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: Removed unwanted diff files 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,
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 selection status of document.
441 void SetSelecting(bool selecting); 446 void SetSelecting(bool selecting);
442 447
448 // Sets status of whether or not we're in a form field text field.
Lei Zhang 2017/06/10 01:55:49 Try to avoid pronouns. Who does "we" refer to? You
drgage 2017/06/12 18:57:47 Done. Wouldn't it be strange if we were trapped in
449 void SetInFormTextField(bool in_form_text_field);
450
443 bool PageIndexInBounds(int index) const; 451 bool PageIndexInBounds(int index) const;
444 452
445 void ScheduleTouchTimer(const pp::TouchInputEvent& event); 453 void ScheduleTouchTimer(const pp::TouchInputEvent& event);
446 void KillTouchTimer(int timer_id); 454 void KillTouchTimer(int timer_id);
447 void HandleLongPress(const pp::TouchInputEvent& event); 455 void HandleLongPress(const pp::TouchInputEvent& event);
448 456
449 // FPDF_FORMFILLINFO callbacks. 457 // FPDF_FORMFILLINFO callbacks.
450 static void Form_Invalidate(FPDF_FORMFILLINFO* param, 458 static void Form_Invalidate(FPDF_FORMFILLINFO* param,
451 FPDF_PAGE page, 459 FPDF_PAGE page,
452 double left, 460 double left,
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 // code still has a pointer to it. 647 // code still has a pointer to it.
640 bool defer_page_unload_; 648 bool defer_page_unload_;
641 std::vector<int> deferred_page_unloads_; 649 std::vector<int> deferred_page_unloads_;
642 650
643 // Used for selection. There could be more than one range if selection spans 651 // Used for selection. There could be more than one range if selection spans
644 // more than one page. 652 // more than one page.
645 std::vector<PDFiumRange> selection_; 653 std::vector<PDFiumRange> selection_;
646 // True if we're in the middle of selection. 654 // True if we're in the middle of selection.
647 bool selecting_; 655 bool selecting_;
648 656
657 // True if we're within a form field text field.
658 bool in_form_text_field_;
659
649 MouseDownState mouse_down_state_; 660 MouseDownState mouse_down_state_;
650 661
651 // Used for searching. 662 // Used for searching.
652 std::vector<PDFiumRange> find_results_; 663 std::vector<PDFiumRange> find_results_;
653 // Which page to search next. 664 // Which page to search next.
654 int next_page_to_search_; 665 int next_page_to_search_;
655 // Where to stop searching. 666 // Where to stop searching.
656 int last_page_to_search_; 667 int last_page_to_search_;
657 int last_character_index_to_search_; // -1 if search until end of page. 668 int last_character_index_to_search_; // -1 if search until end of page.
658 // Which result the user has currently selected. 669 // 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, 809 bool GetPDFPageSizeByIndex(const void* pdf_buffer,
799 int pdf_buffer_size, 810 int pdf_buffer_size,
800 int page_number, 811 int page_number,
801 double* width, 812 double* width,
802 double* height) override; 813 double* height) override;
803 }; 814 };
804 815
805 } // namespace chrome_pdf 816 } // namespace chrome_pdf
806 817
807 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ 818 #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