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_PRINTING_CONTEXT_H_ | 5 #ifndef PRINTING_PRINTING_CONTEXT_H_ |
6 #define PRINTING_PRINTING_CONTEXT_H_ | 6 #define PRINTING_PRINTING_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/callback_old.h" | 11 #include "base/callback_old.h" |
12 #include "base/logging.h" | |
Lei Zhang
2011/10/15 03:42:19
nit: not needed?
vandebo (ex-Chrome)
2011/10/15 20:52:08
Oops, this should be in the .cc
| |
12 #include "base/string16.h" | 13 #include "base/string16.h" |
13 #include "printing/print_settings.h" | 14 #include "printing/print_settings.h" |
14 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class DictionaryValue; | 18 class DictionaryValue; |
18 } | 19 } |
19 | 20 |
20 namespace printing { | 21 namespace printing { |
21 | 22 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 virtual void ReleaseContext() = 0; | 92 virtual void ReleaseContext() = 0; |
92 | 93 |
93 // Returns the native context used to print. | 94 // Returns the native context used to print. |
94 virtual gfx::NativeDrawingContext context() const = 0; | 95 virtual gfx::NativeDrawingContext context() const = 0; |
95 | 96 |
96 // Creates an instance of this object. Implementers of this interface should | 97 // Creates an instance of this object. Implementers of this interface should |
97 // implement this method to create an object of their implementation. The | 98 // implement this method to create an object of their implementation. The |
98 // caller owns the returned object. | 99 // caller owns the returned object. |
99 static PrintingContext* Create(const std::string& app_locale); | 100 static PrintingContext* Create(const std::string& app_locale); |
100 | 101 |
101 void set_use_overlays(bool use_overlays) { | 102 void set_margin_type(MarginType type); |
102 settings_.use_overlays = use_overlays; | |
103 } | |
104 | 103 |
105 const PrintSettings& settings() const { | 104 const PrintSettings& settings() const { |
106 return settings_; | 105 return settings_; |
107 } | 106 } |
108 | 107 |
109 protected: | 108 protected: |
110 explicit PrintingContext(const std::string& app_locale); | 109 explicit PrintingContext(const std::string& app_locale); |
111 | 110 |
112 // Reinitializes the settings for object reuse. | 111 // Reinitializes the settings for object reuse. |
113 void ResetSettings(); | 112 void ResetSettings(); |
(...skipping 15 matching lines...) Expand all Loading... | |
129 | 128 |
130 // The application locale. | 129 // The application locale. |
131 std::string app_locale_; | 130 std::string app_locale_; |
132 | 131 |
133 DISALLOW_COPY_AND_ASSIGN(PrintingContext); | 132 DISALLOW_COPY_AND_ASSIGN(PrintingContext); |
134 }; | 133 }; |
135 | 134 |
136 } // namespace printing | 135 } // namespace printing |
137 | 136 |
138 #endif // PRINTING_PRINTING_CONTEXT_H_ | 137 #endif // PRINTING_PRINTING_CONTEXT_H_ |
OLD | NEW |