• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "SkPdfAppearanceCharacteristicsDictionary_autogen.h"
9 #include "SkPdfNativeDoc.h"
10 
R(SkPdfNativeDoc * doc)11 int64_t SkPdfAppearanceCharacteristicsDictionary::R(SkPdfNativeDoc* doc) {
12   SkPdfNativeObject* ret = get("R", "");
13   if (doc) {ret = doc->resolveReference(ret);}
14   if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->intValue();
15   // TODO(edisonn): warn about missing default value for optional fields
16   return 0;
17 }
18 
has_R() const19 bool SkPdfAppearanceCharacteristicsDictionary::has_R() const {
20   return get("R", "") != NULL;
21 }
22 
BC(SkPdfNativeDoc * doc)23 SkPdfArray* SkPdfAppearanceCharacteristicsDictionary::BC(SkPdfNativeDoc* doc) {
24   SkPdfNativeObject* ret = get("BC", "");
25   if (doc) {ret = doc->resolveReference(ret);}
26   if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfArray*)ret;
27   // TODO(edisonn): warn about missing default value for optional fields
28   return NULL;
29 }
30 
has_BC() const31 bool SkPdfAppearanceCharacteristicsDictionary::has_BC() const {
32   return get("BC", "") != NULL;
33 }
34 
BG(SkPdfNativeDoc * doc)35 SkPdfArray* SkPdfAppearanceCharacteristicsDictionary::BG(SkPdfNativeDoc* doc) {
36   SkPdfNativeObject* ret = get("BG", "");
37   if (doc) {ret = doc->resolveReference(ret);}
38   if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfArray*)ret;
39   // TODO(edisonn): warn about missing default value for optional fields
40   return NULL;
41 }
42 
has_BG() const43 bool SkPdfAppearanceCharacteristicsDictionary::has_BG() const {
44   return get("BG", "") != NULL;
45 }
46 
CA(SkPdfNativeDoc * doc)47 SkString SkPdfAppearanceCharacteristicsDictionary::CA(SkPdfNativeDoc* doc) {
48   SkPdfNativeObject* ret = get("CA", "");
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 
has_CA() const55 bool SkPdfAppearanceCharacteristicsDictionary::has_CA() const {
56   return get("CA", "") != NULL;
57 }
58 
RC(SkPdfNativeDoc * doc)59 SkString SkPdfAppearanceCharacteristicsDictionary::RC(SkPdfNativeDoc* doc) {
60   SkPdfNativeObject* ret = get("RC", "");
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 
has_RC() const67 bool SkPdfAppearanceCharacteristicsDictionary::has_RC() const {
68   return get("RC", "") != NULL;
69 }
70 
AC(SkPdfNativeDoc * doc)71 SkString SkPdfAppearanceCharacteristicsDictionary::AC(SkPdfNativeDoc* doc) {
72   SkPdfNativeObject* ret = get("AC", "");
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 
has_AC() const79 bool SkPdfAppearanceCharacteristicsDictionary::has_AC() const {
80   return get("AC", "") != NULL;
81 }
82 
I(SkPdfNativeDoc * doc)83 SkPdfStream* SkPdfAppearanceCharacteristicsDictionary::I(SkPdfNativeDoc* doc) {
84   SkPdfNativeObject* ret = get("I", "");
85   if (doc) {ret = doc->resolveReference(ret);}
86   if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->getStream();
87   // TODO(edisonn): warn about missing default value for optional fields
88   return NULL;
89 }
90 
has_I() const91 bool SkPdfAppearanceCharacteristicsDictionary::has_I() const {
92   return get("I", "") != NULL;
93 }
94 
RI(SkPdfNativeDoc * doc)95 SkPdfStream* SkPdfAppearanceCharacteristicsDictionary::RI(SkPdfNativeDoc* doc) {
96   SkPdfNativeObject* ret = get("RI", "");
97   if (doc) {ret = doc->resolveReference(ret);}
98   if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->getStream();
99   // TODO(edisonn): warn about missing default value for optional fields
100   return NULL;
101 }
102 
has_RI() const103 bool SkPdfAppearanceCharacteristicsDictionary::has_RI() const {
104   return get("RI", "") != NULL;
105 }
106 
IX(SkPdfNativeDoc * doc)107 SkPdfStream* SkPdfAppearanceCharacteristicsDictionary::IX(SkPdfNativeDoc* doc) {
108   SkPdfNativeObject* ret = get("IX", "");
109   if (doc) {ret = doc->resolveReference(ret);}
110   if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->getStream();
111   // TODO(edisonn): warn about missing default value for optional fields
112   return NULL;
113 }
114 
has_IX() const115 bool SkPdfAppearanceCharacteristicsDictionary::has_IX() const {
116   return get("IX", "") != NULL;
117 }
118 
IF(SkPdfNativeDoc * doc)119 SkPdfDictionary* SkPdfAppearanceCharacteristicsDictionary::IF(SkPdfNativeDoc* doc) {
120   SkPdfNativeObject* ret = get("IF", "");
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 
has_IF() const127 bool SkPdfAppearanceCharacteristicsDictionary::has_IF() const {
128   return get("IF", "") != NULL;
129 }
130 
TP(SkPdfNativeDoc * doc)131 int64_t SkPdfAppearanceCharacteristicsDictionary::TP(SkPdfNativeDoc* doc) {
132   SkPdfNativeObject* ret = get("TP", "");
133   if (doc) {ret = doc->resolveReference(ret);}
134   if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->intValue();
135   // TODO(edisonn): warn about missing default value for optional fields
136   return 0;
137 }
138 
has_TP() const139 bool SkPdfAppearanceCharacteristicsDictionary::has_TP() const {
140   return get("TP", "") != NULL;
141 }
142