<?xml version="1.0" encoding="GB2312"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cafx="http://www.cffex.com.cn/tech/cafx/xsd">
    <xs:import namespace="http://www.cffex.com.cn/tech/cafx/xsd" schemaLocation="CommonTypes.xsd"/>
    <xs:element name="views">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="view" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="version" type="cafx:FrameworkVersion" use="required"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="view">
        <xs:annotation>
            <xs:documentation>数据展示视图设置。</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:choice>
                    <xs:element ref="view.Grid"/>
                    <xs:element ref="view.Chart"/>
                    <xs:element ref="view.PivotGrid"/>
                    <xs:element ref="view.Tree"/>
                </xs:choice>
            </xs:sequence>
            <xs:attribute name="type" use="required">
                <xs:annotation>
                    <xs:documentation>视图的类型。</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="Grid"/>
                        <xs:enumeration value="Chart"/>
                        <xs:enumeration value="PivotGrid"/>
                        <xs:enumeration value="Tree"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="name" type="xs:string" use="required">
                <xs:annotation>
                    <xs:documentation>视图的名称。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="autoInvokeRelativeQuery">
                <xs:annotation>
                    <xs:documentation>是否在双击时自动展开关联查询。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
    <xs:element name="view.Grid">
        <xs:annotation>
            <xs:documentation>Grid 视图</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="column" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="showGroupByBox" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation>是否显示分组框。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="fontName" type="xs:string">
                <xs:annotation>
                    <xs:documentation>单元格字体名称。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="fontSize" type="xs:integer">
                <xs:annotation>
                    <xs:documentation>单元格字号。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="showIndicator" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation>是否显示左侧的当前行指示器。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="autoColumnFit" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation>是否根据单元格内容自动设置列宽。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="showFilterRow" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation>是否显示过滤行。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="showCheckColumn" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation>是否显示复选列。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="showToolbars" type="xs:boolean"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="column">
        <xs:annotation>
            <xs:documentation>Grid 视图的列配置</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attribute name="name" type="xs:string" use="required">
                <xs:annotation>
                    <xs:documentation>列的显示名称。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="field" type="xs:string" use="required">
                <xs:annotation>
                    <xs:documentation>列对应的游标字段名，或绑定数据集的列名。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="type" type="ValueType" use="required"/>
            <xs:attribute name="control" type="xs:string"/>
            <xs:attribute name="align" type="HorizontalAlign"/>
            <xs:attribute name="foreColor" type="Color"/>
            <xs:attribute name="backColor" type="Color"/>
            <xs:attribute name="width" type="xs:integer"/>
            <xs:attribute name="summaryType" type="SummaryType"/>
            <xs:attribute name="groupSummaryType" type="SummaryType"/>
            <xs:attribute name="format" type="xs:string"/>
            <xs:attribute name="sort" type="xs:string"/>
            <xs:attribute name="dictId" type="xs:short"/>
            <xs:attribute name="fixedStyle" type="HorizontalAlign"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="view.Chart">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="series" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="series">
        <xs:complexType>
            <xs:attribute name="name" use="required">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="曲线1"/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="dataSourceName" use="required">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value=""/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="color" use="required">
                <xs:simpleType>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value=""/>
                    </xs:restriction>
                </xs:simpleType>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
    <xs:element name="view.PivotGrid">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="dataArea"/>
                <xs:element ref="rowArea"/>
                <xs:element ref="columnArea"/>
                <xs:element ref="filterArea"/>
            </xs:sequence>
            <xs:attribute name="design" type="xs:boolean" use="required"/>
            <xs:attribute name="defaultView" type="xs:string" use="required"/>
            <xs:attribute name="showColumnHeaders" type="xs:boolean"/>
            <xs:attribute name="showDataHeaders" type="xs:boolean"/>
            <xs:attribute name="showFilterHeaders" type="xs:boolean"/>
            <xs:attribute name="showColumnGrandTotalHeader" type="xs:boolean"/>
            <xs:attribute name="showRowGrandTotalHeader" type="xs:boolean"/>
            <xs:attribute name="showGrandTotalsForSingleValues" type="xs:boolean"/>
            <xs:attribute name="showTotalsForSingleValues" type="xs:boolean"/>
            <xs:attribute name="showColumnGrandTotals" type="xs:boolean"/>
            <xs:attribute name="showColumnTotals" type="xs:boolean"/>
            <xs:attribute name="showRowTotals" type="xs:boolean"/>
            <xs:attribute name="showRowGrandTotals" type="xs:boolean"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="dataArea">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="dataItem" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="dataItem">
        <xs:complexType>
            <xs:attribute name="name" type="xs:string" use="required"/>
            <xs:attribute name="field" type="xs:string" use="required"/>
            <xs:attribute name="summaryType" type="SummaryType"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="rowArea">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="rowItem" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="rowItem">
        <xs:complexType>
            <xs:attribute name="name" type="xs:string" use="required"/>
            <xs:attribute name="field" type="xs:string" use="required"/>
            <xs:attribute name="orderItem" type="xs:string"/>
            <xs:attribute name="filters" type="xs:string"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="columnArea">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="columnItem" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="columnItem">
        <xs:complexType>
            <xs:attribute name="name" type="xs:string" use="required"/>
            <xs:attribute name="field" type="xs:string" use="required"/>
            <xs:attribute name="orderItem" type="xs:string"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="filterArea">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="filterItem" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:element name="filterItem">
        <xs:complexType>
            <xs:attribute name="name" type="xs:string" use="required"/>
            <xs:attribute name="field" type="xs:string" use="required"/>
            <xs:attribute name="orderItem" type="xs:string"/>
            <xs:attribute name="filters" type="xs:string"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="view.Tree">
        <xs:annotation>
            <xs:documentation>Tree 视图</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="treeColumn" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="keyFieldName" type="xs:string"/>
            <xs:attribute name="parentFieldName" type="xs:string"/>
            <xs:attribute name="fontName" type="xs:string">
                <xs:annotation>
                    <xs:documentation>单元格字体名称。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="fontSize" type="xs:integer">
                <xs:annotation>
                    <xs:documentation>单元格字号。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="showIndicator" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation>是否显示左侧的当前行指示器。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="autoColumnFit" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation>是否根据单元格内容自动设置列宽。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="showFilterRow" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation>是否显示过滤行。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="showCheckBoxes" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation>是否显示复选框。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
    <xs:element name="treeColumn">
        <xs:annotation>
            <xs:documentation>Tree 视图的列配置</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attribute name="name" type="xs:string" use="required">
                <xs:annotation>
                    <xs:documentation>列的显示名称。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="field" type="xs:string" use="required">
                <xs:annotation>
                    <xs:documentation>列对应的游标字段名，或绑定数据集的列名。</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="type" type="ValueType" use="required"/>
            <xs:attribute name="control" type="xs:string"/>
            <xs:attribute name="align" type="HorizontalAlign"/>
            <xs:attribute name="foreColor" type="Color"/>
            <xs:attribute name="backColor" type="Color"/>
            <xs:attribute name="width" type="xs:integer"/>
            <xs:attribute name="format" type="xs:string"/>
            <xs:attribute name="sort" type="xs:string"/>
            <xs:attribute name="dictId" type="xs:short"/>
            <xs:attribute name="fixedStyle" type="HorizontalAlign"/>
            <xs:attribute name="allowFilter" type="xs:boolean"/>
        </xs:complexType>
    </xs:element>
    <xs:element name="help"/>
    <xs:simpleType name="ValueType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="string"/>
            <xs:enumeration value="int"/>
            <xs:enumeration value="int64"/>
            <xs:enumeration value="double"/>
            <xs:enumeration value="decimal"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="Color">
        <xs:restriction base="xs:string">
            <xs:enumeration value="white"/>
            <xs:enumeration value="red"/>
            <xs:enumeration value="green"/>
            <xs:enumeration value="blue"/>
            <xs:enumeration value="yellow"/>
            <xs:enumeration value="pink"/>
            <xs:enumeration value="aqua"/>
            <xs:enumeration value="black"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="SummaryType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="sum"/>
            <xs:enumeration value="average"/>
            <xs:enumeration value="count"/>
            <xs:enumeration value="min"/>
            <xs:enumeration value="max"/>
            <xs:enumeration value="distinct"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="HorizontalAlign">
        <xs:restriction base="xs:string">
            <xs:enumeration value="left"/>
            <xs:enumeration value="center"/>
            <xs:enumeration value="right"/>
        </xs:restriction>
    </xs:simpleType>
</xs:schema>
