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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 // DocumentLoader::Client implementation. | 114 // DocumentLoader::Client implementation. |
115 pp::Instance* GetPluginInstance() override; | 115 pp::Instance* GetPluginInstance() override; |
116 pp::URLLoader CreateURLLoader() override; | 116 pp::URLLoader CreateURLLoader() override; |
117 void OnPartialDocumentLoaded() override; | 117 void OnPartialDocumentLoaded() override; |
118 void OnPendingRequestComplete() override; | 118 void OnPendingRequestComplete() override; |
119 void OnNewDataAvailable() override; | 119 void OnNewDataAvailable() override; |
120 void OnDocumentComplete() override; | 120 void OnDocumentComplete() override; |
121 | 121 |
122 void UnsupportedFeature(int type); | 122 void UnsupportedFeature(int type); |
| 123 void FontSubstituted(); |
123 | 124 |
124 std::string current_find_text() const { return current_find_text_; } | 125 std::string current_find_text() const { return current_find_text_; } |
125 | 126 |
126 FPDF_DOCUMENT doc() { return doc_; } | 127 FPDF_DOCUMENT doc() { return doc_; } |
127 FPDF_FORMHANDLE form() { return form_; } | 128 FPDF_FORMHANDLE form() { return form_; } |
128 | 129 |
129 private: | 130 private: |
130 // This helper class is used to detect the difference in selection between | 131 // This helper class is used to detect the difference in selection between |
131 // construction and destruction. At destruction, it invalidates all the | 132 // construction and destruction. At destruction, it invalidates all the |
132 // parts that are newly selected, along with all the parts that used to be | 133 // parts that are newly selected, along with all the parts that used to be |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 | 736 |
736 // Create a local variable of this when calling PDFium functions which can call | 737 // Create a local variable of this when calling PDFium functions which can call |
737 // our global callback when an unsupported feature is reached. | 738 // our global callback when an unsupported feature is reached. |
738 class ScopedUnsupportedFeature { | 739 class ScopedUnsupportedFeature { |
739 public: | 740 public: |
740 explicit ScopedUnsupportedFeature(PDFiumEngine* engine); | 741 explicit ScopedUnsupportedFeature(PDFiumEngine* engine); |
741 ~ScopedUnsupportedFeature(); | 742 ~ScopedUnsupportedFeature(); |
742 | 743 |
743 private: | 744 private: |
744 PDFiumEngine* const old_engine_; | 745 PDFiumEngine* const old_engine_; |
| 746 |
| 747 DISALLOW_COPY_AND_ASSIGN(ScopedUnsupportedFeature); |
| 748 }; |
| 749 |
| 750 // Create a local variable of this when calling PDFium functions which can call |
| 751 // our global callback when a substitute font is mapped. |
| 752 class ScopedSubstFont { |
| 753 public: |
| 754 explicit ScopedSubstFont(PDFiumEngine* engine); |
| 755 ~ScopedSubstFont(); |
| 756 |
| 757 private: |
| 758 PDFiumEngine* const old_engine_; |
| 759 |
| 760 DISALLOW_COPY_AND_ASSIGN(ScopedSubstFont); |
745 }; | 761 }; |
746 | 762 |
747 class PDFiumEngineExports : public PDFEngineExports { | 763 class PDFiumEngineExports : public PDFEngineExports { |
748 public: | 764 public: |
749 PDFiumEngineExports() {} | 765 PDFiumEngineExports() {} |
750 | 766 |
751 // PDFEngineExports: | 767 // PDFEngineExports: |
752 #if defined(OS_WIN) | 768 #if defined(OS_WIN) |
753 bool RenderPDFPageToDC(const void* pdf_buffer, | 769 bool RenderPDFPageToDC(const void* pdf_buffer, |
754 int buffer_size, | 770 int buffer_size, |
(...skipping 17 matching lines...) Expand all Loading... |
772 bool GetPDFPageSizeByIndex(const void* pdf_buffer, | 788 bool GetPDFPageSizeByIndex(const void* pdf_buffer, |
773 int pdf_buffer_size, | 789 int pdf_buffer_size, |
774 int page_number, | 790 int page_number, |
775 double* width, | 791 double* width, |
776 double* height) override; | 792 double* height) override; |
777 }; | 793 }; |
778 | 794 |
779 } // namespace chrome_pdf | 795 } // namespace chrome_pdf |
780 | 796 |
781 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ | 797 #endif // PDF_PDFIUM_PDFIUM_ENGINE_H_ |
OLD | NEW |