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" |
11 #include "printing/print_job_constants.h" | 11 #include "printing/print_job_constants.h" |
12 #include "printing/printing_context.h" | 12 #include "printing/printing_context.h" |
13 | 13 |
14 #ifdef __OBJC__ | 14 #ifdef __OBJC__ |
15 @class NSPrintInfo; | 15 @class NSPrintInfo; |
16 #else | 16 #else |
17 class NSPrintInfo; | 17 class NSPrintInfo; |
18 #endif // __OBJC__ | 18 #endif // __OBJC__ |
19 | 19 |
20 namespace printing { | 20 namespace printing { |
21 | 21 |
22 class PRINTING_EXPORT PrintingContextMac : public PrintingContext { | 22 class PRINTING_EXPORT PrintingContextMac : public PrintingContext { |
23 public: | 23 public: |
24 explicit PrintingContextMac(Delegate* delegate); | 24 explicit PrintingContextMac(Delegate* delegate); |
25 virtual ~PrintingContextMac(); | 25 ~PrintingContextMac() override; |
26 | 26 |
27 // PrintingContext implementation. | 27 // PrintingContext implementation. |
28 virtual void AskUserForSettings( | 28 void AskUserForSettings(int max_pages, |
29 int max_pages, | 29 bool has_selection, |
30 bool has_selection, | 30 const PrintSettingsCallback& callback) override; |
31 const PrintSettingsCallback& callback) override; | 31 Result UseDefaultSettings() override; |
32 virtual Result UseDefaultSettings() override; | 32 gfx::Size GetPdfPaperSizeDeviceUnits() override; |
33 virtual gfx::Size GetPdfPaperSizeDeviceUnits() override; | 33 Result UpdatePrinterSettings(bool external_preview, |
34 virtual Result UpdatePrinterSettings(bool external_preview, | 34 bool show_system_dialog) override; |
35 bool show_system_dialog) override; | 35 Result InitWithSettings(const PrintSettings& settings) override; |
36 virtual Result InitWithSettings(const PrintSettings& settings) override; | 36 Result NewDocument(const base::string16& document_name) override; |
37 virtual Result NewDocument(const base::string16& document_name) override; | 37 Result NewPage() override; |
38 virtual Result NewPage() override; | 38 Result PageDone() override; |
39 virtual Result PageDone() override; | 39 Result DocumentDone() override; |
40 virtual Result DocumentDone() override; | 40 void Cancel() override; |
41 virtual void Cancel() override; | 41 void ReleaseContext() override; |
42 virtual void ReleaseContext() override; | 42 gfx::NativeDrawingContext context() const override; |
43 virtual gfx::NativeDrawingContext context() const override; | |
44 | 43 |
45 private: | 44 private: |
46 // Initializes PrintSettings from |print_info_|. This must be called | 45 // Initializes PrintSettings from |print_info_|. This must be called |
47 // after changes to |print_info_| in order for the changes to take effect in | 46 // after changes to |print_info_| in order for the changes to take effect in |
48 // printing. | 47 // printing. |
49 // This function ignores the page range information specified in the print | 48 // This function ignores the page range information specified in the print |
50 // info object and use |settings_.ranges| instead. | 49 // info object and use |settings_.ranges| instead. |
51 void InitPrintSettingsFromPrintInfo(); | 50 void InitPrintSettingsFromPrintInfo(); |
52 | 51 |
53 // Returns the set of page ranges constructed from |print_info_|. | 52 // Returns the set of page ranges constructed from |print_info_|. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // The current page's context; only valid between NewPage and PageDone call | 95 // The current page's context; only valid between NewPage and PageDone call |
97 // pairs. | 96 // pairs. |
98 CGContext* context_; | 97 CGContext* context_; |
99 | 98 |
100 DISALLOW_COPY_AND_ASSIGN(PrintingContextMac); | 99 DISALLOW_COPY_AND_ASSIGN(PrintingContextMac); |
101 }; | 100 }; |
102 | 101 |
103 } // namespace printing | 102 } // namespace printing |
104 | 103 |
105 #endif // PRINTING_PRINTING_CONTEXT_MAC_H_ | 104 #endif // PRINTING_PRINTING_CONTEXT_MAC_H_ |
OLD | NEW |