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