OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_PRINTING_PRINTED_PAGE_H__ | 5 #ifndef CHROME_BROWSER_PRINTING_PRINTED_PAGE_H__ |
6 #define CHROME_BROWSER_PRINTING_PRINTED_PAGE_H__ | 6 #define CHROME_BROWSER_PRINTING_PRINTED_PAGE_H__ |
7 | 7 |
8 #include "base/gfx/rect.h" | 8 #include "base/gfx/rect.h" |
9 #include "base/gfx/size.h" | 9 #include "base/gfx/size.h" |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
12 | 12 #include "printing/native_metafile.h" |
13 namespace gfx { | |
14 class Emf; | |
15 } | |
16 | 13 |
17 namespace printing { | 14 namespace printing { |
18 | 15 |
19 // Contains the data to reproduce a printed page, either on screen or on | 16 // Contains the data to reproduce a printed page, either on screen or on |
20 // paper. Once created, this object is immutable. It has no reference to the | 17 // paper. Once created, this object is immutable. It has no reference to the |
21 // PrintedDocument containing this page. | 18 // PrintedDocument containing this page. |
22 // Note: May be accessed from many threads at the same time. This is an non | 19 // Note: May be accessed from many threads at the same time. This is an non |
23 // issue since this object is immutable. The reason is that a page may be | 20 // issue since this object is immutable. The reason is that a page may be |
24 // printed and be displayed at the same time. | 21 // printed and be displayed at the same time. |
25 class PrintedPage : public base::RefCountedThreadSafe<PrintedPage> { | 22 class PrintedPage : public base::RefCountedThreadSafe<PrintedPage> { |
26 public: | 23 public: |
27 PrintedPage(int page_number, | 24 PrintedPage(int page_number, |
28 gfx::Emf* emf, | 25 NativeMetafile* native_metafile, |
29 const gfx::Size& page_size); | 26 const gfx::Size& page_size); |
30 ~PrintedPage(); | 27 ~PrintedPage(); |
31 | 28 |
32 // Getters | 29 // Getters |
33 int page_number() const { return page_number_; } | 30 int page_number() const { return page_number_; } |
34 const gfx::Emf* emf() const; | 31 const NativeMetafile* native_metafile() const; |
35 const gfx::Size& page_size() const { return page_size_; } | 32 const gfx::Size& page_size() const { return page_size_; } |
36 | 33 |
37 private: | 34 private: |
38 // Page number inside the printed document. | 35 // Page number inside the printed document. |
39 const int page_number_; | 36 const int page_number_; |
40 | 37 |
41 // Actual paint data. | 38 // Actual paint data. |
42 const scoped_ptr<gfx::Emf> emf_; | 39 const scoped_ptr<NativeMetafile> native_metafile_; |
43 | 40 |
44 // The physical page size. To support multiple page formats inside on print | 41 // The physical page size. To support multiple page formats inside on print |
45 // job. | 42 // job. |
46 const gfx::Size page_size_; | 43 const gfx::Size page_size_; |
47 | 44 |
48 DISALLOW_EVIL_CONSTRUCTORS(PrintedPage); | 45 DISALLOW_EVIL_CONSTRUCTORS(PrintedPage); |
49 }; | 46 }; |
50 | 47 |
51 } // namespace printing | 48 } // namespace printing |
52 | 49 |
53 #endif // CHROME_BROWSER_PRINTING_PRINTED_PAGE_H__ | 50 #endif // CHROME_BROWSER_PRINTING_PRINTED_PAGE_H__ |
OLD | NEW |