OLD | NEW |
| (Empty) |
1 #ifndef __DEFINED__SkPdfType1FormDictionary | |
2 #define __DEFINED__SkPdfType1FormDictionary | |
3 | |
4 #include "SkPdfUtils.h" | |
5 #include "SkPdfEnums_autogen.h" | |
6 #include "SkPdfArray_autogen.h" | |
7 #include "SkPdfXObjectDictionary_autogen.h" | |
8 | |
9 // Additional entries specific to a type 1 form dictionary | |
10 class SkPdfType1FormDictionary : public SkPdfXObjectDictionary { | |
11 public: | |
12 virtual SkPdfObjectType getType() const { return kType1FormDictionary_SkPdfObj
ectType;} | |
13 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kType1Fo
rmDictionary_SkPdfObjectType + 1);} | |
14 public: | |
15 virtual SkPdfType1FormDictionary* asType1FormDictionary() {return this;} | |
16 virtual const SkPdfType1FormDictionary* asType1FormDictionary() const {return
this;} | |
17 | |
18 private: | |
19 virtual SkPdfImageDictionary* asImageDictionary() {return NULL;} | |
20 virtual const SkPdfImageDictionary* asImageDictionary() const {return NULL;} | |
21 | |
22 public: | |
23 private: | |
24 public: | |
25 SkPdfType1FormDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObje
ct* podofoObj = NULL) : SkPdfXObjectDictionary(podofoDoc, podofoObj) {} | |
26 | |
27 SkPdfType1FormDictionary(const SkPdfType1FormDictionary& from) : SkPdfXObjectD
ictionary(from.fPodofoDoc, from.fPodofoObj) {} | |
28 | |
29 virtual bool valid() const {return true;} | |
30 | |
31 SkPdfType1FormDictionary& operator=(const SkPdfType1FormDictionary& from) {thi
s->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *thi
s;} | |
32 | |
33 /** (Optional) The type of PDF object that this dictionary describes; if present
, | |
34 * must be XObject for a form XObject. | |
35 **/ | |
36 bool has_Type() const { | |
37 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); | |
38 } | |
39 | |
40 std::string Type() const; | |
41 /** (Required) The type of XObject that this dictionary describes; must be Form | |
42 * for a form XObject. | |
43 **/ | |
44 bool has_Subtype() const { | |
45 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subty
pe", "", NULL)); | |
46 } | |
47 | |
48 std::string Subtype() const; | |
49 /** (Optional) A code identifying the type of form XObject that this dictionary | |
50 * describes. The only valid value defined at the time of publication is 1. Def
ault | |
51 * value: 1. | |
52 **/ | |
53 bool has_FormType() const { | |
54 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FormT
ype", "", NULL)); | |
55 } | |
56 | |
57 long FormType() const; | |
58 /** (Required in PDF 1.0; optional otherwise) The name by which this form | |
59 * XObject is referenced in the XObject subdictionary of the current resource | |
60 * dictionary (see Section 3.7.2, "Resource Dictionaries"). | |
61 * Note: This entry is obsolescent and its use is no longer recommended. (See | |
62 * implementation note 38 in Appendix H.) | |
63 **/ | |
64 bool has_Name() const { | |
65 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name"
, "", NULL)); | |
66 } | |
67 | |
68 std::string Name() const; | |
69 /** (Required if PieceInfo is present; optional otherwise; PDF 1.3) The date and | |
70 * time (see Section 3.8.2, "Dates") when the form XObject's contents were | |
71 * most recently modified. If a page-piece dictionary (PieceInfo) is present, t
he | |
72 * modification date is used to ascertain which of the application data diction
- | |
73 * aries it contains correspond to the current content of the form (see Section | |
74 * 9.4, "Page-Piece Dictionaries"). | |
75 **/ | |
76 bool has_LastModified() const { | |
77 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LastM
odified", "", NULL)); | |
78 } | |
79 | |
80 SkPdfDate LastModified() const; | |
81 /** (Required) An array of four numbers in the form coordinate system (see | |
82 * below), giving the coordinates of the left, bottom, right, and top edges, | |
83 * respectively, of the form XObject's bounding box. These boundaries are used | |
84 * to clip the form XObject and to determine its size for caching. | |
85 **/ | |
86 bool has_BBox() const { | |
87 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BBox"
, "", NULL)); | |
88 } | |
89 | |
90 SkRect* BBox() const; | |
91 /** (Optional) An array of six numbers specifying the form matrix, which maps | |
92 * form space into user space (see Section 4.2.3, "Transformation Matrices"). | |
93 * Default value: the identity matrix [1 0 0 1 0 0]. | |
94 **/ | |
95 bool has_Matrix() const { | |
96 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Matri
x", "", NULL)); | |
97 } | |
98 | |
99 SkMatrix* Matrix() const; | |
100 /** (Optional but strongly recommended; PDF 1.2) A dictionary specifying any | |
101 * resources (such as fonts and images) required by the form XObject (see Sec- | |
102 * tion 3.7, "Content Streams and Resources"). | |
103 * In PDF 1.1 and earlier, all named resources used in the form XObject must be | |
104 * included in the resource dictionary of each page object on which the form | |
105 * XObject appears, whether or not they also appear in the resource dictionary | |
106 * of the form XObject itself. It can be useful to specify these resources in t
he | |
107 * form XObject's own resource dictionary as well, in order to determine which | |
108 * resources are used inside the form XObject. If a resource is included in bot
h | |
109 * dictionaries, it should have the same name in both locations. | |
110 * In PDF 1.2 and later versions, form XObjects can be independent of the | |
111 * content streams in which they appear, and this is strongly recommended | |
112 * although not required. In an independent form XObject, the resource dic
- | |
113 * tionary of the form XObject is required and contains all named resource
s | |
114 * used by the form XObject. These resources are not "promoted" to the out
er | |
115 * content stream's resource dictionary, although that stream's resource d
iction- | |
116 * ary will refer to the form XObject itself. | |
117 **/ | |
118 bool has_Resources() const { | |
119 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Resou
rces", "", NULL)); | |
120 } | |
121 | |
122 SkPdfResourceDictionary* Resources() const; | |
123 /** (Optional; PDF 1.4) A group attributes dictionary indicating that the conten
ts | |
124 * of the form XObject are to be treated as a group and specifying the attribut
es | |
125 * of that group (see Section 4.9.2, "Group XObjects"). | |
126 * Note: If a Ref entry (see below) is present, the group attributes also apply
to the | |
127 * external page imported by that entry. This allows such an imported page to b
e | |
128 * treated as a group without further modification. | |
129 **/ | |
130 bool has_Group() const { | |
131 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Group
", "", NULL)); | |
132 } | |
133 | |
134 SkPdfDictionary* Group() const; | |
135 /** (Optional; PDF 1.4) A reference dictionary identifying a page to be imported | |
136 * from another PDF file, and for which the form XObject serves as a proxy (see | |
137 * Section 4.9.3, "Reference XObjects"). | |
138 **/ | |
139 bool has_Ref() const { | |
140 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Ref",
"", NULL)); | |
141 } | |
142 | |
143 SkPdfDictionary* Ref() const; | |
144 /** (Optional; PDF 1.4) A metadata stream containing metadata for the form | |
145 * XObject (see Section 9.2.2, "Metadata Streams"). | |
146 **/ | |
147 bool has_Metadata() const { | |
148 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metad
ata", "", NULL)); | |
149 } | |
150 | |
151 SkPdfStream* Metadata() const; | |
152 /** (Optional; PDF 1.3) A page-piece dictionary associated with the form | |
153 * XObject (see Section 9.4, "Page-Piece Dictionaries"). | |
154 **/ | |
155 bool has_PieceInfo() const { | |
156 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Piece
Info", "", NULL)); | |
157 } | |
158 | |
159 SkPdfDictionary* PieceInfo() const; | |
160 /** (Required if the form XObject is a structural content item; PDF 1.3) The int
eger | |
161 * key of the form XObject's entry in the structural parent tree (see "Finding | |
162 * Structure Elements from Content Items" on page 600). | |
163 **/ | |
164 bool has_StructParent() const { | |
165 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Struc
tParent", "", NULL)); | |
166 } | |
167 | |
168 long StructParent() const; | |
169 /** (Required if the form XObject contains marked-content sequences that are str
uc- | |
170 * tural content items; PDF 1.3) The integer key of the form XObject's entry in | |
171 * the structural parent tree (see "Finding Structure Elements from Content | |
172 * Items" on page 600). | |
173 * Note: At most one of the entries StructParent or StructParents may be presen
t. A | |
174 * form XObject can be either a content item in its entirety or a container for | |
175 * marked-content sequences that are content items, but not both. | |
176 **/ | |
177 bool has_StructParents() const { | |
178 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Struc
tParents", "", NULL)); | |
179 } | |
180 | |
181 long StructParents() const; | |
182 /** (Optional; PDF 1.2) An OPI version dictionary for the form XObject (see | |
183 * Section 9.10.6, "Open Prepress Interface (OPI)"). | |
184 **/ | |
185 bool has_OPI() const { | |
186 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OPI",
"", NULL)); | |
187 } | |
188 | |
189 SkPdfDictionary* OPI() const; | |
190 }; | |
191 | |
192 #endif // __DEFINED__SkPdfType1FormDictionary | |
OLD | NEW |