ui-layout-def.xsd 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  3. targetNamespace="ui-layout-definition"
  4. xmlns:tns="ui-layout-definition"
  5. xmlns:patterns="ui-layout-patterns"
  6. xmlns:views="ui-layout-views"
  7. xmlns:validation="ui-layout-validation"
  8. xmlns:basic="ui-layout-basic-controls"
  9. xmlns:winforms="ui-layout-winforms-controls"
  10. xmlns:avalonia="ui-layout-avalonia-controls"
  11. elementFormDefault="qualified"
  12. version="1.3">
  13. <!-- Import external schemas -->
  14. <xs:import namespace="ui-layout-patterns" schemaLocation="ui-layout-patterns.xsd"/>
  15. <xs:import namespace="ui-layout-views" schemaLocation="ui-layout-views.xsd"/>
  16. <xs:import namespace="ui-layout-validation" schemaLocation="ui-layout-validation.xsd"/>
  17. <xs:import namespace="ui-layout-basic-controls" schemaLocation="ui-layout-basic-controls.xsd"/>
  18. <xs:import namespace="ui-layout-winforms-controls" schemaLocation="ui-layout-winforms-controls.xsd"/>
  19. <xs:import namespace="ui-layout-avalonia-controls" schemaLocation="ui-layout-avalonia-controls.xsd"/>
  20. <!-- Root element -->
  21. <xs:element name="ui-layout-def" type="tns:UILayoutDefType"/>
  22. <!-- Root element for window include files -->
  23. <xs:element name="windows" type="tns:WindowIncludeFileType"/>
  24. <!-- Main document structure -->
  25. <xs:complexType name="UILayoutDefType">
  26. <xs:sequence>
  27. <xs:element name="validation-rules" type="tns:ValidationRulesType" minOccurs="0"/>
  28. <xs:element name="patterns" type="tns:PatternsType"/>
  29. <xs:element name="views" type="tns:ViewsType" minOccurs="0"/>
  30. <xs:element name="window-includes" type="tns:WindowIncludesType" minOccurs="0"/>
  31. <xs:element name="window" type="tns:WindowType" minOccurs="0" maxOccurs="unbounded"/>
  32. </xs:sequence>
  33. <xs:attribute name="version" type="xs:string" default="1.2"/>
  34. <!-- ENHANCEMENT: Version compatibility attributes -->
  35. <xs:attribute name="schema-version" type="xs:string" fixed="1.2"/>
  36. <xs:attribute name="min-version" type="xs:string" default="1.0"/>
  37. <xs:attribute name="max-version" type="xs:string" default="2.0"/>
  38. <xs:attribute name="target-platform" type="tns:PlatformEnum" default="basic"/>
  39. <!-- ENHANCEMENT: Accessibility compliance level -->
  40. <xs:attribute name="accessibility-compliance" type="tns:AccessibilityLevelEnum" default="basic"/>
  41. </xs:complexType>
  42. <!-- Platform Enumeration -->
  43. <xs:simpleType name="PlatformEnum">
  44. <xs:restriction base="xs:string">
  45. <xs:enumeration value="basic"/>
  46. <xs:enumeration value="winforms"/>
  47. <xs:enumeration value="avalonia"/>
  48. <xs:enumeration value="kde"/>
  49. <xs:enumeration value="web"/>
  50. <xs:enumeration value="mobile"/>
  51. <xs:enumeration value="mixed"/>
  52. </xs:restriction>
  53. </xs:simpleType>
  54. <!-- ENHANCEMENT: Accessibility Level Enumeration -->
  55. <xs:simpleType name="AccessibilityLevelEnum">
  56. <xs:restriction base="xs:string">
  57. <xs:enumeration value="none"/>
  58. <xs:enumeration value="basic"/>
  59. <xs:enumeration value="wcag-a"/>
  60. <xs:enumeration value="wcag-aa"/>
  61. <xs:enumeration value="wcag-aaa"/>
  62. <xs:enumeration value="section-508"/>
  63. </xs:restriction>
  64. </xs:simpleType>
  65. <!-- Window Include Files Structure -->
  66. <xs:complexType name="WindowIncludeFileType">
  67. <xs:sequence>
  68. <xs:element name="window" type="tns:WindowType" maxOccurs="unbounded"/>
  69. </xs:sequence>
  70. <xs:attribute name="target-platform" type="tns:PlatformEnum" default="basic"/>
  71. <!-- ENHANCEMENT: Version tracking for include files -->
  72. <xs:attribute name="schema-version" type="xs:string" default="1.2"/>
  73. </xs:complexType>
  74. <!-- Window Includes -->
  75. <xs:complexType name="WindowIncludesType">
  76. <xs:sequence>
  77. <xs:element name="window-include" type="tns:WindowIncludeType" minOccurs="0" maxOccurs="unbounded"/>
  78. </xs:sequence>
  79. </xs:complexType>
  80. <xs:complexType name="WindowIncludeType">
  81. <xs:attribute name="src" type="xs:string" use="required"/>
  82. <xs:attribute name="important" type="xs:boolean" default="false"/>
  83. <xs:attribute name="platform" type="tns:PlatformEnum" default="basic"/>
  84. <!-- ENHANCEMENT: Version constraints for includes -->
  85. <xs:attribute name="min-version" type="xs:string"/>
  86. <xs:attribute name="max-version" type="xs:string"/>
  87. </xs:complexType>
  88. <!-- Validation Rules (simplified - just includes) -->
  89. <xs:complexType name="ValidationRulesType">
  90. <xs:sequence>
  91. <xs:element name="validation-include" type="tns:ValidationIncludeType" minOccurs="0" maxOccurs="unbounded"/>
  92. <xs:element name="rule" type="validation:ValidationRuleType" minOccurs="0" maxOccurs="unbounded"/>
  93. </xs:sequence>
  94. </xs:complexType>
  95. <xs:complexType name="ValidationIncludeType">
  96. <xs:attribute name="src" type="xs:string" use="required"/>
  97. <xs:attribute name="important" type="xs:boolean" default="false"/>
  98. <!-- ENHANCEMENT: Version constraints -->
  99. <xs:attribute name="min-version" type="xs:string"/>
  100. <xs:attribute name="max-version" type="xs:string"/>
  101. </xs:complexType>
  102. <!-- Patterns (simplified - mainly includes) -->
  103. <xs:complexType name="PatternsType">
  104. <xs:sequence>
  105. <xs:element name="pattern-include" type="tns:PatternIncludeType" minOccurs="0" maxOccurs="unbounded"/>
  106. <xs:choice minOccurs="0" maxOccurs="unbounded">
  107. <xs:element name="control" type="patterns:ControlType"/>
  108. <xs:element name="structure" type="patterns:StructureType"/>
  109. <xs:element name="wireframe" type="patterns:WireframeType"/>
  110. </xs:choice>
  111. </xs:sequence>
  112. </xs:complexType>
  113. <xs:complexType name="PatternIncludeType">
  114. <xs:attribute name="src" type="xs:string" use="required"/>
  115. <xs:attribute name="important" type="xs:boolean" default="false"/>
  116. <xs:attribute name="platform" type="tns:PlatformEnum" default="basic"/>
  117. <!-- ENHANCEMENT: Version constraints -->
  118. <xs:attribute name="min-version" type="xs:string"/>
  119. <xs:attribute name="max-version" type="xs:string"/>
  120. </xs:complexType>
  121. <!-- Views (simplified - mainly includes) -->
  122. <xs:complexType name="ViewsType">
  123. <xs:sequence>
  124. <xs:element name="view-include" type="tns:ViewIncludeType" minOccurs="0" maxOccurs="unbounded"/>
  125. <xs:element name="view" type="views:ViewType" minOccurs="0" maxOccurs="unbounded"/>
  126. </xs:sequence>
  127. </xs:complexType>
  128. <xs:complexType name="ViewIncludeType">
  129. <xs:attribute name="src" type="xs:string" use="required"/>
  130. <xs:attribute name="important" type="xs:boolean" default="false"/>
  131. <!-- ENHANCEMENT: Version constraints -->
  132. <xs:attribute name="min-version" type="xs:string"/>
  133. <xs:attribute name="max-version" type="xs:string"/>
  134. </xs:complexType>
  135. <!-- ENHANCEMENT: Window Definition with data binding and accessibility -->
  136. <xs:complexType name="WindowType">
  137. <xs:sequence>
  138. <xs:element name="attributes" type="tns:WindowAttributesType" minOccurs="0"/>
  139. <xs:element name="view-properties" type="tns:ViewPropertiesType" minOccurs="0"/>
  140. <!-- ENHANCEMENT: Data binding support -->
  141. <xs:element name="data-binding" type="tns:DataBindingType" minOccurs="0"/>
  142. <!-- ENHANCEMENT: Accessibility configuration -->
  143. <xs:element name="accessibility" type="tns:AccessibilityType" minOccurs="0"/>
  144. <xs:choice>
  145. <xs:element name="slot-overrides" type="tns:SlotOverridesType"/>
  146. <xs:element name="wireframe-instance" type="tns:WireframeInstanceType"/>
  147. <xs:group ref="tns:PlatformControlContentGroup"/>
  148. </xs:choice>
  149. </xs:sequence>
  150. <xs:attribute name="name" type="xs:string" use="required"/>
  151. <xs:attribute name="title" type="xs:string" use="required"/>
  152. <xs:attribute name="wireframe" type="xs:string"/>
  153. <xs:attribute name="view" type="xs:string"/>
  154. <xs:attribute name="target-platform" type="tns:PlatformEnum" default="basic"/>
  155. <!-- ENHANCEMENT: Schema version tracking -->
  156. <xs:attribute name="schema-version" type="xs:string" default="1.2"/>
  157. </xs:complexType>
  158. <!-- ENHANCEMENT: Data Binding Support -->
  159. <xs:complexType name="DataBindingType">
  160. <xs:sequence>
  161. <xs:element name="data-context" type="tns:DataContextBindingType" minOccurs="0"/>
  162. <xs:element name="view-model" type="tns:ViewModelBindingType" minOccurs="0"/>
  163. <xs:element name="binding-properties" type="tns:BindingPropertiesType" minOccurs="0"/>
  164. </xs:sequence>
  165. </xs:complexType>
  166. <xs:complexType name="DataContextBindingType">
  167. <xs:attribute name="source" type="xs:string" use="required"/>
  168. <xs:attribute name="type" type="xs:string"/>
  169. <xs:attribute name="mode" type="tns:BindingModeEnum" default="TwoWay"/>
  170. </xs:complexType>
  171. <xs:complexType name="ViewModelBindingType">
  172. <xs:attribute name="class" type="xs:string" use="required"/>
  173. <xs:attribute name="assembly" type="xs:string"/>
  174. <xs:attribute name="namespace" type="xs:string"/>
  175. </xs:complexType>
  176. <xs:complexType name="BindingPropertiesType">
  177. <xs:sequence>
  178. <xs:element name="property" type="tns:BindingPropertyType" maxOccurs="unbounded"/>
  179. </xs:sequence>
  180. </xs:complexType>
  181. <xs:complexType name="BindingPropertyType">
  182. <xs:attribute name="control" type="xs:string" use="required"/>
  183. <xs:attribute name="property" type="xs:string" use="required"/>
  184. <xs:attribute name="binding-path" type="xs:string" use="required"/>
  185. <xs:attribute name="mode" type="tns:BindingModeEnum" default="TwoWay"/>
  186. <xs:attribute name="converter" type="xs:string"/>
  187. <xs:attribute name="validation-rule" type="xs:string"/>
  188. </xs:complexType>
  189. <xs:simpleType name="BindingModeEnum">
  190. <xs:restriction base="xs:string">
  191. <xs:enumeration value="OneWay"/>
  192. <xs:enumeration value="TwoWay"/>
  193. <xs:enumeration value="OneTime"/>
  194. <xs:enumeration value="OneWayToSource"/>
  195. </xs:restriction>
  196. </xs:simpleType>
  197. <!-- ENHANCEMENT: Accessibility Support -->
  198. <xs:complexType name="AccessibilityType">
  199. <xs:sequence>
  200. <xs:element name="screen-reader" type="tns:ScreenReaderType" minOccurs="0"/>
  201. <xs:element name="keyboard-navigation" type="tns:KeyboardNavigationType" minOccurs="0"/>
  202. <xs:element name="color-contrast" type="tns:ColorContrastType" minOccurs="0"/>
  203. </xs:sequence>
  204. <xs:attribute name="compliance-level" type="tns:AccessibilityLevelEnum" default="basic"/>
  205. </xs:complexType>
  206. <xs:complexType name="ScreenReaderType">
  207. <xs:attribute name="window-title" type="xs:string"/>
  208. <xs:attribute name="description" type="xs:string"/>
  209. <xs:attribute name="landmark-role" type="xs:string"/>
  210. </xs:complexType>
  211. <xs:complexType name="KeyboardNavigationType">
  212. <xs:attribute name="tab-order-start" type="xs:int" default="0"/>
  213. <xs:attribute name="focus-trap" type="xs:boolean" default="false"/>
  214. <xs:attribute name="escape-closes" type="xs:boolean" default="true"/>
  215. </xs:complexType>
  216. <xs:complexType name="ColorContrastType">
  217. <xs:attribute name="high-contrast-support" type="xs:boolean" default="true"/>
  218. <xs:attribute name="minimum-ratio" type="xs:decimal" default="4.5"/>
  219. </xs:complexType>
  220. <!-- Window Attributes -->
  221. <xs:complexType name="WindowAttributesType">
  222. <xs:sequence>
  223. <xs:element name="attribute" maxOccurs="unbounded">
  224. <xs:complexType>
  225. <xs:attribute name="name" type="xs:string" use="required"/>
  226. <xs:attribute name="value" type="xs:string" use="required"/>
  227. </xs:complexType>
  228. </xs:element>
  229. </xs:sequence>
  230. </xs:complexType>
  231. <!-- View Properties -->
  232. <xs:complexType name="ViewPropertiesType">
  233. <xs:sequence>
  234. <xs:element name="role" type="views:WindowRoleEnum"/>
  235. <xs:element name="default" type="xs:boolean" minOccurs="0"/>
  236. <xs:element name="modal" type="xs:boolean" minOccurs="0"/>
  237. <xs:element name="data-context-binding" type="xs:string" minOccurs="0"/>
  238. <xs:element name="parent-window" type="xs:string" minOccurs="0"/>
  239. </xs:sequence>
  240. </xs:complexType>
  241. <!-- ENHANCED: Slot Overrides with conditional visibility -->
  242. <xs:complexType name="SlotOverridesType">
  243. <xs:sequence>
  244. <xs:element name="slot" type="tns:SlotOverrideType" maxOccurs="unbounded"/>
  245. </xs:sequence>
  246. </xs:complexType>
  247. <!-- ENHANCED: Slot Override Type with conditional visibility attributes -->
  248. <xs:complexType name="SlotOverrideType">
  249. <xs:complexContent>
  250. <xs:extension base="tns:PlatformControlContentType">
  251. <xs:attribute name="name" type="xs:string" use="required"/>
  252. <!-- NEW: Conditional visibility attributes for slot overrides -->
  253. <xs:attribute name="visibility-binding" type="xs:string"/>
  254. <xs:attribute name="visibility-value" type="xs:string"/>
  255. </xs:extension>
  256. </xs:complexContent>
  257. </xs:complexType>
  258. <!-- Wireframe Instance -->
  259. <xs:complexType name="WireframeInstanceType">
  260. <xs:sequence>
  261. <xs:element name="slot" type="tns:SlotOverrideType" maxOccurs="unbounded"/>
  262. </xs:sequence>
  263. <xs:attribute name="name" type="xs:string" use="required"/>
  264. <xs:attribute name="wireframe" type="xs:string" use="required"/>
  265. </xs:complexType>
  266. <!-- Platform-Aware Control Content -->
  267. <xs:complexType name="PlatformControlContentType" mixed="true">
  268. <xs:group ref="tns:PlatformControlContentGroup" minOccurs="0" maxOccurs="unbounded"/>
  269. <xs:anyAttribute processContents="lax"/>
  270. </xs:complexType>
  271. <!-- Platform Control Content Group - Supports all platforms -->
  272. <xs:group name="PlatformControlContentGroup">
  273. <xs:choice>
  274. <!-- Basic Controls (always available) -->
  275. <xs:group ref="basic:BasicControlContentGroup"/>
  276. <!-- WinForms Controls (conditional) -->
  277. <xs:group ref="winforms:WinFormsControlContentGroup"/>
  278. <!-- Avalonia Controls (conditional) -->
  279. <xs:group ref="avalonia:AvaloniaControlContentGroup"/>
  280. <!-- Special Elements -->
  281. <xs:element name="wireframe-instance" type="tns:WireframeInstanceType"/>
  282. <!-- Allow any other elements for extensibility -->
  283. <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
  284. </xs:choice>
  285. </xs:group>
  286. <!-- Control Instance (unified across platforms) -->
  287. <xs:complexType name="ControlInstanceType">
  288. <xs:complexContent>
  289. <xs:extension base="tns:PlatformControlContentType">
  290. <xs:attribute name="name" type="xs:string" use="required"/>
  291. <xs:attribute name="slot" type="xs:string"/>
  292. <xs:attribute name="platform-hint" type="tns:PlatformEnum"/>
  293. <!-- ENHANCEMENT: Schema version tracking -->
  294. <xs:attribute name="schema-version" type="xs:string" default="1.2"/>
  295. </xs:extension>
  296. </xs:complexContent>
  297. </xs:complexType>
  298. </xs:schema>