<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="schema2xhtml.xsl" type="text/xsl"?>

<!-- Schema for JMRI programmer definitions       -->

<!-- $Id: programmer.xsd 18975 2011-10-28 03:38:21Z jacobsen $ -->

<!-- This schema is part of JMRI. Copyright 2009, 2010.                     -->
<!--                                                                        -->
<!-- JMRI is free software; you can redistribute it and/or modify it under  -->
<!-- the terms of version 2 of the GNU General Public License as published  -->
<!-- by the Free Software Foundation. See the "COPYING" file for a copy     -->
<!-- of this license.                                                       -->
<!--                                                                        -->
<!-- JMRI is distributed in the hope that it will be useful, but WITHOUT    -->
<!-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or  -->
<!-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License  -->
<!-- for more details.                                                      -->


    <!-- need variable -->
    
    <!-- not yet in proper Venetian blind form -->
    <!-- needs to share the pane type with programmer definition -->
    
    <!-- need documentation, etc -->

    <!-- need attribute restrictions -->
    <!-- need attribute defaults -->
    
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:docbook="http://docbook.org/ns/docbook"
           xmlns:jmri="http://jmri.org/xml/schema/JMRIschema"
           xsi:schemaLocation="
                http://jmri.org/xml/schema/JMRIschema http://jmri.org/xml/schema/JMRIschema.xsd
                http://docbook.org/ns/docbook http://jmri.org/xml/schema/docbook/DocBook.xsd
            "
        >

    <xs:include schemaLocation="http://jmri.org/xml/schema/types/general.xsd"/>
    <xs:import namespace='http://docbook.org/ns/docbook' schemaLocation='http://jmri.org/xml/schema/docbook/DocBook.xsd'/>

<xs:annotation>
    <xs:documentation>
      Defines the JMRI programmer definition files.
    </xs:documentation>
    <xs:appinfo>
        <jmri:usingclass configurexml="false">jmri.jmrit.decoderdefn.DecoderFile</jmri:usingclass>
        <jmri:usingclass configurexml="false">jmri.jmrit.symbolicprog.VariableTableModel</jmri:usingclass>
    </xs:appinfo>
</xs:annotation>

  <xs:complexType name="VersionType">
      <xs:attribute name="author" type="xs:string" />
      <xs:attribute name="version" type="xs:string" />
      <xs:attribute name="lastUpdated" type="xs:string" />
  </xs:complexType>

  <xs:complexType name="ProgrammerType">
    <xs:sequence>

      <xs:element name="pane" type="PaneType" minOccurs="0" maxOccurs="unbounded" />

    </xs:sequence>
    <xs:attribute name="decoderFilePanes"  type="yesNoType" default="yes"/>
    <xs:attribute name="showEmptyPanes"  type="yesNoDefaultType" default="default"/>
    <xs:attribute name="showFnLanelPane"  type="yesNoType" default="no"/>
    <xs:attribute name="showRosterMediaPane"  type="yesNoType" default="no"/>
  </xs:complexType>

  <xs:element name="programmer-config">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="version" type="VersionType" minOccurs="0" maxOccurs="unbounded" />
        <xs:element name="programmer" type="ProgrammerType" minOccurs="1" maxOccurs="1"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>


  <xs:complexType name="PaneType">
    <xs:sequence>
      <xs:element name="name" minOccurs="0" maxOccurs="unbounded" />
      <xs:choice>
        <xs:element name="row" type="PaneRowType" minOccurs="0" maxOccurs="unbounded" />
        <xs:element name="column" type="PaneColumnType" minOccurs="0" maxOccurs="unbounded"/>
      </xs:choice>
    </xs:sequence>
    <xs:attribute name="name" type="xs:string"/>
    <xs:attribute name="nameFmt" type="xs:string"/>
  </xs:complexType>
  <xs:complexType name="PaneRowType">
    <xs:sequence minOccurs="1" maxOccurs="unbounded">
      <xs:element name="column" type="PaneColumnType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="label" type="LabelType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="display" type="DisplayType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="separator" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="dccaddress" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="fnmapping" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="cvtable" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="indxcvtable" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="PaneColumnType">
    <xs:sequence minOccurs="1" maxOccurs="unbounded">
      <xs:element name="row" type="PaneRowType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="label" type="LabelType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="display" type="DisplayType" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="separator" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="dccaddress" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="fnmapping" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="cvtable" minOccurs="0" maxOccurs="unbounded" />
      <xs:element name="indxcvtable" minOccurs="0" maxOccurs="unbounded" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="LabelType">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
      <xs:element name="label" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation><xs:documentation>Provide internationalized label text</xs:documentation></xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="label" type="xs:string"/>
  </xs:complexType>
  <xs:complexType name="DisplayType">
    <xs:sequence minOccurs="0" maxOccurs="unbounded">
      <xs:element name="label" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation><xs:documentation>Provide internationalized label text</xs:documentation></xs:annotation>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="item" type="xs:string"/>
    <xs:attribute name="label" type="xs:string"/>
    <xs:attribute name="format" type="xs:string"/>
    <xs:attribute name="layout" type="xs:string"/>
    <xs:attribute name="tooltip" type="xs:string"/>
  </xs:complexType>

</xs:schema>

