OLD | NEW |
| (Empty) |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef PRINTING_PAGE_OVERLAYS_H_ | |
6 #define PRINTING_PAGE_OVERLAYS_H_ | |
7 | |
8 #include <string> | |
9 | |
10 namespace printing { | |
11 | |
12 class PrintedDocument; | |
13 class PrintedPage; | |
14 | |
15 // Page's overlays, i.e. headers and footers. Contains the strings that will be | |
16 // printed in the overlays, with actual values as variables. The variables are | |
17 // replaced by their actual values with ReplaceVariables(). | |
18 class PageOverlays { | |
19 public: | |
20 // Position of the header/footer. | |
21 enum HorizontalPosition { | |
22 LEFT, | |
23 CENTER, | |
24 RIGHT, | |
25 }; | |
26 | |
27 // Position of the header/footer. | |
28 enum VerticalPosition { | |
29 TOP, | |
30 BOTTOM, | |
31 }; | |
32 | |
33 PageOverlays(); | |
34 ~PageOverlays(); | |
35 | |
36 // Equality operator. | |
37 bool Equals(const PageOverlays& rhs) const; | |
38 | |
39 // Returns the string of an overlay according to its x,y position. | |
40 const std::wstring& GetOverlay(HorizontalPosition x, | |
41 VerticalPosition y) const; | |
42 | |
43 // Sets the string of an overlay according to its x,y position. | |
44 void SetOverlay(HorizontalPosition x, | |
45 VerticalPosition y, | |
46 const std::wstring& input); | |
47 | |
48 // Replaces the variables in |input| with their actual values according to the | |
49 // properties of the current printed document and the current printed page. | |
50 static std::wstring ReplaceVariables(const std::wstring& input, | |
51 const PrintedDocument& document, | |
52 const PrintedPage& page); | |
53 | |
54 // Keys that are dynamically replaced in the header and footer by their actual | |
55 // values. | |
56 // Web page's title. | |
57 static const wchar_t* const kTitle; | |
58 // Print job's start time. | |
59 static const wchar_t* const kTime; | |
60 // Print job's start date. | |
61 static const wchar_t* const kDate; | |
62 // Printed page's number. | |
63 static const wchar_t* const kPage; | |
64 // Print job's total page count. | |
65 static const wchar_t* const kPageCount; | |
66 // Printed page's number on total page count. | |
67 static const wchar_t* const kPageOnTotal; | |
68 // Web page's displayed url. | |
69 static const wchar_t* const kUrl; | |
70 | |
71 // Actual headers and footers. | |
72 std::wstring top_left; | |
73 std::wstring top_center; | |
74 std::wstring top_right; | |
75 std::wstring bottom_left; | |
76 std::wstring bottom_center; | |
77 std::wstring bottom_right; | |
78 }; | |
79 | |
80 } // namespace printing | |
81 | |
82 #endif // PRINTING_PAGE_OVERLAYS_H_ | |
OLD | NEW |