<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="http://www.monodevelop.com/add-in"
           xmlns="http://www.monodevelop.com/add-in"
           elementFormDefault="qualified">
           	
	<xs:annotation>
		<xs:documentation>
			Schema for MonoDevelop add-in configuration files.
		</xs:documentation>
	</xs:annotation>
	
	<xs:complexType name="AddIn">
		<xs:choice maxOccurs="unbounded">
			<xs:element ref="Dependencies" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element ref="Runtime" minOccurs="0" maxOccurs="unbounded"/>
		</xs:choice>
		<xs:attribute name="id" type="xs:string" use="required"/>
		<xs:attribute name="name" type="xs:string"/>
		<xs:attribute name="author" type="xs:string"/>
		<xs:attribute name="copyright" type="xs:string"/>
		<xs:attribute name="url" type="xs:anyURI"/>
		<xs:attribute name="description" type="xs:string"/>
		<xs:attribute name="version" type="xs:string"/>
	</xs:complexType>
	<xs:element name="AddIn" type="AddIn"/>
	
	<xs:complexType name="Import">
		<xs:attribute name="assembly" type="xs:string" use="required"/>
	</xs:complexType>
	<xs:element name="Import" type="Import"/>

	<xs:complexType name="Runtime">
		<xs:sequence>
			<xs:element ref="Import" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:element name="Runtime" type="Runtime"/>
	
	<xs:complexType name="Dependencies">
		<xs:sequence>
			<xs:element ref="AddIn" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element ref="Assembly" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:element name="Dependencies" type="Dependencies"/>
	
	<xs:complexType name="Assembly">
		<xs:attribute name="name" type="xs:string" use="required"/>
	</xs:complexType>
	<xs:element name="Assembly" type="Assembly"/>
	
	<xs:complexType name="Extension" mixed="true">
		<xs:choice minOccurs="0" maxOccurs="unbounded">
			<xs:element ref="Class"/>
			<xs:element ref="Command"/>
			<xs:element ref="Conditional"/>
			<xs:element ref="DialogPanel"/>
			<xs:element ref="DisplayBinding"/>
			<xs:element ref="EditAction"/>
			<xs:element ref="ExecutionHandler"/>
			<xs:element ref="FileFilter"/>
			<xs:element ref="FileTemplate"/>
			<xs:element ref="FileTemplateType"/>
			<xs:element ref="Icon"/>
			<xs:element ref="ItemProperty"/>
			<xs:element ref="ItemSet"/>
			<xs:element ref="LanguageBinding"/>
			<xs:element ref="LocalCommandItem"/>
			<xs:element ref="Pad"/>
			<xs:element ref="ProjectBinding"/>
			<xs:element ref="ProjectTemplate"/>
			<xs:element ref="SolutionPad"/>
			<xs:element ref="StockIcon"/>
			<xs:element ref="WorkbenchContext"/>
		</xs:choice>
		<xs:attribute name="path" type="xs:string" use="required"/>
	</xs:complexType>
	<xs:element name="Extension" type="Extension"/>
	
	<xs:complexType name="Command">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="defaultHandler" use="optional"/>
				<xs:attribute name="_label" use="optional"/>
				<xs:attribute name="description" use="optional"/>
				<xs:attribute name="_description" use="optional"/>
				<xs:attribute name="icon" use="optional"/>
				<xs:attribute name="shortcut" use="optional"/>
				<xs:attribute name="disabledVisible" type="xs:boolean" use="optional"/>
				<xs:attribute name="type" use="optional"/>
				<xs:attribute name="widget" use="optional"/>		
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="Command" type="Command"/>
	
	<xs:complexType name="AbstractCodon" abstract="true">
		<xs:attribute name="id" type="xs:string" use="required"/>
		<xs:attribute name="class" type="xs:string" use="optional"/>
		<xs:attribute name="insertbefore" type="xs:string" use="optional"/>
		<xs:attribute name="insertafter" type="xs:string" use="optional"/>
	</xs:complexType>
	<xs:complexType name="Class">
		<xs:complexContent>
			<xs:extension base="AbstractCodon"/>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="Class" type="Class"/>
	
	<xs:complexType name="ItemSet">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:choice minOccurs="0" maxOccurs="unbounded">
					<xs:element ref="CommandItem"/>
					<xs:element ref="SeparatorItem"/>
					<xs:element ref="ItemSet"/>
					<xs:element ref="LinkItem"/>
				</xs:choice>
				<xs:attribute name="_label" use="optional"/>
				<xs:attribute name="icon" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="ItemSet" type="ItemSet"/>
	
	<xs:complexType name="CommandItem">
		<xs:complexContent>
			<xs:extension base="AbstractCodon"/>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="CommandItem" type="CommandItem"/>
	
	<xs:complexType name="SeparatorItem">
		<xs:complexContent>
			<xs:extension base="AbstractCodon"/>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="SeparatorItem" type="SeparatorItem"/>
	
	<xs:complexType name="LinkItem">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="link" use="optional"/>
				<xs:attribute name="_label" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="LinkItem" type="LinkItem"/>

	<xs:complexType name="StockIcon">
		<xs:attribute name="stockid" use="required"/>
		<xs:attribute name="resource" use="optional"/>
		<xs:attribute name="size" use="optional"/>
	</xs:complexType>
	<xs:element name="StockIcon" type="StockIcon"/>
	
	<xs:complexType name="ExecutionHandler">
		<xs:attribute name="id" use="required"/>
		<xs:attribute name="platform" use="required">
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:enumeration value="Mono"/>
					<xs:enumeration value="Mint"/>
					<xs:enumeration value="Native"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
		<xs:attribute name="class" use="required"/>
	</xs:complexType>
	<xs:element name="ExecutionHandler" type="ExecutionHandler"/>
	
	<xs:complexType name="DialogPanel">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:choice minOccurs="0" maxOccurs="unbounded">
					<xs:element ref="Conditional"/>
					<xs:element ref="DialogPanel"/>
					<xs:element ref="Condition"/>
				</xs:choice>
				<xs:attribute name="_label" type="xs:string" use="required"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="DialogPanel" type="DialogPanel"/>
	
	<xs:complexType name="DisplayBinding">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="supportedformats" type="xs:string" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="DisplayBinding" type="DisplayBinding"/>
	
	<xs:complexType name="Pad">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="context" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="Pad" type="Pad"/>
	
	<xs:complexType name="SolutionPad">
		<xs:complexContent>
			<xs:extension base="Pad">
				<xs:choice minOccurs="0" maxOccurs="unbounded">
					<xs:element ref="PadOption"/>
					<xs:element ref="NodeBuilder"/>
				</xs:choice>
				<xs:attribute name="defaultPlacement" use="optional"/>
				<xs:attribute name="_label" use="optional"/>
				<xs:attribute name="icon" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="SolutionPad" type="SolutionPad"/>
	
	<xs:complexType name="PadOption">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="defaultValue" use="optional"/>
				<xs:attribute name="_label" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="PadOption" type="PadOption"/>

	<xs:complexType name="NodeBuilder">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="NodeBuilder" type="NodeBuilder"/>
	
	<xs:complexType name="WorkbenchContext">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:sequence minOccurs="0" maxOccurs="unbounded">
					<xs:element ref="ContextPad"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="WorkbenchContext" type="WorkbenchContext"/>
	
	<xs:complexType name="ContextPad">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="defaultVisible" type="xs:boolean" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="ContextPad" type="ContextPad"/>

	<xs:complexType name="FileFilter">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="name" use="required"/>
				<xs:attribute name="extensions" use="required"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="FileFilter" type="FileFilter"/>

	<xs:complexType name="LocalCommandItem">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="_label" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="LocalCommandItem" type="LocalCommandItem"/>

	<xs:complexType name="FileTemplate">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="resource" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="FileTemplate" type="FileTemplate"/>

	<xs:complexType name="FileTemplateType">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="name" use="required"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="FileTemplateType" type="FileTemplateType"/>
	
	<xs:complexType name="ProjectTemplate">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="resource" use="required"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="ProjectTemplate" type="ProjectTemplate"/>

	<xs:complexType name="ProjectBinding">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="ProjectBinding" type="ProjectBinding"/>

	<xs:complexType name="EditAction">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="keys" use="required"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="EditAction" type="EditAction"/>
	
	<xs:complexType name="LanguageBinding">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="supportedextensions" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="LanguageBinding" type="LanguageBinding"/>
	
	<xs:complexType name="Icon">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="location" use="optional"/>
				<xs:attribute name="language" use="optional"/>
				<xs:attribute name="resource" use="optional"/>
				<xs:attribute name="extensions" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="Icon" type="Icon"/>
	
	<xs:complexType abstract="true" name="AbstractCondition">
		<xs:attribute name="action" use="optional">
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:enumeration value="Exclude"/>
					<xs:enumeration value="Disable"/>
					<xs:enumeration value="Nothing"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:complexType>
	
	<xs:complexType name="Condition">
		<xs:complexContent>
			<xs:extension base="AbstractCondition">
				<xs:attribute name="activelanguage" type="xs:string" use="optional"/>
				<xs:attribute name="activewindow" type="xs:string" use="optional"/>
				<xs:attribute name="context" type="xs:string" use="optional"/>
				<xs:attribute name="openwindow" type="xs:string" use="optional"/>
				<xs:attribute name="iscombineopen" type="xs:string" use="optional"/>
				<xs:attribute name="activeproject" type="xs:string" use="optional"/>
				<xs:attribute name="openproject" type="xs:string" use="optional"/>
				<xs:attribute name="textcontent" type="xs:string" use="optional"/>
				<xs:attribute name="ownerstate" type="xs:string" use="optional"/>
				<xs:attribute name="string" type="xs:string" use="optional"/>
				<xs:attribute name="equals" type="xs:string" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="Condition" type="Condition"/>
	
	<xs:complexType name="Conditional">
		<xs:complexContent>
			<xs:extension base="Condition">
				<xs:choice maxOccurs="unbounded">
					<xs:element ref="Condition"/>
					<xs:element ref="Conditional"/>
					<xs:element ref="And"/>
					<xs:element ref="Or"/>
					<xs:element ref="Not"/>
					<xs:element ref="Class"/>
					<xs:element ref="DialogPanel"/>
					<xs:element ref="DisplayBinding"/>
					<xs:element ref="LanguageBinding"/>
					<xs:element ref="ToolbarItem"/>
				</xs:choice>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="Conditional" type="Conditional"/>
	
	<xs:complexType name="Not">
		<xs:choice>
			<xs:element ref="Condition"/>
			<xs:element ref="And"/>
			<xs:element ref="Not"/>
			<xs:element ref="Or"/>
		</xs:choice>
	</xs:complexType>
	<xs:element name="Not" type="Not"/>
	
	<xs:complexType name="And">
		<xs:choice minOccurs="2" maxOccurs="unbounded">
			<xs:element ref="Not"/>
			<xs:element ref="Or"/>
			<xs:element ref="And"/>
			<xs:element ref="Condition"/>
		</xs:choice>
	</xs:complexType>
	<xs:element name="And" type="And"/>
	
	<xs:complexType name="Or">
		<xs:choice minOccurs="2" maxOccurs="unbounded">
			<xs:element ref="Not"/>
			<xs:element ref="Or"/>
			<xs:element ref="And"/>
			<xs:element ref="Condition"/>
		</xs:choice>
	</xs:complexType>
	<xs:element name="Or" type="Or"/>
	
	<xs:complexType name="ToolbarItem">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="icon" use="optional"/>
				<xs:attribute name="_tooltip" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="ToolbarItem" type="ToolbarItem"/>
	
	<xs:complexType name="ItemProperty">
		<xs:complexContent>
			<xs:extension base="AbstractCodon">
				<xs:attribute name="type" use="optional"/>
				<xs:attribute name="name" use="optional"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:element name="ItemProperty" type="ItemProperty"/>
</xs:schema>
