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_METAFILE_H_ | 5 #ifndef PRINTING_METAFILE_H_ |
6 #define PRINTING_METAFILE_H_ | 6 #define PRINTING_METAFILE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "printing/printing_export.h" | 10 #include "printing/printing_export.h" |
11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
12 | 12 |
13 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
14 #include <windows.h> | 14 #include <windows.h> |
15 #elif defined(OS_MACOSX) | 15 #elif defined(OS_MACOSX) |
16 #include <ApplicationServices/ApplicationServices.h> | 16 #include <ApplicationServices/ApplicationServices.h> |
17 #include <CoreFoundation/CoreFoundation.h> | 17 #include <CoreFoundation/CoreFoundation.h> |
18 #include "base/mac/scoped_cftyperef.h" | 18 #include "base/mac/scoped_cftyperef.h" |
19 #endif | 19 #endif |
20 | 20 |
| 21 namespace base { |
21 class FilePath; | 22 class FilePath; |
| 23 } |
22 | 24 |
23 namespace gfx { | 25 namespace gfx { |
24 class Rect; | 26 class Rect; |
25 class Size; | 27 class Size; |
26 } | 28 } |
27 | 29 |
28 class SkDevice; | 30 class SkDevice; |
29 | 31 |
30 #if defined(OS_CHROMEOS) | 32 #if defined(OS_CHROMEOS) |
31 namespace base { | 33 namespace base { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // has been called. | 112 // has been called. |
111 virtual uint32 GetDataSize() const = 0; | 113 virtual uint32 GetDataSize() const = 0; |
112 | 114 |
113 // Copies the first |dst_buffer_size| bytes of the underlying data stream into | 115 // Copies the first |dst_buffer_size| bytes of the underlying data stream into |
114 // |dst_buffer|. This function should ONLY be called after Close() is invoked. | 116 // |dst_buffer|. This function should ONLY be called after Close() is invoked. |
115 // Returns true if the copy succeeds. | 117 // Returns true if the copy succeeds. |
116 virtual bool GetData(void* dst_buffer, uint32 dst_buffer_size) const = 0; | 118 virtual bool GetData(void* dst_buffer, uint32 dst_buffer_size) const = 0; |
117 | 119 |
118 // Saves the underlying data to the given file. This function should ONLY be | 120 // Saves the underlying data to the given file. This function should ONLY be |
119 // called after the metafile is closed. Returns true if writing succeeded. | 121 // called after the metafile is closed. Returns true if writing succeeded. |
120 virtual bool SaveTo(const FilePath& file_path) const = 0; | 122 virtual bool SaveTo(const base::FilePath& file_path) const = 0; |
121 | 123 |
122 // Returns the bounds of the given page. Pages use a 1-based index. | 124 // Returns the bounds of the given page. Pages use a 1-based index. |
123 virtual gfx::Rect GetPageBounds(unsigned int page_number) const = 0; | 125 virtual gfx::Rect GetPageBounds(unsigned int page_number) const = 0; |
124 virtual unsigned int GetPageCount() const = 0; | 126 virtual unsigned int GetPageCount() const = 0; |
125 | 127 |
126 // Get the context for rendering to the PDF. | 128 // Get the context for rendering to the PDF. |
127 virtual gfx::NativeDrawingContext context() const = 0; | 129 virtual gfx::NativeDrawingContext context() const = 0; |
128 | 130 |
129 #if defined(OS_WIN) | 131 #if defined(OS_WIN) |
130 // "Plays" the EMF buffer in a HDC. It is the same effect as calling the | 132 // "Plays" the EMF buffer in a HDC. It is the same effect as calling the |
(...skipping 26 matching lines...) Expand all Loading... |
157 // Saves the underlying data to the file associated with fd. This function | 159 // Saves the underlying data to the file associated with fd. This function |
158 // should ONLY be called after the metafile is closed. | 160 // should ONLY be called after the metafile is closed. |
159 // Returns true if writing succeeded. | 161 // Returns true if writing succeeded. |
160 virtual bool SaveToFD(const base::FileDescriptor& fd) const = 0; | 162 virtual bool SaveToFD(const base::FileDescriptor& fd) const = 0; |
161 #endif // if defined(OS_CHROMEOS) | 163 #endif // if defined(OS_CHROMEOS) |
162 }; | 164 }; |
163 | 165 |
164 } // namespace printing | 166 } // namespace printing |
165 | 167 |
166 #endif // PRINTING_METAFILE_H_ | 168 #endif // PRINTING_METAFILE_H_ |
OLD | NEW |