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="extension" /> <!-- java as @hide. Included as a public key in the extensions. -->
208                    <enumeration value="public" /> <!-- public to both java and NDK -->
209                    <enumeration value="fwk_only" /> <!-- java as @hide. Not included in NDK. Not included in hal interfaces. -->
210                    <enumeration value="fwk_java_public" /> <!-- public to java. Not included in NDK. Not included in hal interfaces. -->
211                </restriction>
212            </simpleType>
213        </attribute>
214        <attribute name="synthetic" default="false">
215            <simpleType>
216                <restriction base="string">
217                    <enumeration value="false" /> <!-- expose to C -->
218                    <enumeration value="true" /> <!-- do not expose to C -->
219                </restriction>
220            </simpleType>
221        </attribute>
222        <attribute name="deprecated" default="false">
223            <simpleType>
224                <restriction base="string">
225                    <enumeration value="false" /> <!-- normal -->
226                    <enumeration value="true" /> <!-- mark @Deprecated -->
227                </restriction>
228            </simpleType>
229        </attribute>
230        <attribute name="optional" default="false">
231            <simpleType>
232                <restriction base="string">
233                    <enumeration value="false" />
234                    <enumeration value="true" />
235                </restriction>
236            </simpleType>
237        </attribute>
238        <attribute name="typedef" type="string" />
239        <attribute name="hwlevel" default="full">
240            <simpleType>
241                <restriction base="string">
242                    <enumeration value="full" />
243                    <enumeration value="limited" />
244                    <enumeration value="legacy" />
245                </restriction>
246            </simpleType>
247        </attribute>
248        <attribute name="hal_version" type="decimal" default="3.2" />
249        <attribute name="permission_needed" default="false">
250            <simpleType>
251                <restriction base="string">
252                    <enumeration value="true" />
253                    <enumeration value="false" />
254                </restriction>
255            </simpleType>
256        </attribute>
257        <attribute name="aconfig_flag" type="string" />
258        <attribute name="session_characteristics_key_since" type="decimal"/>
259    </complexType>
260
261    <complexType name="EnumType">
262        <sequence>
263            <element name="value" type="tns:EnumValueType" maxOccurs="unbounded"></element>
264        </sequence>
265    </complexType>
266
267    <complexType name="TupleType">
268        <sequence>
269            <element name="value" type="string" minOccurs="1" maxOccurs="unbounded"></element>
270        </sequence>
271    </complexType>
272
273    <complexType name="ArrayType">
274        <sequence>
275            <element name="size" type="string" minOccurs="1" maxOccurs="unbounded"></element>
276        </sequence>
277    </complexType>
278
279    <complexType name="EnumValueType" mixed="true">
280
281        <all>
282            <element name="notes" type="string" minOccurs="0" maxOccurs="1"/>
283            <element name="sdk_notes" type="string" minOccurs="0" maxOccurs="1"/>
284            <element name="ndk_notes" type="string" minOccurs="0" maxOccurs="1" />
285        </all>
286
287        <attribute name="deprecated" default="false">
288            <simpleType>
289                <restriction base="string">
290                    <enumeration value="true"></enumeration>
291                    <enumeration value="false"></enumeration>
292                </restriction>
293            </simpleType>
294        </attribute>
295        <attribute name="optional">
296            <simpleType>
297                <restriction base="string">
298                    <enumeration value="true"></enumeration>
299                    <enumeration value="false"></enumeration>
300                </restriction>
301            </simpleType>
302        </attribute>
303        <attribute name="hidden">
304            <simpleType>
305                <restriction base="string">
306                    <enumeration value="true"></enumeration>
307                    <enumeration value="false"></enumeration>
308                </restriction>
309            </simpleType>
310        </attribute>
311        <attribute name="ndk_hidden">
312            <simpleType>
313                <restriction base="string">
314                    <enumeration value="true"></enumeration>
315                    <enumeration value="false"></enumeration>
316                </restriction>
317            </simpleType>
318        </attribute>
319        <attribute name="visibility">
320            <simpleType>
321                <restriction base="string">
322                    <enumeration value="system" /> <!-- do not expose to java/NDK API -->
323                    <enumeration value="java_public" /> <!-- java as public SDK. Not included in NDK -->
324                    <enumeration value="ndk_public" /> <!-- public in NDK. @hide in java -->
325                    <enumeration value="hidden" /> <!-- java as @hide. Not included in NDK -->
326                    <enumeration value="extension" /> <!-- java as @hide. Included as a public enum in the extensions. -->
327                    <enumeration value="test" /> <!-- java as @TestApi. Not included in NDK -->
328                    <enumeration value="public" /> <!-- public to both java and NDK -->
329                </restriction>
330            </simpleType>
331        </attribute>
332        <attribute name="id" type="string" />
333        <attribute name="hal_version" type="decimal" default="3.2" />
334        <attribute name="aconfig_flag" type="string" />
335    </complexType>
336
337    <complexType name="CloneType">
338        <sequence>
339                <group ref="tns:BaseEntryGroup" />
340        </sequence>
341
342        <!--
343             the semantic correctness of the next 2 attributes
344             are validated by metadata_validate.py
345
346             due to the inability of XSD to generate paths recursively
347        -->
348        <attribute name="entry">
349        </attribute>
350        <attribute name="kind">
351            <simpleType>
352                <restriction base="string">
353                    <enumeration value="controls"></enumeration>
354                    <enumeration value="static"></enumeration>
355                    <enumeration value="dynamic"></enumeration>
356                </restriction>
357            </simpleType>
358        </attribute>
359        <attribute name="hal_version" type="decimal" default="3.2" />
360    </complexType>
361</schema>
362