<?xml version="1.0" encoding="utf-8"?>
<!--
Cadence Design Systems 


(C) COPYRIGHT, Cadence Design Systems, Inc. 2013
All Rights Reserved
Licensed Materials - Property of Cadence Design Systems

No part of this file may be reproduced, stored in a retrieval system,
or transmitted in any form or by any means electronic, mechanical,
photocopying, recording, or otherwise without prior written permission
of Cadence Design Systems, Inc. 

WARRANTY:
Use all material in this file at your own risk.  Cadence Design Systems
makes no claims about any material contained in this file.
-->
<xs:schema
    targetNamespace="http://www.cadence.com/xsd/mcf"
    xmlns:l="http://www.cadence.com/xsd/mcf"
    elementFormDefault="qualified"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:cft="http://www.cadence.com/xsd/cft"
    >

  <xs:annotation>
    <xs:documentation xml:lang="en">
      Cadence Allegro Constraint Manager property dictionary schema.
      Copyright 2012 Cadence Design Systems LLC All rights reserved.
    </xs:documentation>
  </xs:annotation>

  <xs:include schemaLocation="common.xsd"/>
  <xs:include schemaLocation="UICommon.xsd"/>
  <xs:import namespace="http://www.cadence.com/xsd/cft" schemaLocation="cft.xsd"/>

  <xs:element name="root">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="cft:include" minOccurs="0" maxOccurs="unbounded"/>
        <xs:element name="enumMapping" minOccurs="0" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <xs:element ref="l:enum" minOccurs="1" maxOccurs="unbounded"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:group ref="l:CommonGrp"/>
        <xs:element name="Reuseables" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ReuseableDef" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:group ref="l:CommonGrp" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:choice minOccurs="1" maxOccurs="unbounded">
                      <xs:element ref="l:worksheet"/>
                      <xs:group ref="l:ColumnGrp"/>
                    </xs:choice>
                  </xs:sequence>
                  <xs:attribute name="id" use="required"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="l:domain"/>
      </xs:sequence>
    </xs:complexType>
    <xs:unique name="HelpTagKey">
      <xs:selector xpath="l:domain|l:objectType|.//l:workbook|.//l:worksheet"/>
      <xs:field xpath="@helpTag"/>
    </xs:unique>
    <xs:unique name="ReuseableID">
      <xs:selector xpath="./l:Reuseables/l:ReuseableDef"/>
      <xs:field xpath="@id"/>
    </xs:unique>
    <!-- // Serge 09.09.2014: VS is smart enough to handle it, but not xerces :(
        <xs:keyref name="ReuseableRefID" refer="l:ReuseableID">
            <xs:selector xpath=".//l:Reuseable"/>
            <xs:field xpath="@ref"/>
        </xs:keyref>-->
  </xs:element>

  <xs:element name="enum">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="v" minOccurs="1" maxOccurs="unbounded">
          <xs:complexType>
            <xs:attribute name="db" use="required">
              <xs:annotation>
                <xs:documentation>Internal database value (as spelled in the dictionary)</xs:documentation>
              </xs:annotation>
              <xs:simpleType>
                <xs:restriction base="xs:string">
                  <xs:pattern value="[A-Z_:]+"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:attribute>
            <xs:attribute name="ui" use="required" type="xs:string">
              <xs:annotation>
                <xs:documentation>String to be displayed for this value</xs:documentation>
              </xs:annotation>
            </xs:attribute>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="name" use="required" type="l:PropertyNamePattern"/>
    </xs:complexType>
  </xs:element>

  <xs:element name="tieringControl">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="l:tiering"/>
      </xs:sequence>
      <xs:attribute name="mode" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="editable"/>
            <xs:enumeration value="read-only"/>
            <xs:enumeration value="hidden"/>
            <xs:enumeration value="hideInBrowser"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
  <xs:attributeGroup name="CommonCfgAttrGrp">
    <xs:attribute name="hidden" type="l:HiddenEnum"/>
    <xs:attribute name="hideInBrowser" type="l:HideInBrowserEnum"/>
    <xs:attribute name="displayPriority" type="l:DisplayPriorityEnum"/>
    <xs:attributeGroup ref="l:env"/>
    <xs:attribute name="app" type="l:AppEnum"/>
  </xs:attributeGroup>
  <xs:attributeGroup name="CommonAttrGrp">
    <xs:attribute name="name" type="xs:string" use="required"/>
    <xs:attribute name="helpTag" type="xs:unsignedLong" use="required">
      <xs:annotation>
        <xs:documentation>Must be unique throughout the file! (schema will check). Please update comment in the top with the next available help tag</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="worksheetSync" type="l:SettingEnum"/>
    <xs:attribute name="fullRowSelection" type="l:bool"/>
    <xs:attribute name="alwaysShowChildren" type="l:bool"/>
    <xs:attribute name="mode" type="l:ModeEnum"/>
    <xs:attribute name="objectTypeDivider" type="l:bool"/>
    <xs:attribute name="ICsOnly" type="l:bool"/>
    <xs:attribute name="noGoToSource" type="l:bool"/>
    <xs:attributeGroup ref="l:CommonCfgAttrGrp"/>
  </xs:attributeGroup>

  <xs:group name="CommonGrp">
    <xs:sequence>
      <xs:element ref="l:tieringControl" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="generalSettings" minOccurs="0" type="l:GeneralSettingsListTp"/>        
      <xs:group ref="l:ObjectsGrp"/>
      <xs:element name="objTree" minOccurs="0" maxOccurs="1">
        <xs:complexType>
          <xs:sequence>
            <xs:element ref="l:obj" minOccurs="1" maxOccurs="unbounded"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element ref="l:disableRelationship" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element ref="l:subFilter" minOccurs="0" maxOccurs="unbounded"/>      
      <xs:group ref="l:ColumnGrp" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:group>
  <xs:group name="ColumnGrp">
    <xs:choice>
      <xs:element ref="l:columnHeader"/>
      <xs:element ref="l:column"/>
      <xs:element ref="l:Reuseable"/>
    </xs:choice>
  </xs:group>

  <xs:element name="Reuseable">
    <xs:complexType>
      <xs:attribute name="ref" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation>The ID of the ReusealbeDef element to be inserted here</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attributeGroup ref="l:env"/>
    </xs:complexType>
  </xs:element>

  <xs:element name="domain">
    <xs:complexType>
      <xs:sequence>
        <xs:group ref="l:CommonGrp"/>
        <xs:element ref="l:objectType" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attributeGroup ref="l:CommonAttrGrp"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="objectType">
    <xs:complexType>
      <xs:sequence>
        <xs:group ref="l:CommonGrp"/>
        <xs:element ref="l:workbook" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attributeGroup ref="l:CommonAttrGrp"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="workbook">
    <xs:complexType>
      <xs:sequence>
        <xs:group ref="l:CommonGrp"/>
        <xs:element ref="l:worksheet" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attributeGroup ref="l:CommonAttrGrp"/>
      <xs:attribute name="reverseGrid" type="l:bool"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="worksheet">
    <xs:complexType>
      <xs:sequence>
        <xs:group ref="l:CommonGrp"/>
      </xs:sequence>
      <xs:attributeGroup ref="l:CommonAttrGrp"/>
      <xs:attribute name="drvrRcvrOnly" type="l:bool"/>
      <xs:attribute name="reverseGrid" type="l:bool"/>
      <xs:attribute name="qtModel" type="l:UIModelKindEnum"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="columnHeader">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="l:tieringControl" minOccurs="0" maxOccurs="unbounded"/>
        <xs:choice maxOccurs="unbounded">
          <xs:group ref="l:ColumnGrp"/>
        </xs:choice>
      </xs:sequence>
      <xs:attribute name="name" type="xs:string" use="required" />
      <xs:attribute name="superAttribute" type="xs:string"/>
      <xs:attribute name="extTag" type="xs:unsignedInt"/>
      <xs:attribute name="height" type="xs:unsignedInt"/>
      <xs:attributeGroup ref="l:CommonCfgAttrGrp"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="column">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="l:tieringControl" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="name" type="xs:string" use="required" />
      <xs:attributeGroup ref="l:CommonCfgAttrGrp"/>
      <xs:attribute name="appColor" type="l:colorAllignment"/>
      <xs:attribute name="userColor" type="l:colorAllignment"/>
      <xs:attribute name="width" type="xs:unsignedByte" use="required"/>
      <xs:attribute name="initControl" type="l:InitCtrlEnum"/>
      <xs:attribute name="frozen" type="l:bool">
        <xs:annotation>
          <xs:documentation>Applicable to Qt grids only. If set, all columns UP TO THE LAST one marked as frozen will be frozen</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="controlType">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="CheckBox"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attributeGroup ref="l:CommonColumnAttrGrp"/>
      <xs:attribute name="dependsOn" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="subFilter">
    <xs:complexType>
      <xs:attribute name="id" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="Net:Nets of XNet"/>
            <xs:enumeration value="Net:Voltage"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="check" type="l:bool" use="required">
        <xs:annotation>
          <xs:documentation>The value of the checkBox corresponding to the node in subFilter control (in the UI)</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="enable" type="l:bool" use="optional">
        <xs:annotation>
          <xs:documentation>Specifies whether the checkBox corresponding to the node in subFilter control (in the UI) is enabled</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="if-retain-ecns-on-nets" use="optional" type="l:bool">
        <xs:annotation>
          <xs:documentation>if true, the sub-filter will only be present if retain ECns on nets config is set on the design</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attributeGroup ref="l:env"/>
    </xs:complexType>
  </xs:element>
    
  <xs:element name="disableRelationship">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="l:UIObjectListTp">
          <xs:attribute name="parent" type="l:UIObjectKindEnum" use="required" />
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
    
  <xs:element name="obj">
    <xs:annotation>
      <xs:documentation>Defines tree structure to be shown in Qt UI - can be combined with &lt;enableObjects&lt; - the </xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="l:obj" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="kind" type="l:UIObjectKindEnum"/>
      <xs:attribute name="type">
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:enumeration value="parent">
              <xs:annotation>
                <xs:documentation>optional - kinds that can have children (if not set will be determined automatically)</xs:documentation>
              </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="instanceParent">
              <xs:annotation>
                <xs:documentation>kinds serving as instance-parents - all decendants will be treated as instance objects and</xs:documentation>
              </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="leaf">
              <xs:annotation>
                <xs:documentation>optional - kinds that DO NOT have children (if not set will be determined automatically)</xs:documentation>
              </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="group">
              <xs:annotation>
                <xs:documentation>Pseudo-group - synthetic parent for the child objects - MUST have children</xs:documentation>
              </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="objDivider">
                <xs:annotation>
                    <xs:documentation>Group to represent object divider. It may be filtered-out</xs:documentation>
                </xs:annotation>
            </xs:enumeration>
            <xs:enumeration value="getAllChildObjects">
              <xs:annotation>
                <xs:documentation>kind that can have child kinds</xs:documentation>
              </xs:annotation>
            </xs:enumeration>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="name" type="xs:string">
        <xs:annotation>
          <xs:documentation>only used for groups</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="hide_if_empty" type="l:bool"/>
    </xs:complexType>
  </xs:element>

  <xs:simpleType name="SettingEnum">
    <xs:restriction base="xs:string">
      <xs:enumeration value="On"/>
      <xs:enumeration value="Off"/>
      <xs:enumeration value="AlwaysOff"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ModeEnum">
    <xs:restriction base="xs:string">
      <xs:enumeration value="implementation"/>
      <xs:enumeration value="exploration"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="InitCtrlEnum">
    <xs:restriction base="xs:string">
      <xs:enumeration value="inherited"/>
      <xs:enumeration value="ignore"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="AppEnum">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Schematic"/>
      <xs:enumeration value="Layout"/>
      <xs:enumeration value="Viewer"/>
      <xs:enumeration value="APD"/>
      <xs:enumeration value="SiP"/>
      <xs:enumeration value="Packaging">
        <xs:annotation>
          <xs:documentation>APD or SiP</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="None"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="DisplayPriorityEnum">
    <xs:restriction base="xs:string">
      <xs:enumeration value="AlwaysShow">
        <xs:annotation>
          <xs:documentation>The column (header) will always be shown, regardless whether its parent column header is expanded or collapsed</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="PrefereredShow">
        <xs:annotation>
          <xs:documentation>The column (header) will be shown, when its parent column header is expanded to the 1st or 2d state (show preferred and show all)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="AllShow">
        <xs:annotation>
          <xs:documentation>The column (header) will only be shown, when its parent column header is expanded to the last (2d - show all)</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="HiddenEnum">
    <xs:union memberTypes="l:bool l:AppEnum"/>
  </xs:simpleType>
  <xs:simpleType name="HideInBrowserEnum">
    <xs:union memberTypes="l:bool l:AppEnum"/>
  </xs:simpleType>
  <xs:simpleType name="colorAllignment">
    <xs:restriction base="xs:string">
      <xs:enumeration value="Left"/>
      <xs:enumeration value="Right"/>
    </xs:restriction>
  </xs:simpleType>
</xs:schema>
