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.

115 lines
4.3 KiB

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:qxg="https://skycoder42.de/xml/schemas/QXmlCodeGen">
<!-- QXG Definitions -->
<qxg:config class="SettingsGeneratorBase"
stdcompat="true"
schemaUrl="qrc:/schemas/qsettingsgenerator.xsd">
<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 name="local" type="xs:boolean" use="optional" default="false"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="ImportType">
<xs:simpleContent>
<xs:extension base="xs:string" qxg:member="importPath">
<xs:attribute name="required" type="xs:boolean" use="optional" default="true"/>
<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="type" type="xs:string" use="required"/>
<xs:attribute name="asStr" type="xs:boolean" use="optional" default="false"/>
</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:attribute name="scope" type="xs:string" use="optional"/> <!-- TODO make an enum -->
</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="ListEntry" type="ListEntryType"/>
<xs:element name="Import" type="ImportType" qxg:method="read_included_file"/>
</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 name="tr" type="xs:boolean" default="false" use="optional"/>
<xs:attribute name="trContext" type="xs:string" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="ListEntryType" qxg:declare="true">
<xs:complexContent>
<xs:extension base="EntryType">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="Init" type="xs:string"/>
</xs:sequence>
</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"/>
<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>