OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EMF_WIN_H_ | 5 #ifndef PRINTING_EMF_WIN_H_ |
6 #define PRINTING_EMF_WIN_H_ | 6 #define PRINTING_EMF_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "printing/native_metafile.h" | 13 #include "printing/native_metafile.h" |
14 | 14 |
15 class FilePath; | 15 class FilePath; |
16 | 16 |
17 namespace gfx { | 17 namespace gfx { |
| 18 class Point; |
18 class Rect; | 19 class Rect; |
19 } | 20 } |
20 | 21 |
21 namespace printing { | 22 namespace printing { |
22 | 23 |
23 // Simple wrapper class that manage an EMF data stream and its virtual HDC. | 24 // Simple wrapper class that manage an EMF data stream and its virtual HDC. |
24 class Emf : public NativeMetafile { | 25 class Emf : public NativeMetafile { |
25 public: | 26 public: |
26 class Record; | 27 class Record; |
27 class Enumerator; | 28 class Enumerator; |
28 struct EnumerationContext; | 29 struct EnumerationContext; |
29 | 30 |
30 virtual ~Emf(); | 31 virtual ~Emf(); |
31 | 32 |
32 // NativeMetafile methods. | 33 // NativeMetafile methods. |
33 virtual bool Init() { return true; } | 34 virtual bool Init() { return true; } |
34 virtual bool Init(const void* src_buffer, uint32 src_buffer_size); | 35 virtual bool Init(const void* src_buffer, uint32 src_buffer_size); |
35 | 36 |
| 37 virtual skia::PlatformDevice* StartPageForVectorCanvas( |
| 38 const gfx::Size& page_size, const gfx::Point& content_origin, |
| 39 const float& scale_factor); |
36 virtual bool StartPage(); | 40 virtual bool StartPage(); |
37 virtual bool FinishPage(); | 41 virtual bool FinishPage(); |
38 virtual bool Close(); | 42 virtual bool Close(); |
39 | 43 |
40 virtual uint32 GetDataSize() const; | 44 virtual uint32 GetDataSize() const; |
41 virtual bool GetData(void* buffer, uint32 size) const; | 45 virtual bool GetData(void* buffer, uint32 size) const; |
42 | 46 |
43 // Saves the EMF data to a file as-is. It is recommended to use the .emf file | 47 // Saves the EMF data to a file as-is. It is recommended to use the .emf file |
44 // extension but it is not enforced. This function synchronously writes to the | 48 // extension but it is not enforced. This function synchronously writes to the |
45 // file. For testing only. | 49 // file. For testing only. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 std::vector<Record> items_; | 168 std::vector<Record> items_; |
165 | 169 |
166 EnumerationContext context_; | 170 EnumerationContext context_; |
167 | 171 |
168 DISALLOW_COPY_AND_ASSIGN(Enumerator); | 172 DISALLOW_COPY_AND_ASSIGN(Enumerator); |
169 }; | 173 }; |
170 | 174 |
171 } // namespace printing | 175 } // namespace printing |
172 | 176 |
173 #endif // PRINTING_EMF_WIN_H_ | 177 #endif // PRINTING_EMF_WIN_H_ |
OLD | NEW |