sample.xml 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- UI Layout Definition Format with Control Constraints and Views (v1.1) -->
  3. <ui-layout-def xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="ui-layout-definition ui-layout-def.xsd"
  5. version="1.2">
  6. <!-- Validation rules for control usage including includes -->
  7. <validation-rules>
  8. <!-- External validation rule includes - loaded before local rules -->
  9. <validation-include src="base-validation-rules.xml" important="true" />
  10. <validation-include src="windows-validation-rules.xml" important="false" />
  11. <validation-include src="accessibility-rules.xml" important="false" />
  12. <validation-include src="performance-rules.xml" important="false" />
  13. <validation-include src="view-validation.xml" important="true" />
  14. <!-- Include processing rules for validation:
  15. - important="true": Must be found and loaded, build fails if missing
  16. - important="false": Optional, warnings only if missing
  17. - Includes are processed in order before local rules
  18. - Local rules can override included rules
  19. - Rule conflicts resolved by last-loaded-wins principle
  20. - Rules with same name are merged (constraints combined)
  21. -->
  22. <!-- Local validation rules -->
  23. <rule name="control-definition-required">
  24. <description>All controls used in windows must be defined in patterns node or included files</description>
  25. <constraint>Every control element must reference a defined control or structure pattern from local or included definitions</constraint>
  26. </rule>
  27. <rule name="pattern-include-validation">
  28. <description>Pattern includes must be valid and accessible</description>
  29. <constraint>Files marked important="true" must exist and be loadable</constraint>
  30. </rule>
  31. <rule name="validation-include-validation">
  32. <description>Validation includes must be valid and accessible</description>
  33. <constraint>Validation files marked important="true" must exist and be loadable</constraint>
  34. </rule>
  35. <rule name="view-window-consistency">
  36. <description>View-window relationships must be valid</description>
  37. <constraint>Windows referenced in views must exist and be properly associated</constraint>
  38. </rule>
  39. <rule name="attribute-validation">
  40. <description>Control attributes must match pattern definitions</description>
  41. <constraint>Only attributes defined in control patterns (local or included) are allowed</constraint>
  42. </rule>
  43. <rule name="container-children-validation">
  44. <description>Container controls must only contain allowed child types</description>
  45. <constraint>Child controls must be compatible with parent container per included definitions</constraint>
  46. </rule>
  47. <rule name="required-attributes">
  48. <description>Required attributes must be specified</description>
  49. <constraint>Controls with required="true" attributes must have values</constraint>
  50. </rule>
  51. <rule name="include-precedence">
  52. <description>Pattern and validation override resolution order</description>
  53. <constraint>Local definitions override included definitions, later includes override earlier ones</constraint>
  54. </rule>
  55. </validation-rules>
  56. <!-- Pattern definitions - must be first and only one patterns node -->
  57. <patterns>
  58. <!-- External pattern includes - loaded before local definitions -->
  59. <pattern-include src="windows-controls.xml" important="true" />
  60. <pattern-include src="KDE-controls.xml" important="false" />
  61. <pattern-include src="web-controls.xml" important="false" />
  62. <pattern-include src="mobile-controls.xml" important="false" />
  63. <!-- Include processing rules:
  64. - important="true": Must be found and loaded, build fails if missing
  65. - important="false": Optional, warnings only if missing
  66. - Includes are processed in order before local definitions
  67. - Local definitions can override included patterns
  68. - Naming conflicts resolved by last-loaded-wins principle
  69. -->
  70. <!-- Base wireframe layouts -->
  71. <wireframe name="StandardAppLayout" type="base-layout">
  72. <description>Standard application layout with header, sidebar, content, and footer</description>
  73. <template>
  74. <Panel name="rootContainer">
  75. <Panel name="headerPanel" height="60">
  76. <slot name="header-content" default="true">
  77. <Label name="appTitle" text="Application Title" />
  78. <slot name="header-actions" />
  79. </slot>
  80. </Panel>
  81. <Panel name="mainContainer" orientation="horizontal">
  82. <Panel name="sidebarPanel" width="250" visible="true">
  83. <slot name="sidebar-content" default="true">
  84. <Menu name="navigationMenu" orientation="vertical">
  85. <slot name="navigation-items" />
  86. </Menu>
  87. </slot>
  88. </Panel>
  89. <Panel name="contentPanel" fill="true">
  90. <slot name="main-content" required="true" />
  91. </Panel>
  92. </Panel>
  93. <Panel name="footerPanel" height="30">
  94. <slot name="footer-content" default="true">
  95. <Label name="statusLabel" text="Ready" />
  96. </slot>
  97. </Panel>
  98. </Panel>
  99. </template>
  100. </wireframe>
  101. <wireframe name="DialogLayout" type="base-layout">
  102. <description>Standard modal dialog layout</description>
  103. <template>
  104. <Panel name="dialogContainer">
  105. <Panel name="titleBar" height="40">
  106. <slot name="dialog-title" default="true">
  107. <Label name="titleLabel" text="Dialog" />
  108. </slot>
  109. <Button name="closeButton" text="×" style="borderless" />
  110. </Panel>
  111. <Panel name="dialogContent" padding="20">
  112. <slot name="dialog-body" required="true" />
  113. </Panel>
  114. <Panel name="buttonBar" height="50" alignment="right">
  115. <slot name="dialog-buttons" default="true">
  116. <Button name="okButton" text="OK" style="primary" />
  117. <Button name="cancelButton" text="Cancel" />
  118. </slot>
  119. </Panel>
  120. </Panel>
  121. </template>
  122. </wireframe>
  123. <wireframe name="FormLayout" type="base-layout">
  124. <description>Standard form layout with sections</description>
  125. <template>
  126. <Panel name="formContainer">
  127. <slot name="form-header" />
  128. <Panel name="formSections">
  129. <slot name="form-content" required="true" />
  130. </Panel>
  131. <Panel name="formActions" alignment="right">
  132. <slot name="form-buttons" default="true">
  133. <Button name="saveButton" text="Save" style="primary" />
  134. <Button name="cancelButton" text="Cancel" />
  135. </slot>
  136. </Panel>
  137. </Panel>
  138. </template>
  139. </wireframe>
  140. <!-- Base control definitions with constraints -->
  141. <control name="Label" type="display" category="basic">
  142. <constraints>
  143. <allowed-parents>Panel,FormField,Menu</allowed-parents>
  144. <allowed-children>none</allowed-children>
  145. <container>false</container>
  146. </constraints>
  147. <attributes>
  148. <attribute name="text" type="string" default="" required="false" />
  149. <attribute name="font-size" type="int" default="12" min="8" max="72" />
  150. <attribute name="color" type="color" default="#000000" />
  151. <attribute name="alignment" type="enum" values="left,center,right" default="left" />
  152. </attributes>
  153. <behavior>
  154. <event name="click" />
  155. </behavior>
  156. </control>
  157. <control name="TextBox" type="input" category="input">
  158. <constraints>
  159. <allowed-parents>Panel,FormField</allowed-parents>
  160. <allowed-children>none</allowed-children>
  161. <container>false</container>
  162. </constraints>
  163. <attributes>
  164. <attribute name="value" type="string" default="" />
  165. <attribute name="placeholder" type="string" default="" />
  166. <attribute name="max-length" type="int" default="255" min="1" max="10000" />
  167. <attribute name="readonly" type="bool" default="false" />
  168. <attribute name="multiline" type="bool" default="false" />
  169. </attributes>
  170. <behavior>
  171. <event name="text-changed" />
  172. <event name="focus" />
  173. <event name="blur" />
  174. </behavior>
  175. </control>
  176. <control name="ComboBox" type="input" category="input">
  177. <constraints>
  178. <allowed-parents>Panel,FormField</allowed-parents>
  179. <allowed-children>items</allowed-children>
  180. <container>false</container>
  181. <requires-structure>items</requires-structure>
  182. </constraints>
  183. <attributes>
  184. <attribute name="selected-value" type="string" default="" />
  185. <attribute name="editable" type="bool" default="false" />
  186. </attributes>
  187. <behavior>
  188. <event name="selection-changed" />
  189. </behavior>
  190. <structure>
  191. <items min-count="0" max-count="unlimited">
  192. <item value="" text="" />
  193. </items>
  194. </structure>
  195. </control>
  196. <control name="Button" type="action" category="action">
  197. <constraints>
  198. <allowed-parents>Panel,FormField,ButtonBar</allowed-parents>
  199. <allowed-children>none</allowed-children>
  200. <container>false</container>
  201. </constraints>
  202. <attributes>
  203. <attribute name="text" type="string" default="Button" required="true" />
  204. <attribute name="enabled" type="bool" default="true" />
  205. <attribute name="style" type="enum" values="normal,primary,secondary,danger,borderless" default="normal" />
  206. </attributes>
  207. <behavior>
  208. <event name="click" required="true" />
  209. </behavior>
  210. </control>
  211. <control name="Panel" type="container" category="layout">
  212. <constraints>
  213. <allowed-parents>Panel,window,wireframe-instance</allowed-parents>
  214. <allowed-children>any-control</allowed-children>
  215. <container>true</container>
  216. <max-children>unlimited</max-children>
  217. </constraints>
  218. <attributes>
  219. <attribute name="border" type="bool" default="false" />
  220. <attribute name="background-color" type="color" default="transparent" />
  221. <attribute name="padding" type="int" default="0" min="0" max="50" />
  222. <attribute name="orientation" type="enum" values="horizontal,vertical" default="vertical" />
  223. <attribute name="alignment" type="enum" values="left,center,right,stretch" default="left" />
  224. <attribute name="fill" type="bool" default="false" />
  225. <attribute name="width" type="int" min="10" max="2000" />
  226. <attribute name="height" type="int" min="10" max="2000" />
  227. <attribute name="visible" type="bool" default="true" />
  228. </attributes>
  229. <structure>
  230. <children allow-multiple="true" />
  231. </structure>
  232. </control>
  233. <control name="PopupPanel" type="container" category="layout" inherits="Panel">
  234. <constraints>
  235. <allowed-parents>window</allowed-parents>
  236. <allowed-children>any-control</allowed-children>
  237. <container>true</container>
  238. </constraints>
  239. <attributes>
  240. <attribute name="modal" type="bool" default="true" />
  241. <attribute name="visible" type="bool" default="false" />
  242. <attribute name="position" type="enum" values="center,cursor,custom" default="center" />
  243. </attributes>
  244. <behavior>
  245. <event name="opened" />
  246. <event name="closed" />
  247. </behavior>
  248. </control>
  249. <control name="Menu" type="navigation" category="navigation">
  250. <constraints>
  251. <allowed-parents>Panel</allowed-parents>
  252. <allowed-children>menu-items</allowed-children>
  253. <container>true</container>
  254. <requires-structure>menu-items</requires-structure>
  255. </constraints>
  256. <attributes>
  257. <attribute name="orientation" type="enum" values="horizontal,vertical" default="horizontal" />
  258. </attributes>
  259. <structure>
  260. <menu-items min-count="1" max-count="unlimited">
  261. <menu-item text="" action="" shortcut="" separator="false" />
  262. </menu-items>
  263. </structure>
  264. </control>
  265. <control name="ListView" type="data" category="data">
  266. <constraints>
  267. <allowed-parents>Panel</allowed-parents>
  268. <allowed-children>columns,items</allowed-children>
  269. <container>true</container>
  270. <requires-structure>columns</requires-structure>
  271. </constraints>
  272. <attributes>
  273. <attribute name="view-mode" type="enum" values="list,details,icons" default="list" />
  274. <attribute name="multi-select" type="bool" default="false" />
  275. <attribute name="sort-column" type="string" default="" />
  276. <attribute name="sort-direction" type="enum" values="asc,desc" default="asc" />
  277. </attributes>
  278. <behavior>
  279. <event name="selection-changed" />
  280. <event name="item-double-click" />
  281. </behavior>
  282. <structure>
  283. <columns min-count="1" max-count="20">
  284. <column name="" text="" width="" sortable="true" />
  285. </columns>
  286. <items min-count="0" max-count="unlimited">
  287. <item>
  288. <values>
  289. <value column="" text="" />
  290. </values>
  291. </item>
  292. </items>
  293. </structure>
  294. </control>
  295. <control name="TreeView" type="data" category="data">
  296. <constraints>
  297. <allowed-parents>Panel</allowed-parents>
  298. <allowed-children>nodes</allowed-children>
  299. <container>true</container>
  300. <requires-structure>nodes</requires-structure>
  301. </constraints>
  302. <attributes>
  303. <attribute name="show-lines" type="bool" default="true" />
  304. <attribute name="show-root-lines" type="bool" default="true" />
  305. <attribute name="checkboxes" type="bool" default="false" />
  306. </attributes>
  307. <behavior>
  308. <event name="node-selected" />
  309. <event name="node-expanded" />
  310. <event name="node-collapsed" />
  311. </behavior>
  312. <structure>
  313. <nodes min-count="0" max-count="unlimited">
  314. <node text="" value="" expanded="false" checked="false">
  315. <nodes max-depth="10">
  316. <!-- Recursive node structure with depth limit -->
  317. </nodes>
  318. </node>
  319. </nodes>
  320. </structure>
  321. </control>
  322. <!-- Additional specialized controls -->
  323. <control name="TabControl" type="container" category="layout">
  324. <constraints>
  325. <allowed-parents>Panel</allowed-parents>
  326. <allowed-children>tab</allowed-children>
  327. <container>true</container>
  328. <requires-structure>tabs</requires-structure>
  329. </constraints>
  330. <attributes>
  331. <attribute name="selected-tab" type="string" default="" />
  332. <attribute name="tab-position" type="enum" values="top,bottom,left,right" default="top" />
  333. </attributes>
  334. <structure>
  335. <tabs min-count="1" max-count="20">
  336. <tab name="" text="" visible="true" enabled="true">
  337. <!-- Tab content can contain any controls -->
  338. </tab>
  339. </tabs>
  340. </structure>
  341. </control>
  342. <control name="ButtonBar" type="container" category="layout">
  343. <constraints>
  344. <allowed-parents>Panel,FormField</allowed-parents>
  345. <allowed-children>Button</allowed-children>
  346. <container>true</container>
  347. <max-children>10</max-children>
  348. </constraints>
  349. <attributes>
  350. <attribute name="alignment" type="enum" values="left,center,right" default="right" />
  351. <attribute name="spacing" type="int" default="5" min="0" max="20" />
  352. </attributes>
  353. </control>
  354. <!-- Custom pattern with constraints -->
  355. <structure name="FormField" type="pattern" category="composite">
  356. <constraints>
  357. <allowed-parents>Panel,FormLayout</allowed-parents>
  358. <allowed-children>Label,TextBox,ComboBox,Button</allowed-children>
  359. <container>true</container>
  360. <required-slots>input</required-slots>
  361. </constraints>
  362. <attributes>
  363. <attribute name="label-text" type="string" required="true" />
  364. <attribute name="required" type="bool" default="false" />
  365. <attribute name="validation-message" type="string" default="" />
  366. </attributes>
  367. <template>
  368. <Panel name="fieldContainer">
  369. <Label name="fieldLabel" text="{label-text}" />
  370. <slot name="input" allowed-controls="TextBox,ComboBox,Button" required="true" />
  371. <Label name="validationLabel" text="{validation-message}" visible="false" color="#ff0000" />
  372. </Panel>
  373. </template>
  374. </structure>
  375. </patterns>
  376. <!-- NEW: View definitions with external includes -->
  377. <views>
  378. <!-- External view includes - loaded before local view definitions -->
  379. <view-include src="business-views.xml" important="true" />
  380. <view-include src="admin-views.xml" important="false" />
  381. <!-- Base Application View -->
  382. <view name="BaseApplicationView" type="base" category="framework">
  383. <description>Base view for all application windows with common functionality</description>
  384. <metadata>
  385. <permissions>app.access</permissions>
  386. </metadata>
  387. <data-context>
  388. <property name="currentUser" type="User" scope="global" />
  389. <property name="applicationSettings" type="AppSettings" scope="global" />
  390. <property name="isLoading" type="bool" scope="view" />
  391. </data-context>
  392. <behaviors>
  393. <behavior name="show-loading" scope="view" />
  394. <behavior name="hide-loading" scope="view" />
  395. <behavior name="show-error" scope="view" />
  396. <behavior name="log-action" scope="global" />
  397. </behaviors>
  398. </view>
  399. <!-- Main Application View -->
  400. <view name="MainApplicationView" type="dashboard" category="core" inherits="BaseApplicationView">
  401. <description>Main application dashboard with navigation and overview</description>
  402. <metadata>
  403. <view-model-class>MainApplicationViewModel</view-model-class>
  404. <controller-class>MainApplicationController</controller-class>
  405. <permissions>app.main,dashboard.view</permissions>
  406. </metadata>
  407. <dependencies>
  408. <view-ref name="UserManagementView" relationship="reference" required="false">
  409. <interaction type="manage-users" />
  410. </view-ref>
  411. <view-ref name="SettingsView" relationship="reference" required="false">
  412. <interaction type="configure-app" />
  413. </view-ref>
  414. <shared-component name="NotificationService" required="true" />
  415. <shared-component name="SecurityService" required="true" />
  416. </dependencies>
  417. <data-context>
  418. <property name="dashboardData" type="DashboardData" scope="view" />
  419. <property name="recentItems" type="RecentItemsList" scope="view" />
  420. <property name="notifications" type="NotificationList" scope="view" />
  421. </data-context>
  422. <windows>
  423. <window-ref name="MainWindow" role="main" default="true" />
  424. </windows>
  425. <navigation>
  426. <action name="show-dashboard" target="MainWindow" />
  427. <action name="show-users" target="UserManagementView" />
  428. <action name="show-settings" target="SettingsView" />
  429. <action name="show-reports" target="MainWindow" context="reportsPanel" />
  430. </navigation>
  431. <behaviors>
  432. <behavior name="refresh-dashboard" scope="view" />
  433. <behavior name="load-recent-items" scope="view" />
  434. <behavior name="check-notifications" scope="view" />
  435. </behaviors>
  436. <communication>
  437. <publishes>
  438. <event name="dashboard-loaded" data="dashboard-id" />
  439. <event name="user-activity" data="activity-type,timestamp" />
  440. </publishes>
  441. <subscribes>
  442. <event name="user-logged-in" source="SecurityService" handler="refresh-dashboard" />
  443. <event name="settings-changed" source="SettingsView" handler="apply-settings" />
  444. </subscribes>
  445. </communication>
  446. </view>
  447. <!-- User Management View -->
  448. <view name="UserManagementView" type="business-entity" category="admin" inherits="BaseApplicationView">
  449. <description>User account management including creation, editing, and permissions</description>
  450. <metadata>
  451. <model-class>User</model-class>
  452. <view-model-class>UserManagementViewModel</view-model-class>
  453. <controller-class>UserController</controller-class>
  454. <permissions>user.read,user.write,user.admin</permissions>
  455. </metadata>
  456. <data-context>
  457. <property name="currentUser" type="User" scope="view" />
  458. <property name="userList" type="UserList" scope="view" />
  459. <property name="selectedUsers" type="UserList" scope="view" />
  460. <property name="userRoles" type="RoleList" scope="view" />
  461. </data-context>
  462. <windows>
  463. <window-ref name="UserListWindow" role="main" default="true" />
  464. <window-ref name="UserEditDialog" role="editor" modal="true" />
  465. <window-ref name="UserPermissionsDialog" role="utility" modal="true" />
  466. </windows>
  467. <navigation>
  468. <action name="show-user-list" target="UserListWindow" />
  469. <action name="edit-user" target="UserEditDialog" context="currentUser" />
  470. <action name="create-user" target="UserEditDialog" />
  471. <action name="manage-permissions" target="UserPermissionsDialog" context="currentUser" />
  472. </navigation>
  473. <behaviors>
  474. <behavior name="refresh-users" scope="view" />
  475. <behavior name="validate-user" scope="view" />
  476. <behavior name="save-user" scope="view" />
  477. <behavior name="delete-user" scope="view" />
  478. <behavior name="reset-password" scope="view" />
  479. </behaviors>
  480. <communication>
  481. <publishes>
  482. <event name="user-created" data="user-id" />
  483. <event name="user-updated" data="user-id" />
  484. <event name="user-deleted" data="user-id" />
  485. </publishes>
  486. </communication>
  487. </view>
  488. <!-- Settings View -->
  489. <view name="SettingsView" type="utility" category="system" inherits="BaseApplicationView">
  490. <description>Application configuration and user preferences</description>
  491. <metadata>
  492. <model-class>ApplicationSettings</model-class>
  493. <view-model-class>SettingsViewModel</view-model-class>
  494. <controller-class>SettingsController</controller-class>
  495. <permissions>settings.read,settings.write</permissions>
  496. </metadata>
  497. <data-context>
  498. <property name="currentSettings" type="ApplicationSettings" scope="view" />
  499. <property name="userPreferences" type="UserPreferences" scope="view" />
  500. <property name="systemInfo" type="SystemInfo" scope="view" />
  501. </data-context>
  502. <windows>
  503. <window-ref name="SettingsWindow" role="main" default="true" />
  504. </windows>
  505. <navigation>
  506. <action name="show-settings" target="SettingsWindow" />
  507. <action name="reset-to-defaults" target="SettingsWindow" />
  508. </navigation>
  509. <behaviors>
  510. <behavior name="load-settings" scope="view" />
  511. <behavior name="save-settings" scope="view" />
  512. <behavior name="validate-settings" scope="view" />
  513. <behavior name="export-settings" scope="view" />
  514. <behavior name="import-settings" scope="view" />
  515. </behaviors>
  516. <communication>
  517. <publishes>
  518. <event name="settings-changed" data="setting-category" />
  519. <event name="settings-saved" data="timestamp" />
  520. </publishes>
  521. </communication>
  522. </view>
  523. </views>
  524. <!-- Window definitions with view associations and wireframe inheritance -->
  525. <window name="MainWindow" title="Main Application" wireframe="StandardAppLayout" view="MainApplicationView">
  526. <attributes>
  527. <attribute name="width" value="1200" />
  528. <attribute name="height" value="800" />
  529. <attribute name="resizable" value="true" />
  530. <attribute name="start-position" value="center" />
  531. <attribute name="minimize-to-tray" value="true" />
  532. </attributes>
  533. <!-- NEW: View properties for view integration -->
  534. <view-properties>
  535. <role>main</role>
  536. <default>true</default>
  537. <data-context-binding>dashboardData</data-context-binding>
  538. </view-properties>
  539. <!-- Override specific slots from the wireframe -->
  540. <slot-overrides>
  541. <slot name="header-actions">
  542. <Button name="userProfileButton" text="Profile" />
  543. <Button name="settingsButton" text="Settings" />
  544. <Button name="helpButton" text="Help" />
  545. </slot>
  546. <slot name="navigation-items">
  547. <menu-items>
  548. <menu-item text="Dashboard" action="show-dashboard" />
  549. <menu-item text="Users" action="show-users" />
  550. <menu-item text="Reports" action="show-reports" />
  551. <menu-item text="Settings" action="show-settings" />
  552. <menu-item text="" separator="true" />
  553. <menu-item text="About" action="show-about" />
  554. </menu-items>
  555. </slot>
  556. <slot name="main-content">
  557. <!-- Main application content -->
  558. <Panel name="dashboardPanel">
  559. <Label name="welcomeLabel" text="Welcome to Dashboard" font-size="18" />
  560. <Panel name="statisticsPanel" orientation="horizontal">
  561. <Panel name="statsLeft" width="400">
  562. <Label name="totalUsersLabel" text="Total Users: 0" />
  563. <Label name="activeSessionsLabel" text="Active Sessions: 0" />
  564. <Label name="systemStatusLabel" text="System Status: Running" />
  565. </Panel>
  566. <Panel name="statsRight" fill="true">
  567. <ListView name="recentItems" view-mode="details">
  568. <columns>
  569. <column name="name" text="Name" width="200" sortable="true" />
  570. <column name="date" text="Date" width="150" sortable="true" />
  571. <column name="user" text="User" width="120" sortable="true" />
  572. <column name="status" text="Status" width="100" sortable="true" />
  573. </columns>
  574. </ListView>
  575. </Panel>
  576. </Panel>
  577. <Panel name="quickActionsPanel">
  578. <ButtonBar name="quickActions" alignment="left">
  579. <Button name="addUserButton" text="Add User" style="primary" />
  580. <Button name="generateReportButton" text="Generate Report" />
  581. <Button name="backupDataButton" text="Backup Data" />
  582. </ButtonBar>
  583. </Panel>
  584. </Panel>
  585. </slot>
  586. <slot name="footer-content">
  587. <Label name="statusLabel" text="Connected - System Ready" />
  588. <Label name="versionLabel" text="v1.1.0" alignment="right" />
  589. <Label name="timeLabel" text="00:00:00" alignment="right" />
  590. </slot>
  591. </slot-overrides>
  592. </window>
  593. <!-- User management window inheriting dialog wireframe -->
  594. <window name="UserListWindow" title="User Management" wireframe="StandardAppLayout" view="UserManagementView">
  595. <attributes>
  596. <attribute name="width" value="900" />
  597. <attribute name="height" value="600" />
  598. <attribute name="modal" value="false" />
  599. </attributes>
  600. <view-properties>
  601. <role>main</role>
  602. <default>true</default>
  603. <data-context-binding>userList</data-context-binding>
  604. </view-properties>
  605. <slot-overrides>
  606. <slot name="header-content">
  607. <Label name="titleLabel" text="User Management" font-size="16" />
  608. <Panel name="searchPanel" orientation="horizontal">
  609. <TextBox name="searchInput" placeholder="Search users..." />
  610. <Button name="searchButton" text="Search" />
  611. </Panel>
  612. </slot>
  613. <slot name="main-content">
  614. <Panel name="userManagementPanel">
  615. <Panel name="toolbarPanel" height="40" orientation="horizontal">
  616. <ButtonBar name="userActions" alignment="left">
  617. <Button name="addUserButton" text="Add User" style="primary" />
  618. <Button name="editUserButton" text="Edit" enabled="false" />
  619. <Button name="deleteUserButton" text="Delete" enabled="false" style="danger" />
  620. <Button name="resetPasswordButton" text="Reset Password" enabled="false" />
  621. </ButtonBar>
  622. <ButtonBar name="viewActions" alignment="right">
  623. <Button name="refreshButton" text="Refresh" />
  624. <Button name="exportButton" text="Export" />
  625. </ButtonBar>
  626. </Panel>
  627. <ListView name="userGrid" view-mode="details" multi-select="true">
  628. <columns>
  629. <column name="id" text="ID" width="80" sortable="true" />
  630. <column name="username" text="Username" width="150" sortable="true" />
  631. <column name="fullname" text="Full Name" width="200" sortable="true" />
  632. <column name="email" text="Email" width="250" sortable="true" />
  633. <column name="role" text="Role" width="120" sortable="true" />
  634. <column name="status" text="Status" width="100" sortable="true" />
  635. <column name="lastlogin" text="Last Login" width="150" sortable="true" />
  636. </columns>
  637. </ListView>
  638. </Panel>
  639. </slot>
  640. </slot-overrides>
  641. </window>
  642. <!-- User edit dialog inheriting dialog wireframe -->
  643. <window name="UserEditDialog" title="Edit User" wireframe="DialogLayout" view="UserManagementView">
  644. <attributes>
  645. <attribute name="width" value="500" />
  646. <attribute name="height" value="400" />
  647. <attribute name="modal" value="true" />
  648. <attribute name="resizable" value="false" />
  649. </attributes>
  650. <view-properties>
  651. <role>editor</role>
  652. <modal>true</modal>
  653. <data-context-binding>currentUser</data-context-binding>
  654. <parent-window>UserListWindow</parent-window>
  655. </view-properties>
  656. <slot-overrides>
  657. <slot name="dialog-title">
  658. <Label name="titleLabel" text="User Details" />
  659. </slot>
  660. <slot name="dialog-body">
  661. <!-- Use FormLayout as nested wireframe -->
  662. <wireframe-instance name="userForm" wireframe="FormLayout">
  663. <slot name="form-content">
  664. <FormField name="usernameField" label-text="Username:" required="true">
  665. <TextBox name="usernameInput" slot="input" max-length="50" />
  666. </FormField>
  667. <FormField name="fullnameField" label-text="Full Name:" required="true">
  668. <TextBox name="fullnameInput" slot="input" max-length="100" />
  669. </FormField>
  670. <FormField name="emailField" label-text="Email:" required="true">
  671. <TextBox name="emailInput" slot="input" max-length="255" />
  672. </FormField>
  673. <FormField name="roleField" label-text="Role:">
  674. <ComboBox name="roleCombo" slot="input">
  675. <items>
  676. <item value="admin" text="Administrator" />
  677. <item value="user" text="Standard User" />
  678. <item value="viewer" text="Viewer Only" />
  679. <item value="moderator" text="Moderator" />
  680. </items>
  681. </ComboBox>
  682. </FormField>
  683. <FormField name="statusField" label-text="Status:">
  684. <ComboBox name="statusCombo" slot="input">
  685. <items>
  686. <item value="active" text="Active" />
  687. <item value="inactive" text="Inactive" />
  688. <item value="suspended" text="Suspended" />
  689. <item value="pending" text="Pending Approval" />
  690. </items>
  691. </ComboBox>
  692. </FormField>
  693. <FormField name="passwordField" label-text="Password:" required="false">
  694. <TextBox name="passwordInput" slot="input" />
  695. </FormField>
  696. </slot>
  697. <slot name="form-buttons">
  698. <Button name="saveButton" text="Save User" style="primary" />
  699. <Button name="cancelButton" text="Cancel" />
  700. <Button name="resetPasswordButton" text="Reset Password" style="secondary" />
  701. </slot>
  702. </wireframe-instance>
  703. </slot>
  704. <slot name="dialog-buttons">
  705. <Button name="saveButton" text="Save Changes" style="primary" />
  706. <Button name="cancelButton" text="Cancel" />
  707. <Button name="deleteButton" text="Delete User" style="danger" />
  708. </slot>
  709. </slot-overrides>
  710. </window>
  711. <!-- User permissions dialog -->
  712. <window name="UserPermissionsDialog" title="User Permissions" wireframe="DialogLayout" view="UserManagementView">
  713. <attributes>
  714. <attribute name="width" value="600" />
  715. <attribute name="height" value="500" />
  716. <attribute name="modal" value="true" />
  717. </attributes>
  718. <view-properties>
  719. <role>utility</role>
  720. <modal>true</modal>
  721. <data-context-binding>currentUser</data-context-binding>
  722. <parent-window>UserListWindow</parent-window>
  723. </view-properties>
  724. <slot-overrides>
  725. <slot name="dialog-title">
  726. <Label name="titleLabel" text="Manage User Permissions" />
  727. </slot>
  728. <slot name="dialog-body">
  729. <Panel name="permissionsPanel">
  730. <Label name="userInfoLabel" text="User: {currentUser.username}" font-size="14" />
  731. <TabControl name="permissionTabs">
  732. <tab name="basic" text="Basic Permissions">
  733. <Panel name="basicPermissions">
  734. <TreeView name="basicPermissionsTree" checkboxes="true">
  735. <nodes>
  736. <node text="Application Access" value="app.access" checked="true">
  737. <nodes>
  738. <node text="Dashboard View" value="dashboard.view" checked="true" />
  739. <node text="Reports View" value="reports.view" checked="false" />
  740. <node text="Settings Access" value="settings.read" checked="false" />
  741. </nodes>
  742. </node>
  743. <node text="User Management" value="user.manage" checked="false">
  744. <nodes>
  745. <node text="View Users" value="user.read" checked="false" />
  746. <node text="Create Users" value="user.create" checked="false" />
  747. <node text="Edit Users" value="user.write" checked="false" />
  748. <node text="Delete Users" value="user.delete" checked="false" />
  749. </nodes>
  750. </node>
  751. </nodes>
  752. </TreeView>
  753. </Panel>
  754. </tab>
  755. <tab name="advanced" text="Advanced Permissions">
  756. <Panel name="advancedPermissions">
  757. <ListView name="advancedPermissionsList" view-mode="details" multi-select="true">
  758. <columns>
  759. <column name="permission" text="Permission" width="200" />
  760. <column name="description" text="Description" width="300" />
  761. <column name="granted" text="Granted" width="80" />
  762. </columns>
  763. </ListView>
  764. </Panel>
  765. </tab>
  766. <tab name="roles" text="Role Assignment">
  767. <Panel name="roleAssignment">
  768. <FormField name="primaryRoleField" label-text="Primary Role:">
  769. <ComboBox name="primaryRoleCombo" slot="input">
  770. <items>
  771. <item value="admin" text="Administrator" />
  772. <item value="user" text="Standard User" />
  773. <item value="viewer" text="Viewer" />
  774. </items>
  775. </ComboBox>
  776. </FormField>
  777. <FormField name="additionalRolesField" label-text="Additional Roles:">
  778. <ListView name="additionalRolesList" slot="input" view-mode="list" multi-select="true">
  779. <columns>
  780. <column name="role" text="Role" width="150" />
  781. </columns>
  782. </ListView>
  783. </FormField>
  784. </Panel>
  785. </tab>
  786. </TabControl>
  787. </Panel>
  788. </slot>
  789. <slot name="dialog-buttons">
  790. <Button name="savePermissionsButton" text="Save Permissions" style="primary" />
  791. <Button name="cancelButton" text="Cancel" />
  792. <Button name="resetToDefaultButton" text="Reset to Default" />
  793. </slot>
  794. </slot-overrides>
  795. </window>
  796. <!-- Settings window with partial wireframe override -->
  797. <window name="SettingsWindow" title="Application Settings" wireframe="StandardAppLayout" view="SettingsView">
  798. <attributes>
  799. <attribute name="width" value="800" />
  800. <attribute name="height" value="600" />
  801. <attribute name="modal" value="false" />
  802. </attributes>
  803. <view-properties>
  804. <role>main</role>
  805. <default>true</default>
  806. <data-context-binding>currentSettings</data-context-binding>
  807. </view-properties>
  808. <slot-overrides>
  809. <!-- Keep default header but override navigation -->
  810. <slot name="navigation-items">
  811. <menu-items>
  812. <menu-item text="General" action="settings-general" />
  813. <menu-item text="Appearance" action="settings-appearance" />
  814. <menu-item text="Security" action="settings-security" />
  815. <menu-item text="Database" action="settings-database" />
  816. <menu-item text="Logging" action="settings-logging" />
  817. <menu-item text="Advanced" action="settings-advanced" />
  818. </menu-items>
  819. </slot>
  820. <slot name="main-content">
  821. <Panel name="settingsContent">
  822. <!-- Settings tabs or sections would go here -->
  823. <TabControl name="settingsTabs">
  824. <tab name="general" text="General Settings">
  825. <Panel name="generalSettings">
  826. <FormField name="appNameField" label-text="Application Name:">
  827. <TextBox name="appNameInput" slot="input" value="Sample Application" />
  828. </FormField>
  829. <FormField name="languageField" label-text="Language:">
  830. <ComboBox name="languageCombo" slot="input">
  831. <items>
  832. <item value="en" text="English" />
  833. <item value="de" text="Deutsch" />
  834. <item value="fr" text="Français" />
  835. <item value="es" text="Español" />
  836. </items>
  837. </ComboBox>
  838. </FormField>
  839. <FormField name="timezoneField" label-text="Timezone:">
  840. <ComboBox name="timezoneCombo" slot="input">
  841. <items>
  842. <item value="UTC" text="UTC" />
  843. <item value="EST" text="Eastern Time" />
  844. <item value="PST" text="Pacific Time" />
  845. <item value="CET" text="Central European Time" />
  846. </items>
  847. </ComboBox>
  848. </FormField>
  849. <FormField name="autoSaveField" label-text="Auto-save interval (minutes):">
  850. <TextBox name="autoSaveInput" slot="input" value="5" />
  851. </FormField>
  852. </Panel>
  853. </tab>
  854. <tab name="appearance" text="Appearance">
  855. <Panel name="appearanceSettings">
  856. <FormField name="themeField" label-text="Theme:">
  857. <ComboBox name="themeCombo" slot="input">
  858. <items>
  859. <item value="light" text="Light Theme" />
  860. <item value="dark" text="Dark Theme" />
  861. <item value="auto" text="Auto (System)" />
  862. <item value="high-contrast" text="High Contrast" />
  863. </items>
  864. </ComboBox>
  865. </FormField>
  866. <FormField name="fontSizeField" label-text="Font Size:">
  867. <ComboBox name="fontSizeCombo" slot="input">
  868. <items>
  869. <item value="small" text="Small" />
  870. <item value="medium" text="Medium" />
  871. <item value="large" text="Large" />
  872. <item value="extra-large" text="Extra Large" />
  873. </items>
  874. </ComboBox>
  875. </FormField>
  876. <FormField name="colorSchemeField" label-text="Color Scheme:">
  877. <ComboBox name="colorSchemeCombo" slot="input">
  878. <items>
  879. <item value="blue" text="Blue" />
  880. <item value="green" text="Green" />
  881. <item value="purple" text="Purple" />
  882. <item value="orange" text="Orange" />
  883. </items>
  884. </ComboBox>
  885. </FormField>
  886. </Panel>
  887. </tab>
  888. <tab name="security" text="Security">
  889. <Panel name="securitySettings">
  890. <FormField name="sessionTimeoutField" label-text="Session Timeout (minutes):">
  891. <TextBox name="sessionTimeoutInput" slot="input" value="30" />
  892. </FormField>
  893. <FormField name="passwordPolicyField" label-text="Password Policy:">
  894. <ComboBox name="passwordPolicyCombo" slot="input">
  895. <items>
  896. <item value="basic" text="Basic (6+ characters)" />
  897. <item value="standard" text="Standard (8+ chars, mixed case)" />
  898. <item value="strong" text="Strong (12+ chars, symbols)" />
  899. <item value="custom" text="Custom Policy" />
  900. </items>
  901. </ComboBox>
  902. </FormField>
  903. <FormField name="twoFactorField" label-text="Two-Factor Authentication:">
  904. <ComboBox name="twoFactorCombo" slot="input">
  905. <items>
  906. <item value="disabled" text="Disabled" />
  907. <item value="optional" text="Optional" />
  908. <item value="required" text="Required" />
  909. </items>
  910. </ComboBox>
  911. </FormField>
  912. </Panel>
  913. </tab>
  914. <tab name="database" text="Database">
  915. <Panel name="databaseSettings">
  916. <FormField name="connectionStringField" label-text="Connection String:">
  917. <TextBox name="connectionStringInput" slot="input" multiline="true" />
  918. </FormField>
  919. <FormField name="backupIntervalField" label-text="Backup Interval (hours):">
  920. <TextBox name="backupIntervalInput" slot="input" value="24" />
  921. </FormField>
  922. <FormField name="queryTimeoutField" label-text="Query Timeout (seconds):">
  923. <TextBox name="queryTimeoutInput" slot="input" value="30" />
  924. </FormField>
  925. <Panel name="databaseActions">
  926. <ButtonBar name="dbActionButtons" alignment="left">
  927. <Button name="testConnectionButton" text="Test Connection" />
  928. <Button name="backupNowButton" text="Backup Now" />
  929. <Button name="optimizeButton" text="Optimize Database" />
  930. </ButtonBar>
  931. </Panel>
  932. </Panel>
  933. </tab>
  934. </TabControl>
  935. <Panel name="settingsActions" height="60">
  936. <ButtonBar name="settingsButtons" alignment="right">
  937. <Button name="saveSettingsButton" text="Save Settings" style="primary" />
  938. <Button name="cancelButton" text="Cancel" />
  939. <Button name="resetToDefaultsButton" text="Reset to Defaults" style="secondary" />
  940. <Button name="exportSettingsButton" text="Export" />
  941. <Button name="importSettingsButton" text="Import" />
  942. </ButtonBar>
  943. </Panel>
  944. </Panel>
  945. </slot>
  946. <!-- Use default footer -->
  947. </slot-overrides>
  948. </window>
  949. </ui-layout-def>