fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / kdeui / xmlgui / kxmlgui.xsd
blobc122340dce5384900f5f25e6519c1a545feb64ac
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!-- kxmlgui XSD v1.0 -->
3 <xsd:schema
4 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
5 xmlns="http://www.kde.org/standards/kxmlgui/1.0"
6 targetNamespace="http://www.kde.org/standards/kxmlgui/1.0"
7 version="1.0"
8 elementFormDefault="qualified" >
10 <xsd:annotation>
11 <xsd:documentation>
12 * Originally Copyright (c) 2000 Federico David Sacerdoti &gt;tech@slinuxmachines.com&lt;
13 * Modifications/Extensions Simon Hausmann &gt;hausmann@kde.org&lt;
14 * Minor updates Richard J. Moore &gt;rich@kde.org&lt;
15 * Conversion to XSD (c) 2004 Frans Englich &lt;frans.englich@telia.com&gt;
17 Permission to use, copy, modify and distribute this XSD
18 and its accompanying documentation for any purpose and without fee
19 is hereby granted in perpetuity, provided that the above copyright
20 notice and this paragraph appear in all copies. The copyright
21 holders make no representation about the suitability of the XSD for
22 any purpose. It is provided "as is" without expressed or implied
23 warranty.
25 </xsd:documentation>
26 </xsd:annotation>
27 <xsd:annotation>
28 <xsd:documentation>
30 This is the XML Schema for KDE's XMLGUI framework, a way of describing a
31 application's Graphical User Interface in an XML file.
33 A document of this Schema should have a declaration
34 looking like this:
36 <![CDATA[
38 <?xml version="1.0" encoding="UTF-8" ?>
39 <gui name=""
40 version=""
41 xmlns="http://www.kde.org/standards/kxmlgui/1.0"
42 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
43 xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0
44 http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd" >
45 <!-- the content -->
46 </gui>
48 ]]>
50 Where the name and version tag is of your taste.
52 </xsd:documentation>
53 </xsd:annotation>
55 <xsd:simpleType name="identifier">
56 <xsd:annotation>
57 <xsd:documentation>
59 The name used for every name and group attribute. Maps to QObject::name() in most cases.
60 </xsd:documentation>
61 </xsd:annotation>
62 <xsd:restriction base="xsd:Name">
63 <!-- TODO Restrict harder, perhaps? -->
64 </xsd:restriction>
65 </xsd:simpleType>
67 <xsd:element name="Separator">
68 <xsd:annotation>
69 <xsd:documentation>
71 Inserts a separator item into a menubar or toolbar.
73 </xsd:documentation>
74 </xsd:annotation>
75 <xsd:complexType>
76 <xsd:attribute name="lineSeparator" default="true" type="xsd:boolean"/>
77 <xsd:attribute name="weakSeparator" default="true" type="xsd:boolean"/>
78 <xsd:attribute name="group" type="identifier"/>
79 </xsd:complexType>
80 </xsd:element>
82 <xsd:element name="Merge">
83 <xsd:complexType>
84 <xsd:attribute name="name" type="identifier" use="optional" />
85 </xsd:complexType>
86 <!-- Merge, MergeLocal and other more exotic elements are everywhere. Cannot more than one(etc.) occur in the various places, such as Menu? Needs fixing then - better restriction on how many of those elements that can appear where. -->
87 </xsd:element>
89 <xsd:element name="MergeLocal">
90 <xsd:annotation>
91 <xsd:documentation>
93 Specifies an entry index for merging application defined actions into
94 those with positions fixed by the style guide and ui_standards.rc. This
95 tag should not be used anywhere except ui_standards.rc.
97 </xsd:documentation>
98 </xsd:annotation>
99 <xsd:complexType>
100 <xsd:attribute name="name" type="identifier" use="optional" />
101 </xsd:complexType>
102 </xsd:element>
104 <xsd:element name="DefineGroup">
105 <xsd:annotation>
106 <xsd:documentation>
108 Specifies a entry index for merging, similar to the Merge tag, but with a
109 global scope and accessible via the group attribute of other tags.
111 </xsd:documentation>
112 </xsd:annotation>
113 <xsd:complexType>
114 <xsd:attribute name="name" type="identifier" />
115 </xsd:complexType>
116 <!-- TODO: Needs to be checked if it is allowed proper amounts of times, in those places it's used. -->
117 </xsd:element>
119 <xsd:complexType name="caption">
120 <xsd:simpleContent>
121 <xsd:annotation>
122 <xsd:documentation>
124 The user visible string shown as titles.
126 </xsd:documentation>
127 </xsd:annotation>
128 <xsd:extension base="xsd:string"/>
129 </xsd:simpleContent>
132 </xsd:complexType>
134 <xsd:element name="Action" >
135 <xsd:complexType >
136 <xsd:annotation>
137 <xsd:documentation>
139 Defines both Standard and app-specific actions. An action can appear
140 in a menu, a toolbar or in a menubar.
141 Attributes:
142 - name of the action: this is matched with the KAction name.
143 - group: this is used to control the placement of the action when
144 merging e.g. a part, it matches the name of a DefineGroup in the
145 mainwindow's rc file.
146 - append: this is used to control the placement of the action during
147 the merging with ui_standards.rc. This is mapped to MergeLocal tags
148 there. Note that this feature is currently only available for the
149 mainwindow, not for parts/plugins.
150 - text, whatsThis, toolTip, shortText, shortcut, icon: all those are
151 mapped to KAction properties.
154 </xsd:documentation>
155 </xsd:annotation>
157 <xsd:attribute name="name" type="identifier"/>
158 <xsd:attribute name="group" type="identifier" use="optional" />
159 <xsd:attribute name="append" type="identifier" use="optional" />
160 <xsd:attribute name="text" type="xsd:string" use="optional"/>
161 <xsd:attribute name="whatsThis" type="xsd:string" use="optional"/>
162 <xsd:attribute name="toolTip" type="xsd:string" use="optional"/>
163 <xsd:attribute name="shortText" type="xsd:string" use="optional"/>
164 <xsd:attribute name="shortcut" type="xsd:string" use="optional">
165 <!-- TODO: Restrict the possible values with enumeration, or regexp -->
166 </xsd:attribute>
167 <xsd:attribute name="icon" type="xsd:string" use="optional" />
168 </xsd:complexType>
169 </xsd:element>
171 <xsd:element name="ActionList">
172 <xsd:annotation>
173 <xsd:documentation>
175 Specifies a dynamic list of actions, each of which can be changed by
176 plugging/unplugging it
178 </xsd:documentation>
179 </xsd:annotation>
180 <xsd:complexType>
181 <xsd:attribute name="name" type="identifier"/>
182 </xsd:complexType>
183 </xsd:element>
185 <xsd:complexType name="state">
186 <xsd:sequence>
187 <xsd:element maxOccurs="unbounded" ref="Action"/>
188 </xsd:sequence>
189 <xsd:attribute name="name" type="identifier" />
190 </xsd:complexType>
192 <xsd:element name="Menu">
193 <xsd:complexType>
194 <xsd:annotation>
195 <xsd:documentation>
197 A Menu such as the &quot;File&quot; or &quot;Edit&quot; menu. Can be used to define popup
198 menus as well.
200 </xsd:documentation>
201 </xsd:annotation>
202 <xsd:choice maxOccurs="unbounded" >
203 <!-- TODO: What's the difference between text and title? Which one(s) are required? The whole Menu is a mess. Fix maxOccurs, minOccurs for all of them. -->
204 <xsd:element minOccurs="0" name="text" type="caption" />
205 <xsd:element minOccurs="0" name="title" type="caption" />
207 <xsd:element ref="Action" maxOccurs="unbounded" />
208 <xsd:element ref="ActionList" maxOccurs="unbounded" />
210 <xsd:element minOccurs="0" maxOccurs="unbounded" name="TearOffHandle">
211 <xsd:complexType>
212 <xsd:attribute name="group" type="identifier"/>
213 </xsd:complexType>
214 </xsd:element>
216 <xsd:element minOccurs="0" maxOccurs="unbounded" name="DefineGroup">
217 <xsd:complexType>
218 <xsd:attribute name="name" type="identifier"/>
219 </xsd:complexType>
220 </xsd:element>
221 <xsd:element minOccurs="0" maxOccurs="unbounded" name="MergeLocal">
222 <xsd:complexType>
223 <xsd:attribute name="name" type="identifier" use="optional" />
224 </xsd:complexType>
225 </xsd:element>
226 <xsd:element minOccurs="0" maxOccurs="unbounded" ref="Separator" />
227 <xsd:element minOccurs="0" maxOccurs="unbounded" ref="Menu" />
228 <xsd:element minOccurs="0" maxOccurs="unbounded" name="Merge" />
230 </xsd:choice>
231 <xsd:attribute name="name" type="identifier"/>
232 <xsd:attribute name="append" type="identifier" use="optional" />
233 <xsd:attribute name="group" type="identifier" use="optional" />
234 <xsd:attribute name="icon" type="xsd:string" use="optional" />
235 <xsd:attribute name="noMerge" type="xsd:boolean" use="optional" />
236 </xsd:complexType>
237 </xsd:element>
240 <xsd:element name="gui">
241 <xsd:annotation>
242 <xsd:documentation>
244 The root element that must enclose all other tags in the document. This
245 element replaces the kpartgui element used previously.
246 Note: do not forget to increase the version attribute for each change in
247 your file, otherwise the changes will not be taken into account.
250 </xsd:documentation>
251 </xsd:annotation>
253 <xsd:complexType>
254 <xsd:sequence>
256 <!-- TODO: Menu is allowed in gui, as per the original DTD. Why is it so? Shouldn't Menu only be in Menubar? If this is about Popup/Regular menu distinction, then should probably different complexTypes be used, if it's possible to separate the two. Perhaps a popupMenu element in gui could be allowed, which is no where else. -->
257 <xsd:element ref="Menu" maxOccurs="unbounded" minOccurs="0"/>
258 <xsd:element name="MenuBar">
259 <xsd:complexType>
261 <xsd:sequence>
262 <xsd:element ref="Menu" minOccurs="0" maxOccurs="unbounded"/>
263 <xsd:element ref="Separator" minOccurs="0" maxOccurs="0" />
264 <xsd:element ref="Action" minOccurs="0" maxOccurs="unbounded" />
265 <xsd:element ref="ActionList" minOccurs="0" maxOccurs="unbounded" />
266 <xsd:element ref="Merge" minOccurs="0" maxOccurs="unbounded"/>
267 <xsd:element ref="MergeLocal" minOccurs="0" maxOccurs="unbounded"/>
268 <xsd:element ref="DefineGroup" minOccurs="0" maxOccurs="unbounded"/>
269 <!-- TODO:
270 - Why is ActionList and Action in MenuBar?
271 - Check that min/maxOccurs is correct
273 </xsd:sequence>
275 <xsd:attribute name="name" type="identifier" use="optional" />
276 <xsd:attribute name="group" type="identifier" use="optional" />
277 </xsd:complexType>
278 </xsd:element>
281 <xsd:element name="ToolBar" minOccurs="0" maxOccurs="unbounded" >
282 <xsd:annotation>
283 <xsd:documentation>
285 A tool bar. Attributes:
287 - name: a unique name for the toolbar, use mainToolBar for
288 the main one
290 - fullWidth: if true (default), the toolbar extends to the
291 full width of the window
293 - position: the position of the toolbar in the window
294 - iconText: whether to show icon or text or both
295 - iconSize: the size of the icons (0 for default, or usually
296 22 or 32)
298 - index: the index in the toolbar dock (see
299 QMainWindow::moveToolBar)
301 - offset: the X offset in the toolbar dock (see
302 QMainWindow::moveToolBar)
304 TODO: Those APIs are obsolete, are the attribute too?
306 - newline: if true, this toolbar will start a new line (i.e.
307 under the ones before it).
309 - group: optional group name, for named merging (?)
311 - hidden: if true, the toolbar is initially hidden. There
312 should be a menu entry for showing it.
314 - noEdit: if true, the toolbar won't appear in the toolbar
315 editor
317 </xsd:documentation>
318 </xsd:annotation>
319 <xsd:complexType>
320 <xsd:choice maxOccurs="unbounded" >
321 <xsd:element name="text" type="caption" />
322 <xsd:element ref="Action" minOccurs="0" maxOccurs="unbounded" />
323 <!-- Should 0 ActionS really be allowed? konqueror.rc does it.. -->
324 <xsd:element ref="Separator" minOccurs="0" maxOccurs="unbounded" />
325 <xsd:element ref="ActionList" minOccurs="0" maxOccurs="unbounded" />
326 <xsd:element ref="Merge" minOccurs="0" />
327 <xsd:element ref="MergeLocal" minOccurs="0" />
328 <xsd:element ref="DefineGroup" minOccurs="0" />
329 </xsd:choice>
331 <xsd:attribute name="name" type="identifier" />
332 <xsd:attribute name="fullWidth" use="optional" type="xsd:boolean" default="true" />
333 <xsd:attribute name="position" use="optional" >
334 <xsd:simpleType>
335 <xsd:restriction base="xsd:string">
336 <xsd:enumeration value="top" />
337 <xsd:enumeration value="bottom" />
338 <xsd:enumeration value="left" />
339 <xsd:enumeration value="right" />
340 </xsd:restriction>
341 </xsd:simpleType>
342 </xsd:attribute>
343 <xsd:attribute name="iconText" use="optional" >
344 <xsd:simpleType>
345 <xsd:restriction base="xsd:string">
346 <xsd:enumeration value="icontextright" />
347 <xsd:enumeration value="icontextbottom" />
348 <xsd:enumeration value="textonly" />
349 <xsd:enumeration value="icononly" />
350 </xsd:restriction>
351 </xsd:simpleType>
352 </xsd:attribute>
353 <xsd:attribute name="iconSize" use="optional" >
354 <xsd:simpleType>
355 <xsd:restriction base="xsd:nonNegativeInteger">
356 <!-- TODO: This restriction is correct, right? -->
357 <xsd:enumeration value="0" /><!-- Implies default -->
358 <xsd:enumeration value="16" />
359 <xsd:enumeration value="22" />
360 <xsd:enumeration value="32" />
361 <xsd:enumeration value="48" />
362 <xsd:enumeration value="64" />
363 <xsd:enumeration value="128" />
364 </xsd:restriction>
365 </xsd:simpleType>
366 </xsd:attribute>
368 <!-- TODO: Since these are positiveInteger, and not nonNegativeInteger, they can't be 0 -->
369 <xsd:attribute name="index" use="optional" type="xsd:positiveInteger"/>
370 <xsd:attribute name="offset" use="optional" type="xsd:positiveInteger"/>
371 <xsd:attribute name="newline" use="optional" default="false" type="xsd:boolean" />
372 <xsd:attribute name="hidden" use="optional" default="false" type="xsd:boolean"/>
373 <xsd:attribute name="noEdit" use="optional" default="false" type="xsd:boolean"/>
374 </xsd:complexType>
375 </xsd:element>
376 <xsd:element minOccurs="0" name="State">
377 <!-- Where should this be? -->
378 <xsd:annotation>
379 <xsd:documentation>
381 Defines a GUI state, esp. which actions to enable and which
382 ones to disable on entering this state (see
383 KXMLGUIClient::stateChanged()).
385 Actions listed in &quot;disable&quot; are disabled, and vice
386 versa for &quot;enable&quot;.
388 </xsd:documentation>
389 </xsd:annotation>
390 <xsd:complexType>
391 <xsd:choice>
392 <!-- ( enable, disable? ) | ( disable, enable? ) -->
393 <xsd:sequence>
394 <xsd:element name="enable" type="state" />
395 <xsd:element minOccurs="0" name="disable" type="state" />
396 </xsd:sequence>
397 <xsd:sequence>
398 <xsd:element name="disable" type="state" />
399 <xsd:element minOccurs="0" name="enable" type="state" />
400 </xsd:sequence>
401 </xsd:choice>
402 <xsd:attribute name="name" type="identifier"/>
403 </xsd:complexType>
404 </xsd:element>
406 <xsd:element name="ActionProperties" minOccurs="0" >
407 <xsd:annotation>
408 <xsd:documentation>
410 Allows standard actions to be customized.
412 </xsd:documentation>
413 </xsd:annotation>
414 <xsd:complexType>
415 <xsd:sequence>
416 <xsd:element ref="Action" maxOccurs="unbounded" />
417 </xsd:sequence>
418 </xsd:complexType>
419 </xsd:element>
421 </xsd:sequence>
423 <!-- Not used nor referenced. Yet.
424 <xsd:element name="MainWindow"/>
425 <xsd:element name="StatusBar" />
428 <xsd:attribute name="name" type="identifier"/>
429 <xsd:attribute name="version" type="xsd:positiveInteger" />
430 <xsd:attribute name="library" type="identifier" use="optional" />
431 </xsd:complexType>
432 </xsd:element>
433 </xsd:schema>