OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PRINTING_PRINTING_CONTEXT_MAC_H_ |
| 6 #define PRINTING_PRINTING_CONTEXT_MAC_H_ |
| 7 |
| 8 #include "printing/printing_context.h" |
| 9 |
| 10 #ifdef __OBJC__ |
| 11 @class NSPrintInfo; |
| 12 #else |
| 13 class NSPrintInfo; |
| 14 #endif // __OBJC__ |
| 15 |
| 16 namespace printing { |
| 17 |
| 18 class PrintingContextMac : public PrintingContext { |
| 19 public: |
| 20 PrintingContextMac(); |
| 21 ~PrintingContextMac(); |
| 22 |
| 23 // PrintingContext implementation. |
| 24 virtual void AskUserForSettings(gfx::NativeView parent_view, |
| 25 int max_pages, |
| 26 bool has_selection, |
| 27 PrintSettingsCallback* callback); |
| 28 virtual Result UseDefaultSettings(); |
| 29 virtual Result InitWithSettings(const PrintSettings& settings); |
| 30 virtual Result NewDocument(const string16& document_name); |
| 31 virtual Result NewPage(); |
| 32 virtual Result PageDone(); |
| 33 virtual Result DocumentDone(); |
| 34 virtual void Cancel(); |
| 35 virtual void DismissDialog(); |
| 36 virtual void ReleaseContext(); |
| 37 virtual gfx::NativeDrawingContext context() const; |
| 38 |
| 39 private: |
| 40 // Read the settings from the given NSPrintInfo (and cache it for later use). |
| 41 void ParsePrintInfo(NSPrintInfo* print_info); |
| 42 |
| 43 // The native print info object. |
| 44 NSPrintInfo* print_info_; |
| 45 |
| 46 // The current page's context; only valid between NewPage and PageDone call |
| 47 // pairs. |
| 48 CGContext* context_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(PrintingContextMac); |
| 51 }; |
| 52 |
| 53 } // namespace printing |
| 54 |
| 55 #endif // PRINTING_PRINTING_CONTEXT_MAC_H_ |
OLD | NEW |