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 | |
34 // In the renderer process, callers should also call Init(void) to see if the | 32 // In the renderer process, callers should also call Init(void) to see if the |
35 // metafile can obtain all necessary rendering resources. | 33 // metafile can obtain all necessary rendering resources. |
36 // In the browser process, callers should also call Init(const void*, uint32) | 34 // In the browser process, callers should also call Init(const void*, uint32) |
37 // to initialize the buffer |data_| to use SaveTo(). | 35 // to initialize the buffer |data_| to use SaveTo(). |
38 explicit PdfPsMetafile(const FileFormat& format); | 36 explicit PdfPsMetafile(const FileFormat& format); |
39 | 37 |
40 ~PdfPsMetafile(); | 38 ~PdfPsMetafile(); |
41 | 39 |
42 // Initializes to a fresh new metafile. Returns true on success. | 40 // Initializes to a fresh new metafile. Returns true on success. |
43 // Note: Only call in the renderer to allocate rendering resources. | 41 // Note: Only call in the renderer to allocate rendering resources. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 std::string data_; | 113 std::string data_; |
116 // Buffer stores raw PDF/PS contents set by SetRawPageData. | 114 // Buffer stores raw PDF/PS contents set by SetRawPageData. |
117 std::string raw_override_data_; | 115 std::string raw_override_data_; |
118 | 116 |
119 DISALLOW_COPY_AND_ASSIGN(PdfPsMetafile); | 117 DISALLOW_COPY_AND_ASSIGN(PdfPsMetafile); |
120 }; | 118 }; |
121 | 119 |
122 } // namespace printing | 120 } // namespace printing |
123 | 121 |
124 #endif // PRINTING_PDF_PS_METAFILE_CAIRO_H_ | 122 #endif // PRINTING_PDF_PS_METAFILE_CAIRO_H_ |
OLD | NEW |