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