• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<!-- Copyright (C) 2012 The Android Open Source Project
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8          http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15-->
16<schema xmlns="http://www.w3.org/2001/XMLSchema"
17    xmlns:tns="http://schemas.android.com/service/camera/metadata/"
18    targetNamespace="http://schemas.android.com/service/camera/metadata/"
19    elementFormDefault="qualified">
20
21    <element name="metadata" type="tns:MetadataType">
22        <key name="TypeNameKey">
23            <selector xpath="tns:types/tns:typedef" />
24            <field xpath="@name" />
25        </key>
26
27        <!-- ensure that <entry typedef="..."> refers to a valid <typedef name='..."/> -->
28        <keyref name="TypeNameKeyRef" refer="tns:TypeNameKey">
29            <selector xpath=".//tns:entry" /> <!-- recursively find any descendant entry -->
30            <field xpath="@typedef" />
31        </keyref>
32    </element>
33
34    <complexType name="MetadataType">
35        <sequence>
36            <element name="tags" type="tns:TagsType" maxOccurs="1" minOccurs="0"></element>
37            <element name="types" type="tns:TypesType" maxOccurs="1" minOccurs="0"></element>
38            <element name="namespace" type="tns:NamespaceType"
39                maxOccurs="unbounded" minOccurs="1">
40            </element>
41        </sequence>
42    </complexType>
43
44    <complexType name="NamespaceType">
45        <sequence>
46            <element name="section" type="tns:SectionType" maxOccurs="unbounded" minOccurs="1"></element>
47        </sequence>
48        <attribute name="name" type="string" use="required"></attribute>
49    </complexType>
50
51    <complexType name="SectionType">
52        <sequence>
53            <choice maxOccurs="unbounded">
54                <element name="controls" type="tns:SectionKindType" maxOccurs="unbounded" minOccurs="0"></element>
55                <element name="static" type="tns:SectionKindType" maxOccurs="unbounded" minOccurs="0"></element>
56                <element name="dynamic" type="tns:SectionKindType" maxOccurs="unbounded" minOccurs="0"></element>
57            </choice>
58        </sequence>
59        <attribute name="name" type="string" use="required"></attribute>
60    </complexType>
61
62    <complexType name="SectionKindType">
63        <complexContent>
64            <extension base="tns:BaseNamespaceOrSectionKindType">
65            </extension>
66        </complexContent>
67    </complexType>
68
69    <complexType name="InnerNamespaceType">
70        <complexContent>
71            <extension base="tns:BaseNamespaceOrSectionKindType">
72                <attribute name="name" type="string" use="required"></attribute>
73            </extension>
74        </complexContent>
75    </complexType>
76
77    <complexType name="BaseNamespaceOrSectionKindType">
78        <sequence maxOccurs="unbounded">
79            <choice>
80                <element name="namespace" type="tns:InnerNamespaceType"></element>
81                <element name="entry" type="tns:EntryType"></element>
82                <element name="clone" type="tns:CloneType"></element>
83            </choice>
84        </sequence>
85    </complexType>
86
87    <complexType name="TagsType">
88        <sequence>
89            <element name="tag" type="tns:TagType" maxOccurs="unbounded" minOccurs="0"></element>
90        </sequence>
91    </complexType>
92
93    <complexType name="TagType">
94        <simpleContent>
95            <extension base="string">
96                <attribute name="id" type="string" use="required"></attribute>
97            </extension>
98        </simpleContent>
99    </complexType>
100
101    <complexType name="TypesType">
102        <sequence>
103            <element name="typedef" type="tns:TypedefType" maxOccurs="unbounded" minOccurs="0">
104            </element>
105        </sequence>
106    </complexType>
107
108    <complexType name="TypedefType">
109        <sequence>
110            <element name="language" type="tns:LanguageType" maxOccurs="unbounded" minOccurs="1"></element>
111        </sequence>
112        <attribute name="name" type="string" use="required" />
113    </complexType>
114
115    <complexType name="LanguageType">
116        <simpleContent>
117            <extension base="string">
118                <attribute name="name" use="required">
119                    <simpleType>
120                        <restriction base="string">
121                            <enumeration value="java" />
122                            <enumeration value="c" />
123                            <enumeration value="c++" />
124                        </restriction>
125                    </simpleType>
126                </attribute>
127            </extension>
128        </simpleContent>
129    </complexType>
130
131    <group name="BaseEntryGroup">
132        <sequence>
133            <element name="description" type="string" maxOccurs="1"
134                minOccurs="0">
135            </element>
136            <element name="deprecation_description" type="string" maxOccurs="1"
137                     minOccurs="0">
138            </element>
139            <element name="units" type="string" maxOccurs="1"
140                minOccurs="0">
141            </element>
142            <element name="range" type="string" maxOccurs="1"
143                minOccurs="0">
144            </element>
145            <element name="details" type="string" maxOccurs="1"
146                minOccurs="0">
147            </element>
148            <element name="ndk_details" type="string" maxOccurs="1"
149                minOccurs="0">
150            </element>
151            <element name="hal_details" type="string" maxOccurs="1"
152                minOccurs="0">
153            </element>
154
155            <element name="tag" type="tns:TagType" maxOccurs="unbounded"
156                minOccurs="0">
157            </element>
158        </sequence>
159    </group>
160
161    <complexType name="EntryType">
162        <sequence>
163            <element name="array" type="tns:ArrayType" maxOccurs="1" minOccurs="0"></element>
164            <element name="enum" type="tns:EnumType" maxOccurs="1" minOccurs="0"></element>
165            <element name="tuple" type="tns:TupleType" maxOccurs="1" minOccurs="0"></element>
166
167            <group ref="tns:BaseEntryGroup" />
168        </sequence>
169
170        <attribute name="name" type="string" use="required" />
171        <attribute name="type" use="required">
172            <simpleType>
173                <restriction base="string">
174                    <enumeration value="byte" />
175                    <enumeration value="int32" />
176                    <enumeration value="int64" />
177                    <enumeration value="float" />
178                    <enumeration value="double" />
179                    <enumeration value="rational" />
180                </restriction>
181            </simpleType>
182        </attribute>
183        <attribute name="type_notes" type="string" />
184        <attribute name="container">
185            <simpleType>
186                <restriction base="string">
187                    <enumeration value="array" />
188                    <enumeration value="tuple" />
189                </restriction>
190            </simpleType>
191        </attribute>
192        <attribute name="enum">
193            <simpleType>
194                <restriction base="string">
195                    <enumeration value="true"></enumeration>
196                    <enumeration value="false"></enumeration>
197                </restriction>
198            </simpleType>
199        </attribute>
200        <attribute name="visibility">
201            <simpleType>
202                <restriction base="string">
203                    <enumeration value="system" /> <!-- do not expose to java/NDK API -->
204                    <enumeration value="java_public" /> <!-- java as public SDK. Not included in NDK -->
205                    <enumeration value="ndk_public" /> <!-- public in NDK. @hide in java -->
206                    <enumeration value="hidden" /> <!-- java as @hide. Not included in NDK -->
207                    <enumeration value="public" /> <!-- public to both java and NDK -->
208                </restriction>
209            </simpleType>
210        </attribute>
211        <attribute name="synthetic" default="false">
212            <simpleType>
213                <restriction base="string">
214                    <enumeration value="false" /> <!-- expose to C -->
215                    <enumeration value="true" /> <!-- do not expose to C -->
216                </restriction>
217            </simpleType>
218        </attribute>
219        <attribute name="deprecated" default="false">
220            <simpleType>
221                <restriction base="string">
222                    <enumeration value="false" /> <!-- normal -->
223                    <enumeration value="true" /> <!-- mark @Deprecated -->
224                </restriction>
225            </simpleType>
226        </attribute>
227        <attribute name="optional" default="false">
228            <simpleType>
229                <restriction base="string">
230                    <enumeration value="false" />
231                    <enumeration value="true" />
232                </restriction>
233            </simpleType>
234        </attribute>
235        <attribute name="typedef" type="string" />
236        <attribute name="hwlevel" default="full">
237            <simpleType>
238                <restriction base="string">
239                    <enumeration value="full" />
240                    <enumeration value="limited" />
241                    <enumeration value="legacy" />
242                </restriction>
243            </simpleType>
244        </attribute>
245        <attribute name="hal_version" type="decimal" default="3.2" />
246    </complexType>
247
248    <complexType name="EnumType">
249        <sequence>
250            <element name="value" type="tns:EnumValueType" maxOccurs="unbounded"></element>
251        </sequence>
252    </complexType>
253
254    <complexType name="TupleType">
255        <sequence>
256            <element name="value" type="string" minOccurs="1" maxOccurs="unbounded"></element>
257        </sequence>
258    </complexType>
259
260    <complexType name="ArrayType">
261        <sequence>
262            <element name="size" type="string" minOccurs="1" maxOccurs="unbounded"></element>
263        </sequence>
264    </complexType>
265
266    <complexType name="EnumValueType" mixed="true">
267
268        <all>
269            <element name="notes" type="string" minOccurs="0" maxOccurs="1"/>
270            <element name="sdk_notes" type="string" minOccurs="0" maxOccurs="1"/>
271            <element name="ndk_notes" type="string" minOccurs="0" maxOccurs="1" />
272        </all>
273
274        <attribute name="deprecated" default="false">
275            <simpleType>
276                <restriction base="string">
277                    <enumeration value="true"></enumeration>
278                    <enumeration value="false"></enumeration>
279                </restriction>
280            </simpleType>
281        </attribute>
282        <attribute name="optional">
283            <simpleType>
284                <restriction base="string">
285                    <enumeration value="true"></enumeration>
286                    <enumeration value="false"></enumeration>
287                </restriction>
288            </simpleType>
289        </attribute>
290        <attribute name="hidden">
291            <simpleType>
292                <restriction base="string">
293                    <enumeration value="true"></enumeration>
294                    <enumeration value="false"></enumeration>
295                </restriction>
296            </simpleType>
297        </attribute>
298        <attribute name="ndk_hidden">
299            <simpleType>
300                <restriction base="string">
301                    <enumeration value="true"></enumeration>
302                    <enumeration value="false"></enumeration>
303                </restriction>
304            </simpleType>
305        </attribute>
306        <attribute name="id" type="string" />
307        <attribute name="hal_version" type="decimal" default="3.2" />
308    </complexType>
309
310    <complexType name="CloneType">
311        <sequence>
312                <group ref="tns:BaseEntryGroup" />
313        </sequence>
314
315        <!--
316             the semantic correctness of the next 2 attributes
317             are validated by metadata_validate.py
318
319             due to the inability of XSD to generate paths recursively
320        -->
321        <attribute name="entry">
322        </attribute>
323        <attribute name="kind">
324            <simpleType>
325                <restriction base="string">
326                    <enumeration value="controls"></enumeration>
327                    <enumeration value="static"></enumeration>
328                    <enumeration value="dynamic"></enumeration>
329                </restriction>
330            </simpleType>
331        </attribute>
332        <attribute name="hal_version" type="decimal" default="3.2" />
333    </complexType>
334</schema>
335