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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 bool Matches(const PDFiumPage::Area& area, | 144 bool Matches(const PDFiumPage::Area& area, |
145 const PDFiumPage::LinkTarget& target) const; | 145 const PDFiumPage::LinkTarget& target) const; |
146 | 146 |
147 private: | 147 private: |
148 PDFiumPage::Area area_; | 148 PDFiumPage::Area area_; |
149 PDFiumPage::LinkTarget target_; | 149 PDFiumPage::LinkTarget target_; |
150 | 150 |
151 DISALLOW_COPY_AND_ASSIGN(MouseDownState); | 151 DISALLOW_COPY_AND_ASSIGN(MouseDownState); |
152 }; | 152 }; |
153 | 153 |
154 // Used to store the state of a text search. | |
155 class FindTextData { | |
raymes
2014/11/03 05:17:31
Since this seems like an abstraction over the inde
Lei Zhang
2014/11/03 23:25:42
FindTextIndex it is.
| |
156 public: | |
157 FindTextData(); | |
158 ~FindTextData(); | |
159 | |
160 bool valid() const { return valid_; } | |
161 void Invalidate(); | |
162 | |
163 size_t GetIndex() const; | |
164 void SetIndex(size_t index); | |
165 size_t IncrementIndex(); | |
166 | |
167 private: | |
168 bool valid_; // Whether |index_| is valid or not. | |
169 size_t index_; // The current search result, 0-based. | |
170 | |
171 DISALLOW_COPY_AND_ASSIGN(FindTextData); | |
172 }; | |
173 | |
154 friend class SelectionChangeInvalidator; | 174 friend class SelectionChangeInvalidator; |
155 | 175 |
156 struct FileAvail : public FX_FILEAVAIL { | 176 struct FileAvail : public FX_FILEAVAIL { |
157 DocumentLoader* loader; | 177 DocumentLoader* loader; |
158 }; | 178 }; |
159 | 179 |
160 struct DownloadHints : public FX_DOWNLOADHINTS { | 180 struct DownloadHints : public FX_DOWNLOADHINTS { |
161 DocumentLoader* loader; | 181 DocumentLoader* loader; |
162 }; | 182 }; |
163 | 183 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
384 pp::ImageData* image_data); | 404 pp::ImageData* image_data); |
385 | 405 |
386 void GetRegion(const pp::Point& location, | 406 void GetRegion(const pp::Point& location, |
387 pp::ImageData* image_data, | 407 pp::ImageData* image_data, |
388 void** region, | 408 void** region, |
389 int* stride) const; | 409 int* stride) const; |
390 | 410 |
391 // Called when the selection changes. | 411 // Called when the selection changes. |
392 void OnSelectionChanged(); | 412 void OnSelectionChanged(); |
393 | 413 |
414 // Common code shared by RotateClockwise() and RotateCounterclockwise(). | |
415 void RotateInternal(); | |
416 | |
394 // FPDF_FORMFILLINFO callbacks. | 417 // FPDF_FORMFILLINFO callbacks. |
395 static void Form_Invalidate(FPDF_FORMFILLINFO* param, | 418 static void Form_Invalidate(FPDF_FORMFILLINFO* param, |
396 FPDF_PAGE page, | 419 FPDF_PAGE page, |
397 double left, | 420 double left, |
398 double top, | 421 double top, |
399 double right, | 422 double right, |
400 double bottom); | 423 double bottom); |
401 static void Form_OutputSelectedRect(FPDF_FORMFILLINFO* param, | 424 static void Form_OutputSelectedRect(FPDF_FORMFILLINFO* param, |
402 FPDF_PAGE page, | 425 FPDF_PAGE page, |
403 double left, | 426 double left, |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
533 | 556 |
534 // Used for searching. | 557 // Used for searching. |
535 typedef std::vector<PDFiumRange> FindResults; | 558 typedef std::vector<PDFiumRange> FindResults; |
536 FindResults find_results_; | 559 FindResults find_results_; |
537 // Which page to search next. | 560 // Which page to search next. |
538 int next_page_to_search_; | 561 int next_page_to_search_; |
539 // Where to stop searching. | 562 // Where to stop searching. |
540 int last_page_to_search_; | 563 int last_page_to_search_; |
541 int last_character_index_to_search_; // -1 if search until end of page. | 564 int last_character_index_to_search_; // -1 if search until end of page. |
542 // Which result the user has currently selected. | 565 // Which result the user has currently selected. |
543 int current_find_index_; | 566 FindTextData current_find_index_; |
544 // Where to resume searching. | 567 // Where to resume searching. |
545 int resume_find_index_; | 568 FindTextData resume_find_index_; |
546 | 569 |
547 // Permissions bitfield. | 570 // Permissions bitfield. |
548 unsigned long permissions_; | 571 unsigned long permissions_; |
549 | 572 |
550 // Interface structure to provide access to document stream. | 573 // Interface structure to provide access to document stream. |
551 FPDF_FILEACCESS file_access_; | 574 FPDF_FILEACCESS file_access_; |
552 // Interface structure to check data availability in the document stream. | 575 // Interface structure to check data availability in the document stream. |
553 FileAvail file_availability_; | 576 FileAvail file_availability_; |
554 // Interface structure to request data chunks from the document stream. | 577 // Interface structure to request data chunks from the document stream. |
555 DownloadHints download_hints_; | 578 DownloadHints download_hints_; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
649 | 672 |
650 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. | 673 // See the definition of GetPDFPageSizeByIndex in pdf.cc for details. |
651 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 674 virtual bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
652 int pdf_buffer_size, int page_number, | 675 int pdf_buffer_size, int page_number, |
653 double* width, double* height); | 676 double* width, double* height); |
654 }; | 677 }; |
655 | 678 |
656 } // namespace chrome_pdf | 679 } // namespace chrome_pdf |
657 | 680 |
658 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ | 681 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ |
OLD | NEW |