OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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_PDF_PS_METAFILE_CAIRO_H_ | 5 #ifndef PRINTING_PDF_PS_METAFILE_CAIRO_H_ |
6 #define PRINTING_PDF_PS_METAFILE_CAIRO_H_ | 6 #define PRINTING_PDF_PS_METAFILE_CAIRO_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 // This class uses Cairo graphics library to generate PostScript/PDF stream | 23 // This class uses Cairo graphics library to generate PostScript/PDF stream |
24 // and stores rendering results in a string buffer. | 24 // and stores rendering results in a string buffer. |
25 class PdfPsMetafile { | 25 class PdfPsMetafile { |
26 public: | 26 public: |
27 enum FileFormat { | 27 enum FileFormat { |
28 PDF, | 28 PDF, |
29 PS, | 29 PS, |
30 }; | 30 }; |
31 | 31 |
| 32 PdfPsMetafile(); |
| 33 |
32 // In the renderer process, callers should also call Init(void) to see if the | 34 // In the renderer process, callers should also call Init(void) to see if the |
33 // metafile can obtain all necessary rendering resources. | 35 // metafile can obtain all necessary rendering resources. |
34 // In the browser process, callers should also call Init(const void*, uint32) | 36 // In the browser process, callers should also call Init(const void*, uint32) |
35 // to initialize the buffer |data_| to use SaveTo(). | 37 // to initialize the buffer |data_| to use SaveTo(). |
36 explicit PdfPsMetafile(const FileFormat& format); | 38 explicit PdfPsMetafile(const FileFormat& format); |
37 | 39 |
38 ~PdfPsMetafile(); | 40 ~PdfPsMetafile(); |
39 | 41 |
40 // Initializes to a fresh new metafile. Returns true on success. | 42 // Initializes to a fresh new metafile. Returns true on success. |
41 // Note: Only call in the renderer to allocate rendering resources. | 43 // Note: Only call in the renderer to allocate rendering resources. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 std::string data_; | 115 std::string data_; |
114 // Buffer stores raw PDF/PS contents set by SetRawPageData. | 116 // Buffer stores raw PDF/PS contents set by SetRawPageData. |
115 std::string raw_override_data_; | 117 std::string raw_override_data_; |
116 | 118 |
117 DISALLOW_COPY_AND_ASSIGN(PdfPsMetafile); | 119 DISALLOW_COPY_AND_ASSIGN(PdfPsMetafile); |
118 }; | 120 }; |
119 | 121 |
120 } // namespace printing | 122 } // namespace printing |
121 | 123 |
122 #endif // PRINTING_PDF_PS_METAFILE_CAIRO_H_ | 124 #endif // PRINTING_PDF_PS_METAFILE_CAIRO_H_ |
OLD | NEW |