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
11SkPdfNativeObject* 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
19bool SkPdfMovieActivationDictionary::has_Start() const {
20  return get("Start", "") != NULL;
21}
22
23SkPdfNativeObject* 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
31bool SkPdfMovieActivationDictionary::has_Duration() const {
32  return get("Duration", "") != NULL;
33}
34
35double 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
43bool SkPdfMovieActivationDictionary::has_Rate() const {
44  return get("Rate", "") != NULL;
45}
46
47double 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
55bool SkPdfMovieActivationDictionary::has_Volume() const {
56  return get("Volume", "") != NULL;
57}
58
59bool 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
67bool SkPdfMovieActivationDictionary::has_ShowControls() const {
68  return get("ShowControls", "") != NULL;
69}
70
71SkString 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
79bool SkPdfMovieActivationDictionary::has_Mode() const {
80  return get("Mode", "") != NULL;
81}
82
83bool 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
91bool SkPdfMovieActivationDictionary::has_Synchronous() const {
92  return get("Synchronous", "") != NULL;
93}
94
95SkPdfArray* 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
103bool SkPdfMovieActivationDictionary::has_FWScale() const {
104  return get("FWScale", "") != NULL;
105}
106
107SkPdfArray* 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
115bool SkPdfMovieActivationDictionary::has_FWPosition() const {
116  return get("FWPosition", "") != NULL;
117}
118