| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright 2013 Google Inc. | |
| 3 | |
| 4 * Use of this source code is governed by a BSD-style license that can be | |
| 5 * found in the LICENSE file. | |
| 6 */ | |
| 7 | |
| 8 #include "SkPdfFDFDictionary_autogen.h" | |
| 9 #include "SkPdfNativeDoc.h" | |
| 10 | |
| 11 SkPdfFileSpec SkPdfFDFDictionary::F(SkPdfNativeDoc* doc) { | |
| 12 SkPdfNativeObject* ret = get("F", ""); | |
| 13 if (doc) {ret = doc->resolveReference(ret);} | |
| 14 if ((ret != NULL && false) || (doc == NULL && ret != NULL && ret->isReference(
))) return ret->fileSpecValue(); | |
| 15 // TODO(edisonn): warn about missing default value for optional fields | |
| 16 return SkPdfFileSpec(); | |
| 17 } | |
| 18 | |
| 19 bool SkPdfFDFDictionary::has_F() const { | |
| 20 return get("F", "") != NULL; | |
| 21 } | |
| 22 | |
| 23 SkPdfArray* SkPdfFDFDictionary::ID(SkPdfNativeDoc* doc) { | |
| 24 SkPdfNativeObject* ret = get("ID", ""); | |
| 25 if (doc) {ret = doc->resolveReference(ret);} | |
| 26 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; | |
| 27 // TODO(edisonn): warn about missing default value for optional fields | |
| 28 return NULL; | |
| 29 } | |
| 30 | |
| 31 bool SkPdfFDFDictionary::has_ID() const { | |
| 32 return get("ID", "") != NULL; | |
| 33 } | |
| 34 | |
| 35 SkPdfArray* SkPdfFDFDictionary::Fields(SkPdfNativeDoc* doc) { | |
| 36 SkPdfNativeObject* ret = get("Fields", ""); | |
| 37 if (doc) {ret = doc->resolveReference(ret);} | |
| 38 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; | |
| 39 // TODO(edisonn): warn about missing default value for optional fields | |
| 40 return NULL; | |
| 41 } | |
| 42 | |
| 43 bool SkPdfFDFDictionary::has_Fields() const { | |
| 44 return get("Fields", "") != NULL; | |
| 45 } | |
| 46 | |
| 47 SkString SkPdfFDFDictionary::Status(SkPdfNativeDoc* doc) { | |
| 48 SkPdfNativeObject* ret = get("Status", ""); | |
| 49 if (doc) {ret = doc->resolveReference(ret);} | |
| 50 if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret-
>isReference())) return ret->stringValue2(); | |
| 51 // TODO(edisonn): warn about missing default value for optional fields | |
| 52 return SkString(); | |
| 53 } | |
| 54 | |
| 55 bool SkPdfFDFDictionary::has_Status() const { | |
| 56 return get("Status", "") != NULL; | |
| 57 } | |
| 58 | |
| 59 SkPdfArray* SkPdfFDFDictionary::Pages(SkPdfNativeDoc* doc) { | |
| 60 SkPdfNativeObject* ret = get("Pages", ""); | |
| 61 if (doc) {ret = doc->resolveReference(ret);} | |
| 62 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; | |
| 63 // TODO(edisonn): warn about missing default value for optional fields | |
| 64 return NULL; | |
| 65 } | |
| 66 | |
| 67 bool SkPdfFDFDictionary::has_Pages() const { | |
| 68 return get("Pages", "") != NULL; | |
| 69 } | |
| 70 | |
| 71 SkString SkPdfFDFDictionary::Encoding(SkPdfNativeDoc* doc) { | |
| 72 SkPdfNativeObject* ret = get("Encoding", ""); | |
| 73 if (doc) {ret = doc->resolveReference(ret);} | |
| 74 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
| 75 // TODO(edisonn): warn about missing default value for optional fields | |
| 76 return SkString(); | |
| 77 } | |
| 78 | |
| 79 bool SkPdfFDFDictionary::has_Encoding() const { | |
| 80 return get("Encoding", "") != NULL; | |
| 81 } | |
| 82 | |
| 83 SkPdfArray* SkPdfFDFDictionary::Annots(SkPdfNativeDoc* doc) { | |
| 84 SkPdfNativeObject* ret = get("Annots", ""); | |
| 85 if (doc) {ret = doc->resolveReference(ret);} | |
| 86 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; | |
| 87 // TODO(edisonn): warn about missing default value for optional fields | |
| 88 return NULL; | |
| 89 } | |
| 90 | |
| 91 bool SkPdfFDFDictionary::has_Annots() const { | |
| 92 return get("Annots", "") != NULL; | |
| 93 } | |
| 94 | |
| 95 SkPdfStream* SkPdfFDFDictionary::Differences(SkPdfNativeDoc* doc) { | |
| 96 SkPdfNativeObject* ret = get("Differences", ""); | |
| 97 if (doc) {ret = doc->resolveReference(ret);} | |
| 98 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->getStream(); | |
| 99 // TODO(edisonn): warn about missing default value for optional fields | |
| 100 return NULL; | |
| 101 } | |
| 102 | |
| 103 bool SkPdfFDFDictionary::has_Differences() const { | |
| 104 return get("Differences", "") != NULL; | |
| 105 } | |
| 106 | |
| 107 SkString SkPdfFDFDictionary::Target(SkPdfNativeDoc* doc) { | |
| 108 SkPdfNativeObject* ret = get("Target", ""); | |
| 109 if (doc) {ret = doc->resolveReference(ret);} | |
| 110 if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret-
>isReference())) return ret->stringValue2(); | |
| 111 // TODO(edisonn): warn about missing default value for optional fields | |
| 112 return SkString(); | |
| 113 } | |
| 114 | |
| 115 bool SkPdfFDFDictionary::has_Target() const { | |
| 116 return get("Target", "") != NULL; | |
| 117 } | |
| 118 | |
| 119 SkPdfArray* SkPdfFDFDictionary::EmbeddedFDFs(SkPdfNativeDoc* doc) { | |
| 120 SkPdfNativeObject* ret = get("EmbeddedFDFs", ""); | |
| 121 if (doc) {ret = doc->resolveReference(ret);} | |
| 122 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR
eference())) return (SkPdfArray*)ret; | |
| 123 // TODO(edisonn): warn about missing default value for optional fields | |
| 124 return NULL; | |
| 125 } | |
| 126 | |
| 127 bool SkPdfFDFDictionary::has_EmbeddedFDFs() const { | |
| 128 return get("EmbeddedFDFs", "") != NULL; | |
| 129 } | |
| 130 | |
| 131 SkPdfDictionary* SkPdfFDFDictionary::JavaScript(SkPdfNativeDoc* doc) { | |
| 132 SkPdfNativeObject* ret = get("JavaScript", ""); | |
| 133 if (doc) {ret = doc->resolveReference(ret);} | |
| 134 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret
->isReference())) return (SkPdfDictionary*)ret; | |
| 135 // TODO(edisonn): warn about missing default value for optional fields | |
| 136 return NULL; | |
| 137 } | |
| 138 | |
| 139 bool SkPdfFDFDictionary::has_JavaScript() const { | |
| 140 return get("JavaScript", "") != NULL; | |
| 141 } | |
| OLD | NEW |