| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 The Android Open Source Project | 3 * Copyright 2010 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkPDFDocument_DEFINED | 10 #ifndef SkPDFDocument_DEFINED |
| 11 #define SkPDFDocument_DEFINED | 11 #define SkPDFDocument_DEFINED |
| 12 | 12 |
| 13 #include "SkAdvancedTypefaceMetrics.h" | 13 #include "SkAdvancedTypefaceMetrics.h" |
| 14 #include "SkRefCnt.h" | 14 #include "SkRefCnt.h" |
| 15 #include "SkTDArray.h" | 15 #include "SkTDArray.h" |
| 16 #include "SkTScopedPtr.h" | 16 #include "SkTemplates.h" |
| 17 | 17 |
| 18 class SkPDFCatalog; | 18 class SkPDFCatalog; |
| 19 class SkPDFDevice; | 19 class SkPDFDevice; |
| 20 class SkPDFDict; | 20 class SkPDFDict; |
| 21 class SkPDFPage; | 21 class SkPDFPage; |
| 22 class SkPDFObject; | 22 class SkPDFObject; |
| 23 class SkWStream; | 23 class SkWStream; |
| 24 template <typename T> class SkTSet; | 24 template <typename T> class SkTSet; |
| 25 | 25 |
| 26 /** \class SkPDFDocument | 26 /** \class SkPDFDocument |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 * @param pdfDevice The page to add to this document. | 67 * @param pdfDevice The page to add to this document. |
| 68 */ | 68 */ |
| 69 SK_API bool appendPage(SkPDFDevice* pdfDevice); | 69 SK_API bool appendPage(SkPDFDevice* pdfDevice); |
| 70 | 70 |
| 71 /** Get the count of unique font types used in the document. | 71 /** Get the count of unique font types used in the document. |
| 72 */ | 72 */ |
| 73 SK_API void getCountOfFontTypes( | 73 SK_API void getCountOfFontTypes( |
| 74 int counts[SkAdvancedTypefaceMetrics::kNotEmbeddable_Font + 1]) const; | 74 int counts[SkAdvancedTypefaceMetrics::kNotEmbeddable_Font + 1]) const; |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 SkTScopedPtr<SkPDFCatalog> fCatalog; | 77 SkAutoTDelete<SkPDFCatalog> fCatalog; |
| 78 int64_t fXRefFileOffset; | 78 int64_t fXRefFileOffset; |
| 79 | 79 |
| 80 SkTDArray<SkPDFPage*> fPages; | 80 SkTDArray<SkPDFPage*> fPages; |
| 81 SkTDArray<SkPDFDict*> fPageTree; | 81 SkTDArray<SkPDFDict*> fPageTree; |
| 82 SkPDFDict* fDocCatalog; | 82 SkPDFDict* fDocCatalog; |
| 83 SkTSet<SkPDFObject*>* fFirstPageResources; | 83 SkTSet<SkPDFObject*>* fFirstPageResources; |
| 84 SkTSet<SkPDFObject*>* fOtherPageResources; | 84 SkTSet<SkPDFObject*>* fOtherPageResources; |
| 85 SkTDArray<SkPDFObject*> fSubstitutes; | 85 SkTDArray<SkPDFObject*> fSubstitutes; |
| 86 | 86 |
| 87 SkPDFDict* fTrailerDict; | 87 SkPDFDict* fTrailerDict; |
| 88 | 88 |
| 89 /** Output the PDF header to the passed stream. | 89 /** Output the PDF header to the passed stream. |
| 90 * @param stream The writable output stream to send the header to. | 90 * @param stream The writable output stream to send the header to. |
| 91 */ | 91 */ |
| 92 void emitHeader(SkWStream* stream); | 92 void emitHeader(SkWStream* stream); |
| 93 | 93 |
| 94 /** Get the size of the header. | 94 /** Get the size of the header. |
| 95 */ | 95 */ |
| 96 size_t headerSize(); | 96 size_t headerSize(); |
| 97 | 97 |
| 98 /** Output the PDF footer to the passed stream. | 98 /** Output the PDF footer to the passed stream. |
| 99 * @param stream The writable output stream to send the footer to. | 99 * @param stream The writable output stream to send the footer to. |
| 100 * @param objCount The number of objects in the PDF. | 100 * @param objCount The number of objects in the PDF. |
| 101 */ | 101 */ |
| 102 void emitFooter(SkWStream* stream, int64_t objCount); | 102 void emitFooter(SkWStream* stream, int64_t objCount); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 #endif | 105 #endif |
| OLD | NEW |