| 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 <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "printing/print_settings.h" | 14 #include "printing/print_settings.h" |
| 15 #include "skia/ext/native_drawing_context.h" |
| 15 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
| 16 | 17 |
| 17 namespace base { | 18 namespace base { |
| 18 class DictionaryValue; | 19 class DictionaryValue; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace printing { | 22 namespace printing { |
| 22 | 23 |
| 23 // An abstraction of a printer context, implemented by objects that describe the | 24 // An abstraction of a printer context, implemented by objects that describe the |
| 24 // user selected printing context. This includes the OS-dependent UI to ask the | 25 // user selected printing context. This includes the OS-dependent UI to ask the |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 virtual Result DocumentDone() = 0; | 105 virtual Result DocumentDone() = 0; |
| 105 | 106 |
| 106 // Cancels printing. Can be used in a multi-threaded context. Takes effect | 107 // Cancels printing. Can be used in a multi-threaded context. Takes effect |
| 107 // immediately. | 108 // immediately. |
| 108 virtual void Cancel() = 0; | 109 virtual void Cancel() = 0; |
| 109 | 110 |
| 110 // Releases the native printing context. | 111 // Releases the native printing context. |
| 111 virtual void ReleaseContext() = 0; | 112 virtual void ReleaseContext() = 0; |
| 112 | 113 |
| 113 // Returns the native context used to print. | 114 // Returns the native context used to print. |
| 114 virtual gfx::NativeDrawingContext context() const = 0; | 115 virtual skia::NativeDrawingContext context() const = 0; |
| 115 | 116 |
| 116 // Creates an instance of this object. Implementers of this interface should | 117 // Creates an instance of this object. Implementers of this interface should |
| 117 // implement this method to create an object of their implementation. | 118 // implement this method to create an object of their implementation. |
| 118 static std::unique_ptr<PrintingContext> Create(Delegate* delegate); | 119 static std::unique_ptr<PrintingContext> Create(Delegate* delegate); |
| 119 | 120 |
| 120 void set_margin_type(MarginType type); | 121 void set_margin_type(MarginType type); |
| 121 void set_is_modifiable(bool is_modifiable); | 122 void set_is_modifiable(bool is_modifiable); |
| 122 | 123 |
| 123 const PrintSettings& settings() const { | 124 const PrintSettings& settings() const { |
| 124 return settings_; | 125 return settings_; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 145 // Did the user cancel the print job. | 146 // Did the user cancel the print job. |
| 146 volatile bool abort_printing_; | 147 volatile bool abort_printing_; |
| 147 | 148 |
| 148 private: | 149 private: |
| 149 DISALLOW_COPY_AND_ASSIGN(PrintingContext); | 150 DISALLOW_COPY_AND_ASSIGN(PrintingContext); |
| 150 }; | 151 }; |
| 151 | 152 |
| 152 } // namespace printing | 153 } // namespace printing |
| 153 | 154 |
| 154 #endif // PRINTING_PRINTING_CONTEXT_H_ | 155 #endif // PRINTING_PRINTING_CONTEXT_H_ |
| OLD | NEW |