Migration of QtMvvm from github
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

102 lines
4.0 KiB

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:qxg="https://skycoder42.de/QXmlCodeGen"><!-- TODO proper name/url -->
<!-- QXG Definitions -->
<qxg:config class="SettingsGeneratorBase"
stdcompat="true">
<qxg:include>QtCore/QHash</qxg:include>
</qxg:config>
<qxg:method name="read_type_mapping" type="QHash&lt;QString, QString&gt;" asGroup="true"/>
<qxg:method name="read_included_file" type="NodeContentGroup"/>
<!-- Type definitions -->
<xs:complexType name="IncludeType">
<xs:simpleContent>
<xs:extension base="xs:string" qxg:member="includePath">
<xs:attribute default="false" name="local" type="xs:boolean" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="ImportType">
<xs:simpleContent>
<xs:extension base="xs:string" qxg:member="importPath">
<xs:attribute default="true" name="required" type="xs:boolean" use="optional"/>
<xs:attribute name="rootNode" type="xs:string" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="TypeMappingEntry">
<xs:attribute name="key" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
</xs:complexType>
<xs:group name="TypeMappingGroup">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="TypeMapping" type="TypeMappingEntry"/>
</xs:sequence>
</xs:group>
<xs:complexType name="ParamType">
<xs:simpleContent>
<xs:extension base="xs:string" qxg:member="value">
<xs:attribute name="key" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute default="false" name="asStr" type="xs:boolean" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="BackendType">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Param" type="ParamType"/>
</xs:sequence>
<xs:attribute name="class" type="xs:string" use="required" qxg:member="className"/>
</xs:complexType>
<xs:group name="NodeContentGroup">
<xs:sequence>
<xs:choice maxOccurs="unbounded" minOccurs="0" qxg:member="contentNodes">
<xs:element name="Node" type="NodeType"/>
<xs:element name="Entry" type="EntryType"/>
<xs:element name="Import" type="ImportType" qxg:method="read_included_file" qxg:methodType="NodeContentGroup"/>
</xs:choice>
</xs:sequence>
</xs:group>
<xs:complexType name="NodeType" qxg:declare="true">
<xs:group ref="NodeContentGroup" qxg:inherit="true"/>
<xs:attribute name="key" type="xs:string" use="required"/>
</xs:complexType>
<xs:complexType name="EntryType" qxg:declare="true">
<xs:complexContent>
<xs:extension base="NodeType">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="Code" type="xs:string"/>
</xs:sequence>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="qmlGroupKey" type="xs:string" use="optional"/>
<xs:attribute name="default" type="xs:string" use="optional" qxg:member="defaultValue"/>
<xs:attribute default="false" name="tr" type="xs:boolean" use="optional"/>
<xs:attribute name="trContext" type="xs:string" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="SettingsType">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Include" type="IncludeType" qxg:member="includes"/>
<xs:element maxOccurs="1" minOccurs="0" name="Backend" type="BackendType"/>
<xs:group ref="TypeMappingGroup" qxg:member="typeMappings" qxg:method="read_type_mapping" qxg:methodType="QHash&lt;QString, QString&gt;"/> <!-- TODO should be auto-detected -->
<xs:group ref="NodeContentGroup" qxg:inherit="true"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="optional"/>
<xs:attribute name="prefix" type="xs:string" use="optional"/>
<xs:attribute name="baseKey" type="xs:string" use="optional"/>
</xs:complexType>
<!-- root elements-->
<xs:element name="Settings" type="SettingsType"/>
</xs:schema>