<?xml version="1.0" encoding="utf-8"?>
<xs:schema
		targetNamespace="http://www.abbyy.com/Protection/LicensingSettings"
		elementFormDefault="qualified"
		xmlns="http://www.abbyy.com/Protection/LicensingSettings"
		xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
	<!-- ABBYY boolean type -->
	<xs:simpleType name="TBool" >
		<xs:restriction base="xs:string" >
			<xs:enumeration value="yes" />
			<xs:enumeration value="no" />
			<xs:enumeration value="true" />
			<xs:enumeration value="false" />
			<xs:enumeration value="on" />
			<xs:enumeration value="off" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Format of acceptable server's name -->
	<xs:simpleType name="TServerName">
		<xs:restriction base="xs:string" />
	</xs:simpleType>

	<!-- Available network protocols -->
	<xs:simpleType name="TRPCProtocolType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="LocalInterprocessCommunication" />
			<xs:enumeration value="NamedPipes" />
			<xs:enumeration value="TCP/IP" />
			<xs:enumeration value="Sockets" />
		</xs:restriction>
	</xs:simpleType>

	<!-- Connection parameters -->
	<xs:complexType name="CConnectionProtocol">
		<xs:attribute name="ProtocolType" type="TRPCProtocolType" use="required" />
		<xs:attribute name="EndPointName" type="xs:string" use="optional" />
	</xs:complexType>

	<!-- Remote licensing server connection parameters -->
	<xs:complexType name="CNetworkServerAddress">
		<xs:complexContent>
			<xs:extension base="CConnectionProtocol">
				<xs:attribute name="ServerAddress" type="TServerName" />
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<!-- Licensing servers list configuration -->
	<xs:complexType name="CLicensingServers">
		<xs:sequence>
			<xs:element name="MainNetworkLicenseServer" type="CNetworkServerAddress" minOccurs="1" maxOccurs="unbounded" />
			<xs:element name="BackupNetworkLicenseServer" type="CNetworkServerAddress" minOccurs="0" maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<!-- Licensing server settings -->
	<xs:complexType name="CLocalLicenseServerSettings">
		<xs:sequence>
			<xs:element name="ConnectionProtocol" type="CConnectionProtocol" minOccurs="0" />
			<xs:element name="EnableIKeyLicenses" minOccurs="0">
				<xs:complexType>
					<xs:attribute name="Enable" type="TBool" use="required" />
				</xs:complexType>
			</xs:element>
			<xs:element name="EnableCodeMeterLicenses" minOccurs="0">
				<xs:complexType>
					<xs:attribute name="Enable" type="TBool" use="required" />
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>

	<!-- Inproc licenses folder path -->
	<xs:complexType name="CInprocLicensesFolderPath">
		<xs:attribute name="Path" type="xs:string" use="required" />
		<xs:attribute name="IsRelative" type="TBool" default="no" />
	</xs:complexType>

	<!-- Inproc licenses extnesion -->
	<xs:complexType name="CInprocLicensesExtension">
		<xs:attribute name="Value" type="xs:string" use="required" />
	</xs:complexType>

	<!--Path to schema-->
	<xs:complexType name="CPathToSchema">
		<xs:attribute name="Path" type="xs:string" use="required" />
	</xs:complexType>

	<!--Establish connection on init-->
	<xs:complexType name="CEstablishConnectionOnInit">
		<xs:attribute name="Value" type="TBool" use="required" />
	</xs:complexType>

	<!-- Licensing configuration -->
	<xs:complexType name="TLicensingSettings">
		<xs:sequence minOccurs="0">
			<!-- Parameters of a local license server -->
			<xs:element name="LocalLicenseServer" type="CLocalLicenseServerSettings" minOccurs="0" />
			<xs:element name="OverrideInprocLicensesPath" type="CInprocLicensesFolderPath" minOccurs="0" />
			<xs:element name="OverrideInprocLicensesExtension" type="CInprocLicensesExtension" minOccurs="0" />
			<xs:element name="OverrideLicensingSchemaPath" type="CPathToSchema" minOccurs="0" />
			<xs:element name="OverrideProductLicensingSchemaPath" type="CPathToSchema" minOccurs="0" />
			<xs:element name="EstablishConnectionOnInit" type="CEstablishConnectionOnInit" minOccurs="0" />
			<xs:choice minOccurs="0">
				<xs:element name="DisableLicensingServers" fixed="" />
				<xs:element name="LicensingServers" type="CLicensingServers" />
			</xs:choice>
		</xs:sequence>
	</xs:complexType>

	<!-- Root element -->
	<xs:element name="LicensingSettings" type="TLicensingSettings" />
</xs:schema>
