| 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 PPAPI_CPP_DEV_PRINTING_DEV_H_ | 5 #ifndef PPAPI_CPP_DEV_PRINTING_DEV_H_ |
| 6 #define PPAPI_CPP_DEV_PRINTING_DEV_H_ | 6 #define PPAPI_CPP_DEV_PRINTING_DEV_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/dev/ppp_printing_dev.h" | 8 #include "ppapi/c/dev/ppp_printing_dev.h" |
| 9 #include "ppapi/cpp/resource.h" | 9 #include "ppapi/cpp/resource.h" |
| 10 | 10 |
| 11 namespace pp { | 11 namespace pp { |
| 12 | 12 |
| 13 class Instance; | 13 class Instance; |
| 14 | 14 |
| 15 // You would typically use this either via inheritance on your instance or | 15 // You would typically use this either via inheritance on your instance or |
| 16 // by composition: see find_dev.h for an example. | 16 // by composition: see find_dev.h for an example. |
| 17 class Printing_Dev { | 17 class Printing_Dev { |
| 18 public: | 18 public: |
| 19 // The instance parameter must outlive this class. | 19 // The instance parameter must outlive this class. |
| 20 explicit Printing_Dev(Instance* instance); | 20 explicit Printing_Dev(Instance* instance); |
| 21 virtual ~Printing_Dev(); | 21 virtual ~Printing_Dev(); |
| 22 | 22 |
| 23 // PPP_Printing_Dev functions exposed as virtual functions for you to | 23 // PPP_Printing_Dev functions exposed as virtual functions for you to |
| 24 // override. | 24 // override. |
| 25 #ifdef PPP_PRINTING_DEV_USE_0_4 | |
| 26 virtual uint32_t QuerySupportedPrintOutputFormats() = 0; | 25 virtual uint32_t QuerySupportedPrintOutputFormats() = 0; |
| 27 #else | |
| 28 virtual PP_PrintOutputFormat_Dev* QuerySupportedPrintOutputFormats( | |
| 29 uint32_t* format_count) = 0; | |
| 30 #endif | |
| 31 virtual int32_t PrintBegin(const PP_PrintSettings_Dev& print_settings) = 0; | 26 virtual int32_t PrintBegin(const PP_PrintSettings_Dev& print_settings) = 0; |
| 32 virtual Resource PrintPages(const PP_PrintPageNumberRange_Dev* page_ranges, | 27 virtual Resource PrintPages(const PP_PrintPageNumberRange_Dev* page_ranges, |
| 33 uint32_t page_range_count) = 0; | 28 uint32_t page_range_count) = 0; |
| 34 virtual void PrintEnd() = 0; | 29 virtual void PrintEnd() = 0; |
| 35 | 30 |
| 36 private: | 31 private: |
| 37 Instance* associated_instance_; | 32 Instance* associated_instance_; |
| 38 }; | 33 }; |
| 39 | 34 |
| 40 } // namespace pp | 35 } // namespace pp |
| 41 | 36 |
| 42 #endif // PPAPI_CPP_DEV_PRINTING_DEV_H_ | 37 #endif // PPAPI_CPP_DEV_PRINTING_DEV_H_ |
| OLD | NEW |