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 "SkPdfFileSpecificationDictionary_autogen.h"
9#include "SkPdfNativeDoc.h"
10
11SkString SkPdfFileSpecificationDictionary::Type(SkPdfNativeDoc* doc) {
12  SkPdfNativeObject* ret = get("Type", "");
13  if (doc) {ret = doc->resolveReference(ret);}
14  if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->nameValue2();
15  // TODO(edisonn): warn about missing default value for optional fields
16  return SkString();
17}
18
19bool SkPdfFileSpecificationDictionary::has_Type() const {
20  return get("Type", "") != NULL;
21}
22
23SkString SkPdfFileSpecificationDictionary::FS(SkPdfNativeDoc* doc) {
24  SkPdfNativeObject* ret = get("FS", "");
25  if (doc) {ret = doc->resolveReference(ret);}
26  if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->nameValue2();
27  // TODO(edisonn): warn about missing default value for optional fields
28  return SkString();
29}
30
31bool SkPdfFileSpecificationDictionary::has_FS() const {
32  return get("FS", "") != NULL;
33}
34
35SkString SkPdfFileSpecificationDictionary::F(SkPdfNativeDoc* doc) {
36  SkPdfNativeObject* ret = get("F", "");
37  if (doc) {ret = doc->resolveReference(ret);}
38  if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->stringValue2();
39  // TODO(edisonn): warn about missing default value for optional fields
40  return SkString();
41}
42
43bool SkPdfFileSpecificationDictionary::has_F() const {
44  return get("F", "") != NULL;
45}
46
47SkString SkPdfFileSpecificationDictionary::DOS(SkPdfNativeDoc* doc) {
48  SkPdfNativeObject* ret = get("DOS", "");
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
55bool SkPdfFileSpecificationDictionary::has_DOS() const {
56  return get("DOS", "") != NULL;
57}
58
59SkString SkPdfFileSpecificationDictionary::Mac(SkPdfNativeDoc* doc) {
60  SkPdfNativeObject* ret = get("Mac", "");
61  if (doc) {ret = doc->resolveReference(ret);}
62  if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->stringValue2();
63  // TODO(edisonn): warn about missing default value for optional fields
64  return SkString();
65}
66
67bool SkPdfFileSpecificationDictionary::has_Mac() const {
68  return get("Mac", "") != NULL;
69}
70
71SkString SkPdfFileSpecificationDictionary::Unix(SkPdfNativeDoc* doc) {
72  SkPdfNativeObject* ret = get("Unix", "");
73  if (doc) {ret = doc->resolveReference(ret);}
74  if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->stringValue2();
75  // TODO(edisonn): warn about missing default value for optional fields
76  return SkString();
77}
78
79bool SkPdfFileSpecificationDictionary::has_Unix() const {
80  return get("Unix", "") != NULL;
81}
82
83SkPdfArray* SkPdfFileSpecificationDictionary::ID(SkPdfNativeDoc* doc) {
84  SkPdfNativeObject* ret = get("ID", "");
85  if (doc) {ret = doc->resolveReference(ret);}
86  if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfArray*)ret;
87  // TODO(edisonn): warn about missing default value for optional fields
88  return NULL;
89}
90
91bool SkPdfFileSpecificationDictionary::has_ID() const {
92  return get("ID", "") != NULL;
93}
94
95bool SkPdfFileSpecificationDictionary::V(SkPdfNativeDoc* doc) {
96  SkPdfNativeObject* ret = get("V", "");
97  if (doc) {ret = doc->resolveReference(ret);}
98  if ((ret != NULL && ret->isBoolean()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->boolValue();
99  // TODO(edisonn): warn about missing default value for optional fields
100  return false;
101}
102
103bool SkPdfFileSpecificationDictionary::has_V() const {
104  return get("V", "") != NULL;
105}
106
107SkPdfDictionary* SkPdfFileSpecificationDictionary::EF(SkPdfNativeDoc* doc) {
108  SkPdfNativeObject* ret = get("EF", "");
109  if (doc) {ret = doc->resolveReference(ret);}
110  if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret;
111  // TODO(edisonn): warn about missing default value for optional fields
112  return NULL;
113}
114
115bool SkPdfFileSpecificationDictionary::has_EF() const {
116  return get("EF", "") != NULL;
117}
118
119SkPdfDictionary* SkPdfFileSpecificationDictionary::RF(SkPdfNativeDoc* doc) {
120  SkPdfNativeObject* ret = get("RF", "");
121  if (doc) {ret = doc->resolveReference(ret);}
122  if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret;
123  // TODO(edisonn): warn about missing default value for optional fields
124  return NULL;
125}
126
127bool SkPdfFileSpecificationDictionary::has_RF() const {
128  return get("RF", "") != NULL;
129}
130