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 "SkPdfMovieActivationDictionary_autogen.h"
9 #include "SkPdfNativeDoc.h"
10
Start(SkPdfNativeDoc * doc)11 SkPdfNativeObject* SkPdfMovieActivationDictionary::Start(SkPdfNativeDoc* doc) {
12 SkPdfNativeObject* ret = get("Start", "");
13 if (doc) {ret = doc->resolveReference(ret);}
14 if ((ret != NULL && true) || (doc == NULL && ret != NULL && ret->isReference())) return ret;
15 // TODO(edisonn): warn about missing default value for optional fields
16 return NULL;
17 }
18
has_Start() const19 bool SkPdfMovieActivationDictionary::has_Start() const {
20 return get("Start", "") != NULL;
21 }
22
Duration(SkPdfNativeDoc * doc)23 SkPdfNativeObject* SkPdfMovieActivationDictionary::Duration(SkPdfNativeDoc* doc) {
24 SkPdfNativeObject* ret = get("Duration", "");
25 if (doc) {ret = doc->resolveReference(ret);}
26 if ((ret != NULL && true) || (doc == NULL && ret != NULL && ret->isReference())) return ret;
27 // TODO(edisonn): warn about missing default value for optional fields
28 return NULL;
29 }
30
has_Duration() const31 bool SkPdfMovieActivationDictionary::has_Duration() const {
32 return get("Duration", "") != NULL;
33 }
34
Rate(SkPdfNativeDoc * doc)35 double SkPdfMovieActivationDictionary::Rate(SkPdfNativeDoc* doc) {
36 SkPdfNativeObject* ret = get("Rate", "");
37 if (doc) {ret = doc->resolveReference(ret);}
38 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->numberValue();
39 // TODO(edisonn): warn about missing default value for optional fields
40 return 0;
41 }
42
has_Rate() const43 bool SkPdfMovieActivationDictionary::has_Rate() const {
44 return get("Rate", "") != NULL;
45 }
46
Volume(SkPdfNativeDoc * doc)47 double SkPdfMovieActivationDictionary::Volume(SkPdfNativeDoc* doc) {
48 SkPdfNativeObject* ret = get("Volume", "");
49 if (doc) {ret = doc->resolveReference(ret);}
50 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->numberValue();
51 // TODO(edisonn): warn about missing default value for optional fields
52 return 0;
53 }
54
has_Volume() const55 bool SkPdfMovieActivationDictionary::has_Volume() const {
56 return get("Volume", "") != NULL;
57 }
58
ShowControls(SkPdfNativeDoc * doc)59 bool SkPdfMovieActivationDictionary::ShowControls(SkPdfNativeDoc* doc) {
60 SkPdfNativeObject* ret = get("ShowControls", "");
61 if (doc) {ret = doc->resolveReference(ret);}
62 if ((ret != NULL && ret->isBoolean()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->boolValue();
63 // TODO(edisonn): warn about missing default value for optional fields
64 return false;
65 }
66
has_ShowControls() const67 bool SkPdfMovieActivationDictionary::has_ShowControls() const {
68 return get("ShowControls", "") != NULL;
69 }
70
Mode(SkPdfNativeDoc * doc)71 SkString SkPdfMovieActivationDictionary::Mode(SkPdfNativeDoc* doc) {
72 SkPdfNativeObject* ret = get("Mode", "");
73 if (doc) {ret = doc->resolveReference(ret);}
74 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->nameValue2();
75 // TODO(edisonn): warn about missing default value for optional fields
76 return SkString();
77 }
78
has_Mode() const79 bool SkPdfMovieActivationDictionary::has_Mode() const {
80 return get("Mode", "") != NULL;
81 }
82
Synchronous(SkPdfNativeDoc * doc)83 bool SkPdfMovieActivationDictionary::Synchronous(SkPdfNativeDoc* doc) {
84 SkPdfNativeObject* ret = get("Synchronous", "");
85 if (doc) {ret = doc->resolveReference(ret);}
86 if ((ret != NULL && ret->isBoolean()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->boolValue();
87 // TODO(edisonn): warn about missing default value for optional fields
88 return false;
89 }
90
has_Synchronous() const91 bool SkPdfMovieActivationDictionary::has_Synchronous() const {
92 return get("Synchronous", "") != NULL;
93 }
94
FWScale(SkPdfNativeDoc * doc)95 SkPdfArray* SkPdfMovieActivationDictionary::FWScale(SkPdfNativeDoc* doc) {
96 SkPdfNativeObject* ret = get("FWScale", "");
97 if (doc) {ret = doc->resolveReference(ret);}
98 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfArray*)ret;
99 // TODO(edisonn): warn about missing default value for optional fields
100 return NULL;
101 }
102
has_FWScale() const103 bool SkPdfMovieActivationDictionary::has_FWScale() const {
104 return get("FWScale", "") != NULL;
105 }
106
FWPosition(SkPdfNativeDoc * doc)107 SkPdfArray* SkPdfMovieActivationDictionary::FWPosition(SkPdfNativeDoc* doc) {
108 SkPdfNativeObject* ret = get("FWPosition", "");
109 if (doc) {ret = doc->resolveReference(ret);}
110 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfArray*)ret;
111 // TODO(edisonn): warn about missing default value for optional fields
112 return NULL;
113 }
114
has_FWPosition() const115 bool SkPdfMovieActivationDictionary::has_FWPosition() const {
116 return get("FWPosition", "") != NULL;
117 }
118