<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

	<xs:simpleType name="LanguageId">
		<xs:restriction base="xs:string">
			<xs:pattern value="[A-Z]{2}" />
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="IconTypes">
		<xs:restriction base="xs:NCName">
			<xs:enumeration value="material" />
			<xs:enumeration value="intern" />
			<xs:enumeration value="byImage" />
		</xs:restriction>
	</xs:simpleType>

	<xs:element name="F4SD-MenuSection-Configuration">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="Sections" minOccurs="1" maxOccurs="unbounded" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="Sections">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="Section" minOccurs="0" maxOccurs="unbounded" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="Section">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="Name" minOccurs="0" maxOccurs="unbounded" />
				<xs:element ref="Description" minOccurs="0" maxOccurs="unbounded" />
				<xs:element ref="Icon" minOccurs="0" maxOccurs="1" />
			</xs:sequence>
			
			<xs:attribute name="TechName" type="xs:NCName" use="required" />
			<xs:attribute name="Name" type="xs:string" use="optional" />
			<xs:attribute name="Title" type="xs:string" use="optional" />
			<xs:attribute name="Description" type="xs:string" use="optional" />
      <!-- visibility controlling attributes -->
      <xs:attribute name="Hidden" type="xs:boolean" use="optional" default="false"/>
      <xs:attribute name="IsVisibleByParameter" type="xs:string" use="optional" />
      <xs:attribute name="RequiredRoles" use="optional">
        <xs:simpleType>
          <xs:list itemType="xs:NCName" />
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
	</xs:element>

	<xs:complexType name="MultiLanguageEntry">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="Lang" type="LanguageId" use="required"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:element name="Name">
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="MultiLanguageEntry" />
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>

	<xs:element name="Description">
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="MultiLanguageEntry" />
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>

	<xs:element name="Icon">
		<xs:complexType>
			<xs:attribute name="Name" type="xs:NCName" use="required" />
			<xs:attribute name="IconType" type="IconTypes" use="required" />
		</xs:complexType>
	</xs:element>

</xs:schema>
