1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
A library to allow applications to provide simple indications of
information to be displayed to users of the application through the
interface shell.
Copyright 2009 Canonical Ltd.
Authors:
Ted Gould <ted@canonical.com>
Aurélien Gâteau <aurelien.gateau@canonical.com>
This program is free software: you can redistribute it and/or modify it
under the terms of either or both of the following licenses:
1) the GNU Lesser General Public License version 3, as published by the
Free Software Foundation; and/or
2) the GNU Lesser General Public License version 2.1, as published by
the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranties of
MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
PURPOSE. See the applicable version of the GNU Lesser General Public
License for more details.
You should have received a copy of both the GNU Lesser General Public
License version 3 and version 2.1 along with this program. If not, see
<http://www.gnu.org/licenses/>
-->
<node name="/" xmlns:dox="http://www.canonical.com/dbus/dox.dtd">
<dox:d><![CDATA[
@mainpage
The goal of DBusMenu is to expose menus on DBus.
Main interface is documented here: @ref com::canonical::dbusmenu
]]></dox:d>
<interface name="com.canonical.dbusmenu">
<dox:d><![CDATA[
A DBus interface to expose menus on DBus.
Menu items are represented with a unique numeric id and a dictionary of
properties.
To reduce the amount of DBus traffic, a property should only be returned
if its value is not the default value.
Available properties are:
<table>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Default Value</th>
</tr>
<tr>
<td>type</td>
<td>String</td>
<td>Can be one of:
- "standard": an item which can be clicked to trigger an action or
show another menu
- "separator": a separator
Vendor specific types can be added by prefixing them with
"x-<vendor>-".
</td>
<td>"standard"</td>
</tr>
<tr>
<td>label</td>
<td>string</td>
<td>Text of the item, except that:
-# two consecutive underscore characters "__" are displayed as a
single underscore,
-# any remaining underscore characters are not displayed at all,
-# the first of those remaining underscore characters (unless it is
the last character in the string) indicates that the following
character is the access key.
</td>
<td>""</td>
</tr>
<tr>
<td>enabled</td>
<td>boolean</td>
<td>Whether the item can be activated or not.</td>
<td>true</td>
</tr>
<tr>
<td>visible</td>
<td>boolean</td>
<td>True if the item is visible in the menu.</td>
<td>true</td>
</tr>
<tr>
<td>icon-name</td>
<td>string</td>
<td>Icon name of the item, following the freedesktop.org icon spec.</td>
<td>""</td>
</tr>
<tr>
<td>icon-data</td>
<td>binary</td>
<td>PNG data of the icon.</td>
<td>Empty</td>
</tr>
<tr>
<td>shortcut</td>
<td>array of arrays of strings</td>
<td>The shortcut of the item. Each array represents the key press
in the list of keypresses. Each list of strings contains a list of
modifiers and then the key that is used. The modifier strings
allowed are: "Control", "Alt", "Shift" and "Super".
- A simple shortcut like Ctrl+S is represented as:
[["Control", "S"]]
- A complex shortcut like Ctrl+Q, Alt+X is represented as:
[["Control", "Q"], ["Alt", "X"]]</td>
<td>Empty</td>
</tr>
<tr>
<td>toggle-type</td>
<td>string</td>
<td>
If the item can be toggled, this property should be set to:
- "checkmark": Item is an independent togglable item
- "radio": Item is part of a group where only one item can be
toggled at a time
- "": Item cannot be toggled
</td>
<td>""</td>
</tr>
<tr>
<td>toggle-state</td>
<td>int</td>
<td>
Describe the current state of a "togglable" item. Can be one of:
- 0 = off
- 1 = on
- anything else = indeterminate
Note:
The implementation does not itself handle ensuring that only one
item in a radio group is set to "on", or that a group does not have
"on" and "indeterminate" items simultaneously; maintaining this
policy is up to the toolkit wrappers.
</td>
<td>-1</td>
</tr>
<tr>
<td>children-display</td>
<td>string</td>
<td>
If the menu item has children this property should be set to
"submenu".
</td>
<td>""</td>
</tr>
</table>
Vendor specific properties can be added by prefixing them with
"x-<vendor>-".
]]></dox:d>
<!-- Properties -->
<property name="version" type="u" access="read">
<dox:d>
Provides the version of the DBusmenu API that this API is
implementing.
</dox:d>
</property>
<!-- Functions -->
<method name="GetLayout">
<dox:d>
Provides the layout and propertiers that are attached to the entries
that are in the layout. It only gives the items that are children
of the item that is specified in @parentId. It will return all of the
properties or specific ones depending of the value in @propertyNames.
The format is recursive, where the second 'v' is in the same format
as the original 'a(ia(sv)a(v))'. If the @recursive flag is set to
less than one then the second array will have zero entries.
</dox:d>
<arg type="i" name="parentId" direction="in">
<dox:d>The ID of the parent node for the layout. For
grabbing the layout from the root node use zero.</dox:d>
</arg>
<arg type="i" name="recurse" direction="in">
<dox:d>
The amount of levels of recursion to use. -1, as value would
deliver all the items under the @parentId.
</dox:d>
</arg>
<arg type="as" name="propertyNames" direction="in" >
<dox:d>
The list of item properties we are
interested in. If there are no entries in the list all of
the properties will be sent.
</dox:d>
</arg>
<arg type="u" name="revision" direction="out">
<dox:d>The revision number of the layout. For matching
with layoutUpdated signals.</dox:d>
</arg>
<arg type="(ia{sv}av)" name="layout" direction="out">
<dox:d>The layout as an XML string of IDs.</dox:d>
</arg>
</method>
<method name="GetGroupProperties">
<annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="QVariantList"/>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="DBusMenuItemList"/>
<dox:d>
Returns the list of items which are children of @a parentId.
</dox:d>
<arg type="ai" name="ids" direction="in" >
<dox:d>
A list of ids that we should be finding the properties
on. If the list is empty, all menu items should be sent.
</dox:d>
</arg>
<arg type="as" name="propertyNames" direction="in" >
<dox:d>
The list of item properties we are
interested in. If there are no entries in the list all of
the properties will be sent.
</dox:d>
</arg>
<arg type="a(ia{sv})" name="properties" direction="out" >
<dox:d>
An array of property values.
An item in this area is represented as a struct following
this format:
@li id unsigned the item id
@li properties map(string => variant) the requested item properties
</dox:d>
</arg>
</method>
<method name="GetProperty">
<dox:d>
Get a signal property on a single item. This is not useful if you're
going to implement this interface, it should only be used if you're
debugging via a commandline tool.
</dox:d>
<arg type="i" name="id" direction="in">
<dox:d>the id of the item which received the event</dox:d>
</arg>
<arg type="s" name="name" direction="in">
<dox:d>the name of the property to get</dox:d>
</arg>
<arg type="v" name="value" direction="out">
<dox:d>the value of the property</dox:d>
</arg>
</method>
<method name="Event">
<dox:d><![CDATA[
This is called by the applet to notify the application an event happened on a
menu item.
@a type can be one of the following:
@li "clicked"
@li "hovered"
Vendor specific events can be added by prefixing them with "x-<vendor>-"
]]></dox:d>
<arg type="i" name="id" direction="in" >
<dox:d>the id of the item which received the event</dox:d>
</arg>
<arg type="s" name="eventId" direction="in" >
<dox:d>the type of event</dox:d>
</arg>
<arg type="v" name="data" direction="in" >
<dox:d>event-specific data</dox:d>
</arg>
<arg type="u" name="timestamp" direction="in" >
<dox:d>The time that the event occured if available or the time the message was sent if not</dox:d>
</arg>
</method>
<method name="AboutToShow">
<dox:d>
This is called by the applet to notify the application that it is about
to show the menu under the specified item.
</dox:d>
<arg type="i" name="id" direction="in">
<dox:d>
Which menu item represents the parent of the item about to be shown.
</dox:d>
</arg>
<arg type="b" name="needUpdate" direction="out">
<dox:d>
Whether this AboutToShow event should result in the menu being updated.
</dox:d>
</arg>
</method>
<!-- Signals -->
<signal name="ItemsPropertiesUpdated">
<dox:d>
Triggered when there are lots of property updates across many items
so they all get grouped into a single dbus message. The format is
the ID of the item with a hashtable of names and values for those
properties.
</dox:d>
<arg type="a(ia(sv))" name="props" direction="out" />
<arg type="a(ia(s))" name="props_removed" direction="out" />
</signal>
<signal name="LayoutUpdated">
<dox:d>
Triggered by the application to notify display of a layout update, up to
revision
</dox:d>
<arg type="u" name="revision" direction="out" >
<dox:d>The revision of the layout that we're currently on</dox:d>
</arg>
<arg type="i" name="parent" direction="out" >
<dox:d>
If the layout update is only of a subtree, this is the
parent item for the entries that have changed. It is zero if
the whole layout should be considered invalid.
</dox:d>
</arg>
</signal>
<signal name="ItemActivationRequested">
<dox:d>
The server is requesting that all clients displaying this
menu open it to the user. This would be for things like
hotkeys that when the user presses them the menu should
open and display itself to the user.
</dox:d>
<arg type="i" name="id" direction="out" >
<dox:d>ID of the menu that should be activated</dox:d>
</arg>
<arg type="u" name="timestamp" direction="out" >
<dox:d>The time that the event occured</dox:d>
</arg>
</signal>
<!-- End of interesting stuff -->
</interface>
</node>
|