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 PRINTING_PRINTED_PAGE_H_ | 5 #ifndef PRINTING_PRINTED_PAGE_H_ |
6 #define PRINTING_PRINTED_PAGE_H_ | 6 #define PRINTING_PRINTED_PAGE_H_ |
7 | 7 |
8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "gfx/rect.h" | 10 #include "gfx/rect.h" |
11 #include "gfx/size.h" | 11 #include "gfx/size.h" |
12 #include "printing/native_metafile.h" | 12 #include "printing/native_metafile.h" |
13 | 13 |
14 namespace printing { | 14 namespace printing { |
15 | 15 |
16 // 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 |
17 // 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 |
18 // PrintedDocument containing this page. | 18 // PrintedDocument containing this page. |
19 // 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 |
20 // 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 |
21 // printed and be displayed at the same time. | 21 // printed and be displayed at the same time. |
22 class PrintedPage : public base::RefCountedThreadSafe<PrintedPage> { | 22 class PrintedPage : public base::RefCountedThreadSafe<PrintedPage> { |
23 public: | 23 public: |
24 PrintedPage(int page_number, | 24 PrintedPage(int page_number, |
25 NativeMetafile* native_metafile, | 25 NativeMetafile* native_metafile, |
26 const gfx::Size& page_size, | 26 const gfx::Size& page_size, |
27 const gfx::Rect& page_content_rect); | 27 const gfx::Rect& page_content_rect, |
| 28 bool has_visible_overlays); |
28 | 29 |
29 // Getters | 30 // Getters |
30 int page_number() const { return page_number_; } | 31 int page_number() const { return page_number_; } |
31 const NativeMetafile* native_metafile() const; | 32 const NativeMetafile* native_metafile() const; |
32 const gfx::Size& page_size() const { return page_size_; } | 33 const gfx::Size& page_size() const { return page_size_; } |
33 const gfx::Rect& page_content_rect() const { return page_content_rect_; } | 34 const gfx::Rect& page_content_rect() const { return page_content_rect_; } |
| 35 bool has_visible_overlays() const { return has_visible_overlays_; } |
34 | 36 |
35 private: | 37 private: |
36 friend class base::RefCountedThreadSafe<PrintedPage>; | 38 friend class base::RefCountedThreadSafe<PrintedPage>; |
37 | 39 |
38 ~PrintedPage(); | 40 ~PrintedPage(); |
39 | 41 |
40 // Page number inside the printed document. | 42 // Page number inside the printed document. |
41 const int page_number_; | 43 const int page_number_; |
42 | 44 |
43 // Actual paint data. | 45 // Actual paint data. |
44 const scoped_ptr<NativeMetafile> native_metafile_; | 46 const scoped_ptr<NativeMetafile> native_metafile_; |
45 | 47 |
46 // The physical page size. To support multiple page formats inside on print | 48 // The physical page size. To support multiple page formats inside on print |
47 // job. | 49 // job. |
48 const gfx::Size page_size_; | 50 const gfx::Size page_size_; |
49 | 51 |
50 // The printable area of the page. | 52 // The printable area of the page. |
51 const gfx::Rect page_content_rect_; | 53 const gfx::Rect page_content_rect_; |
52 | 54 |
| 55 // True if the overlays should be visible in this page. |
| 56 bool has_visible_overlays_; |
| 57 |
53 DISALLOW_COPY_AND_ASSIGN(PrintedPage); | 58 DISALLOW_COPY_AND_ASSIGN(PrintedPage); |
54 }; | 59 }; |
55 | 60 |
56 } // namespace printing | 61 } // namespace printing |
57 | 62 |
58 #endif // PRINTING_PRINTED_PAGE_H_ | 63 #endif // PRINTING_PRINTED_PAGE_H_ |
OLD | NEW |