| 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 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // An abstraction of a printer context, implemented by objects that describe the | 23 // 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 | 24 // user selected printing context. This includes the OS-dependent UI to ask the |
| 25 // user about the print settings. Concrete implementations directly talk to the | 25 // user about the print settings. Concrete implementations directly talk to the |
| 26 // printer and manage the document and page breaks. | 26 // printer and manage the document and page breaks. |
| 27 class PRINTING_EXPORT PrintingContext { | 27 class PRINTING_EXPORT PrintingContext { |
| 28 public: | 28 public: |
| 29 // Printing context delegate. | 29 // Printing context delegate. |
| 30 class Delegate { | 30 class Delegate { |
| 31 public: | 31 public: |
| 32 Delegate() {}; | 32 Delegate() {} |
| 33 virtual ~Delegate() {}; | 33 virtual ~Delegate() {} |
| 34 | 34 |
| 35 // Returns parent view to use for modal dialogs. | 35 // Returns parent view to use for modal dialogs. |
| 36 virtual gfx::NativeView GetParentView() = 0; | 36 virtual gfx::NativeView GetParentView() = 0; |
| 37 | 37 |
| 38 // Returns application locale. | 38 // Returns application locale. |
| 39 virtual std::string GetAppLocale() = 0; | 39 virtual std::string GetAppLocale() = 0; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 // Tri-state result for user behavior-dependent functions. | 42 // Tri-state result for user behavior-dependent functions. |
| 43 enum Result { | 43 enum Result { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 virtual void ReleaseContext() = 0; | 114 virtual void ReleaseContext() = 0; |
| 115 | 115 |
| 116 // Returns the native context used to print. | 116 // Returns the native context used to print. |
| 117 virtual gfx::NativeDrawingContext context() const = 0; | 117 virtual gfx::NativeDrawingContext context() const = 0; |
| 118 | 118 |
| 119 // Creates an instance of this object. Implementers of this interface should | 119 // Creates an instance of this object. Implementers of this interface should |
| 120 // implement this method to create an object of their implementation. | 120 // implement this method to create an object of their implementation. |
| 121 static std::unique_ptr<PrintingContext> Create(Delegate* delegate); | 121 static std::unique_ptr<PrintingContext> Create(Delegate* delegate); |
| 122 | 122 |
| 123 void set_margin_type(MarginType type); | 123 void set_margin_type(MarginType type); |
| 124 void set_is_modifiable(bool is_modifiable); |
| 124 | 125 |
| 125 const PrintSettings& settings() const { | 126 const PrintSettings& settings() const { |
| 126 return settings_; | 127 return settings_; |
| 127 } | 128 } |
| 128 | 129 |
| 129 protected: | 130 protected: |
| 130 explicit PrintingContext(Delegate* delegate); | 131 explicit PrintingContext(Delegate* delegate); |
| 131 | 132 |
| 132 // Reinitializes the settings for object reuse. | 133 // Reinitializes the settings for object reuse. |
| 133 void ResetSettings(); | 134 void ResetSettings(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 147 // Did the user cancel the print job. | 148 // Did the user cancel the print job. |
| 148 volatile bool abort_printing_; | 149 volatile bool abort_printing_; |
| 149 | 150 |
| 150 private: | 151 private: |
| 151 DISALLOW_COPY_AND_ASSIGN(PrintingContext); | 152 DISALLOW_COPY_AND_ASSIGN(PrintingContext); |
| 152 }; | 153 }; |
| 153 | 154 |
| 154 } // namespace printing | 155 } // namespace printing |
| 155 | 156 |
| 156 #endif // PRINTING_PRINTING_CONTEXT_H_ | 157 #endif // PRINTING_PRINTING_CONTEXT_H_ |
| OLD | NEW |