| 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_MAC_H_ | 5 #ifndef PRINTING_PRINTING_CONTEXT_MAC_H_ |
| 6 #define PRINTING_PRINTING_CONTEXT_MAC_H_ | 6 #define PRINTING_PRINTING_CONTEXT_MAC_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 explicit PrintingContextMac(const std::string& app_locale); | 24 explicit PrintingContextMac(const std::string& app_locale); |
| 25 virtual ~PrintingContextMac(); | 25 virtual ~PrintingContextMac(); |
| 26 | 26 |
| 27 // PrintingContext implementation. | 27 // PrintingContext implementation. |
| 28 virtual void AskUserForSettings( | 28 virtual void AskUserForSettings( |
| 29 gfx::NativeView parent_view, | 29 gfx::NativeView parent_view, |
| 30 int max_pages, | 30 int max_pages, |
| 31 bool has_selection, | 31 bool has_selection, |
| 32 const PrintSettingsCallback& callback) OVERRIDE; | 32 const PrintSettingsCallback& callback) OVERRIDE; |
| 33 virtual Result UseDefaultSettings() OVERRIDE; | 33 virtual Result UseDefaultSettings() OVERRIDE; |
| 34 virtual Result UpdatePrinterSettings( | 34 virtual Result UpdatePrinterSettings(bool target_is_pdf, |
| 35 const base::DictionaryValue& job_settings, | 35 bool external_preview) OVERRIDE; |
| 36 const PageRanges& ranges) OVERRIDE; | |
| 37 virtual Result InitWithSettings(const PrintSettings& settings) OVERRIDE; | 36 virtual Result InitWithSettings(const PrintSettings& settings) OVERRIDE; |
| 38 virtual Result NewDocument(const base::string16& document_name) OVERRIDE; | 37 virtual Result NewDocument(const base::string16& document_name) OVERRIDE; |
| 39 virtual Result NewPage() OVERRIDE; | 38 virtual Result NewPage() OVERRIDE; |
| 40 virtual Result PageDone() OVERRIDE; | 39 virtual Result PageDone() OVERRIDE; |
| 41 virtual Result DocumentDone() OVERRIDE; | 40 virtual Result DocumentDone() OVERRIDE; |
| 42 virtual void Cancel() OVERRIDE; | 41 virtual void Cancel() OVERRIDE; |
| 43 virtual void ReleaseContext() OVERRIDE; | 42 virtual void ReleaseContext() OVERRIDE; |
| 44 virtual gfx::NativeDrawingContext context() const OVERRIDE; | 43 virtual gfx::NativeDrawingContext context() const OVERRIDE; |
| 45 | 44 |
| 46 private: | 45 private: |
| 47 // Initializes PrintSettings from |print_info_|. This must be called | 46 // Initializes PrintSettings from |print_info_|. This must be called |
| 48 // after changes to |print_info_| in order for the changes to take effect in | 47 // after changes to |print_info_| in order for the changes to take effect in |
| 49 // printing. | 48 // printing. |
| 50 // This function ignores the page range information specified in the print | 49 // This function ignores the page range information specified in the print |
| 51 // info object and use |ranges| instead. | 50 // info object and use |settings_.ranges| instead. |
| 52 void InitPrintSettingsFromPrintInfo(const PageRanges& ranges); | 51 void InitPrintSettingsFromPrintInfo(); |
| 53 | 52 |
| 54 // Returns the set of page ranges constructed from |print_info_|. | 53 // Returns the set of page ranges constructed from |print_info_|. |
| 55 PageRanges GetPageRangesFromPrintInfo(); | 54 PageRanges GetPageRangesFromPrintInfo(); |
| 56 | 55 |
| 57 // Updates |print_info_| to use the given printer. | 56 // Updates |print_info_| to use the given printer. |
| 58 // Returns true if the printer was set else returns false. | 57 // Returns true if the printer was set else returns false. |
| 59 bool SetPrinter(const std::string& device_name); | 58 bool SetPrinter(const std::string& device_name); |
| 60 | 59 |
| 61 // Updates |print_info_| page format with user default paper information. | 60 // Updates |print_info_| page format with user default paper information. |
| 62 // Returns true if the paper was set else returns false. | 61 // Returns true if the paper was set else returns false. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 92 // The current page's context; only valid between NewPage and PageDone call | 91 // The current page's context; only valid between NewPage and PageDone call |
| 93 // pairs. | 92 // pairs. |
| 94 CGContext* context_; | 93 CGContext* context_; |
| 95 | 94 |
| 96 DISALLOW_COPY_AND_ASSIGN(PrintingContextMac); | 95 DISALLOW_COPY_AND_ASSIGN(PrintingContextMac); |
| 97 }; | 96 }; |
| 98 | 97 |
| 99 } // namespace printing | 98 } // namespace printing |
| 100 | 99 |
| 101 #endif // PRINTING_PRINTING_CONTEXT_MAC_H_ | 100 #endif // PRINTING_PRINTING_CONTEXT_MAC_H_ |
| OLD | NEW |