| 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 PRINTING_PDF_METAFILE_SKIA_H_ | 5 #ifndef PRINTING_PDF_METAFILE_SKIA_H_ |
| 6 #define PRINTING_PDF_METAFILE_SKIA_H_ | 6 #define PRINTING_PDF_METAFILE_SKIA_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 virtual bool StartPage(const gfx::Size& page_size, | 38 virtual bool StartPage(const gfx::Size& page_size, |
| 39 const gfx::Rect& content_area, | 39 const gfx::Rect& content_area, |
| 40 const float& scale_factor) OVERRIDE; | 40 const float& scale_factor) OVERRIDE; |
| 41 virtual bool FinishPage() OVERRIDE; | 41 virtual bool FinishPage() OVERRIDE; |
| 42 virtual bool FinishDocument() OVERRIDE; | 42 virtual bool FinishDocument() OVERRIDE; |
| 43 | 43 |
| 44 virtual uint32 GetDataSize() const OVERRIDE; | 44 virtual uint32 GetDataSize() const OVERRIDE; |
| 45 virtual bool GetData(void* dst_buffer, uint32 dst_buffer_size) const OVERRIDE; | 45 virtual bool GetData(void* dst_buffer, uint32 dst_buffer_size) const OVERRIDE; |
| 46 | 46 |
| 47 virtual bool SaveTo(const base::FilePath& file_path) const OVERRIDE; | |
| 48 | |
| 49 virtual gfx::Rect GetPageBounds(unsigned int page_number) const OVERRIDE; | 47 virtual gfx::Rect GetPageBounds(unsigned int page_number) const OVERRIDE; |
| 50 virtual unsigned int GetPageCount() const OVERRIDE; | 48 virtual unsigned int GetPageCount() const OVERRIDE; |
| 51 | 49 |
| 52 virtual gfx::NativeDrawingContext context() const OVERRIDE; | 50 virtual gfx::NativeDrawingContext context() const OVERRIDE; |
| 53 | 51 |
| 54 #if defined(OS_WIN) | 52 #if defined(OS_WIN) |
| 55 virtual bool Playback(gfx::NativeDrawingContext hdc, | 53 virtual bool Playback(gfx::NativeDrawingContext hdc, |
| 56 const RECT* rect) const OVERRIDE; | 54 const RECT* rect) const OVERRIDE; |
| 57 virtual bool SafePlayback(gfx::NativeDrawingContext hdc) const OVERRIDE; | 55 virtual bool SafePlayback(gfx::NativeDrawingContext hdc) const OVERRIDE; |
| 58 virtual HENHMETAFILE emf() const OVERRIDE; | |
| 59 #elif defined(OS_MACOSX) | 56 #elif defined(OS_MACOSX) |
| 60 virtual bool RenderPage(unsigned int page_number, | 57 virtual bool RenderPage(unsigned int page_number, |
| 61 gfx::NativeDrawingContext context, | 58 gfx::NativeDrawingContext context, |
| 62 const CGRect rect, | 59 const CGRect rect, |
| 63 const MacRenderPageParams& params) const OVERRIDE; | 60 const MacRenderPageParams& params) const OVERRIDE; |
| 64 #endif | 61 #endif |
| 65 | 62 |
| 66 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) | 63 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) |
| 67 virtual bool SaveToFD(const base::FileDescriptor& fd) const OVERRIDE; | 64 // TODO(vitalybuka): replace with SaveTo(). |
| 65 bool SaveToFD(const base::FileDescriptor& fd) const; |
| 68 #endif // if defined(OS_CHROMEOS) || defined(OS_ANDROID) | 66 #endif // if defined(OS_CHROMEOS) || defined(OS_ANDROID) |
| 69 | 67 |
| 70 // Return a new metafile containing just the current page in draft mode. | 68 // Return a new metafile containing just the current page in draft mode. |
| 71 PdfMetafileSkia* GetMetafileForCurrentPage(); | 69 scoped_ptr<PdfMetafileSkia> GetMetafileForCurrentPage(); |
| 72 | 70 |
| 73 private: | 71 private: |
| 74 scoped_ptr<PdfMetafileSkiaData> data_; | 72 scoped_ptr<PdfMetafileSkiaData> data_; |
| 75 | 73 |
| 76 // True when finish page is outstanding for current page. | 74 // True when finish page is outstanding for current page. |
| 77 bool page_outstanding_; | 75 bool page_outstanding_; |
| 78 | 76 |
| 79 DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia); | 77 DISALLOW_COPY_AND_ASSIGN(PdfMetafileSkia); |
| 80 }; | 78 }; |
| 81 | 79 |
| 82 } // namespace printing | 80 } // namespace printing |
| 83 | 81 |
| 84 #endif // PRINTING_PDF_METAFILE_SKIA_H_ | 82 #endif // PRINTING_PDF_METAFILE_SKIA_H_ |
| OLD | NEW |