| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BACKEND_WIN_HELPER_H_ | 5 #ifndef PRINTING_BACKEND_WIN_HELPER_H_ |
| 6 #define PRINTING_BACKEND_WIN_HELPER_H_ | 6 #define PRINTING_BACKEND_WIN_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <objidl.h> | 9 #include <objidl.h> |
| 10 #include <winspool.h> | 10 #include <winspool.h> |
| 11 #include <prntvpt.h> | 11 #include <prntvpt.h> |
| 12 #include <xpsprint.h> | 12 #include <xpsprint.h> |
| 13 | 13 |
| 14 #include <string> |
| 15 |
| 16 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/string16.h" | 17 #include "base/string16.h" |
| 15 #include "base/win/scoped_handle.h" | 18 #include "base/win/scoped_handle.h" |
| 16 #include "printing/printing_export.h" | 19 #include "printing/printing_export.h" |
| 17 | 20 |
| 18 // These are helper functions for dealing with Windows Printing. | 21 // These are helper functions for dealing with Windows Printing. |
| 19 namespace printing { | 22 namespace printing { |
| 20 | 23 |
| 24 struct PRINTING_EXPORT PrinterBasicInfo; |
| 25 |
| 21 class PrinterHandleTraits { | 26 class PrinterHandleTraits { |
| 22 public: | 27 public: |
| 23 typedef HANDLE Handle; | 28 typedef HANDLE Handle; |
| 24 | 29 |
| 25 static bool CloseHandle(HANDLE handle) { | 30 static bool CloseHandle(HANDLE handle) { |
| 26 return ::ClosePrinter(handle) != FALSE; | 31 return ::ClosePrinter(handle) != FALSE; |
| 27 } | 32 } |
| 28 | 33 |
| 29 static bool IsHandleValid(HANDLE handle) { | 34 static bool IsHandleValid(HANDLE handle) { |
| 30 return handle != NULL; | 35 return handle != NULL; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 UINT8 *printable_pages_on, | 118 UINT8 *printable_pages_on, |
| 114 UINT32 printable_pages_on_count, | 119 UINT32 printable_pages_on_count, |
| 115 IXpsPrintJob **xps_print_job, | 120 IXpsPrintJob **xps_print_job, |
| 116 IXpsPrintJobStream **document_stream, | 121 IXpsPrintJobStream **document_stream, |
| 117 IXpsPrintJobStream **print_ticket_stream); | 122 IXpsPrintJobStream **print_ticket_stream); |
| 118 private: | 123 private: |
| 119 XPSPrintModule() { } | 124 XPSPrintModule() { } |
| 120 static bool InitImpl(); | 125 static bool InitImpl(); |
| 121 }; | 126 }; |
| 122 | 127 |
| 128 PRINTING_EXPORT bool InitBasicPrinterInfo(HANDLE printer, |
| 129 PrinterBasicInfo* printer_info); |
| 130 |
| 131 PRINTING_EXPORT std::string GetDriverInfo(HANDLE printer); |
| 132 |
| 123 } // namespace printing | 133 } // namespace printing |
| 124 | 134 |
| 125 #endif // PRINTING_BACKEND_WIN_HELPER_H_ | 135 #endif // PRINTING_BACKEND_WIN_HELPER_H_ |
| OLD | NEW |