dbusmenu-qt  0.9.2
 All Classes Functions Pages
dbusmenuadaptor.h
1 /*
2  * This file was generated by qdbusxml2cpp version 0.7
3  * Command line was: qdbusxml2cpp -m -a dbusmenuadaptor -i /tmp/builds/libdbusmenu-qt/tmp/libdbusmenu-qt-0.9.2/src/dbusmenuexporterdbus_p.h -l DBusMenuExporterDBus /tmp/builds/libdbusmenu-qt/tmp/libdbusmenu-qt-0.9.2/src/com.canonical.dbusmenu.xml
4  *
5  * qdbusxml2cpp is Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
6  *
7  * This is an auto-generated file.
8  * This file may have been hand-edited. Look for HAND-EDIT comments
9  * before re-generating it.
10  */
11 
12 #ifndef DBUSMENUADAPTOR_H_1398994713
13 #define DBUSMENUADAPTOR_H_1398994713
14 
15 #include <QtCore/QObject>
16 #include <QtDBus/QtDBus>
17 #include "/tmp/builds/libdbusmenu-qt/tmp/libdbusmenu-qt-0.9.2/src/dbusmenuexporterdbus_p.h"
18 class QByteArray;
19 template<class T> class QList;
20 template<class Key, class Value> class QMap;
21 class QString;
22 class QStringList;
23 class QVariant;
24 
25 /*
26  * Adaptor class for interface com.canonical.dbusmenu
27  */
28 class DbusmenuAdaptor: public QDBusAbstractAdaptor
29 {
30  Q_OBJECT
31  Q_CLASSINFO("D-Bus Interface", "com.canonical.dbusmenu")
32  Q_CLASSINFO("D-Bus Introspection", ""
33 " <interface name=\"com.canonical.dbusmenu\">\n"
34 " <dox:d><![CDATA[\n"
35 " A DBus interface to expose menus on DBus.\n"
36 "\n"
37 " Menu items are represented with a unique numeric id and a dictionary of\n"
38 " properties.\n"
39 "\n"
40 " To reduce the amount of DBus traffic, a property should only be returned\n"
41 " if its value is not the default value.\n"
42 "\n"
43 " Available properties are:\n"
44 "\n"
45 " <table>\n"
46 " <tr>\n"
47 " <th>Name</th>\n"
48 " <th>Type</th>\n"
49 " <th>Description</th>\n"
50 " <th>Default Value</th>\n"
51 " </tr>\n"
52 " <tr>\n"
53 " <td>type</td>\n"
54 " <td>String</td>\n"
55 " <td>Can be one of:\n"
56 " - \"standard\": an item which can be clicked to trigger an action or\n"
57 " show another menu\n"
58 " - \"separator\": a separator\n"
59 "\n"
60 " Vendor specific types can be added by prefixing them with\n"
61 " \"x-<vendor>-\".\n"
62 " </td>\n"
63 " <td>\"standard\"</td>\n"
64 " </tr>\n"
65 " <tr>\n"
66 " <td>label</td>\n"
67 " <td>string</td>\n"
68 " <td>Text of the item, except that:\n"
69 " -# two consecutive underscore characters \"__\" are displayed as a\n"
70 " single underscore,\n"
71 " -# any remaining underscore characters are not displayed at all,\n"
72 " -# the first of those remaining underscore characters (unless it is\n"
73 " the last character in the string) indicates that the following\n"
74 " character is the access key.\n"
75 " </td>\n"
76 " <td>\"\"</td>\n"
77 " </tr>\n"
78 " <tr>\n"
79 " <td>enabled</td>\n"
80 " <td>boolean</td>\n"
81 " <td>Whether the item can be activated or not.</td>\n"
82 " <td>true</td>\n"
83 " </tr>\n"
84 " <tr>\n"
85 " <td>visible</td>\n"
86 " <td>boolean</td>\n"
87 " <td>True if the item is visible in the menu.</td>\n"
88 " <td>true</td>\n"
89 " </tr>\n"
90 " <tr>\n"
91 " <td>icon-name</td>\n"
92 " <td>string</td>\n"
93 " <td>Icon name of the item, following the freedesktop.org icon spec.</td>\n"
94 " <td>\"\"</td>\n"
95 " </tr>\n"
96 " <tr>\n"
97 " <td>icon-data</td>\n"
98 " <td>binary</td>\n"
99 " <td>PNG data of the icon.</td>\n"
100 " <td>Empty</td>\n"
101 " </tr>\n"
102 " <tr>\n"
103 " <td>shortcut</td>\n"
104 " <td>array of arrays of strings</td>\n"
105 " <td>The shortcut of the item. Each array represents the key press\n"
106 " in the list of keypresses. Each list of strings contains a list of\n"
107 " modifiers and then the key that is used. The modifier strings\n"
108 " allowed are: \"Control\", \"Alt\", \"Shift\" and \"Super\".\n"
109 "\n"
110 " - A simple shortcut like Ctrl+S is represented as:\n"
111 " [[\"Control\", \"S\"]]\n"
112 " - A complex shortcut like Ctrl+Q, Alt+X is represented as:\n"
113 " [[\"Control\", \"Q\"], [\"Alt\", \"X\"]]</td>\n"
114 " <td>Empty</td>\n"
115 " </tr>\n"
116 " <tr>\n"
117 " <td>toggle-type</td>\n"
118 " <td>string</td>\n"
119 " <td>\n"
120 " If the item can be toggled, this property should be set to:\n"
121 " - \"checkmark\": Item is an independent togglable item\n"
122 " - \"radio\": Item is part of a group where only one item can be\n"
123 " toggled at a time\n"
124 " - \"\": Item cannot be toggled\n"
125 " </td>\n"
126 " <td>\"\"</td>\n"
127 " </tr>\n"
128 " <tr>\n"
129 " <td>toggle-state</td>\n"
130 " <td>int</td>\n"
131 " <td>\n"
132 " Describe the current state of a \"togglable\" item. Can be one of:\n"
133 " - 0 = off\n"
134 " - 1 = on\n"
135 " - anything else = indeterminate\n"
136 "\n"
137 " Note:\n"
138 " The implementation does not itself handle ensuring that only one\n"
139 " item in a radio group is set to \"on\", or that a group does not have\n"
140 " \"on\" and \"indeterminate\" items simultaneously; maintaining this\n"
141 " policy is up to the toolkit wrappers.\n"
142 " </td>\n"
143 " <td>-1</td>\n"
144 " </tr>\n"
145 " <tr>\n"
146 " <td>children-display</td>\n"
147 " <td>string</td>\n"
148 " <td>\n"
149 " If the menu item has children this property should be set to\n"
150 " \"submenu\".\n"
151 " </td>\n"
152 " <td>\"\"</td>\n"
153 " </tr>\n"
154 " </table>\n"
155 "\n"
156 " Vendor specific properties can be added by prefixing them with\n"
157 " \"x-<vendor>-\".\n"
158 " ]]></dox:d>\n"
159 " <!-- Properties -->\n"
160 " <property access=\"read\" type=\"u\" name=\"Version\">\n"
161 " <dox:d>\n"
162 " Provides the version of the DBusmenu API that this API is\n"
163 " implementing.\n"
164 " </dox:d>\n"
165 " </property>\n"
166 " <property access=\"read\" type=\"s\" name=\"Status\">\n"
167 " <dox:d>\n"
168 " Tells if the menus are in a normal state or they believe that they\n"
169 " could use some attention. Cases for showing them would be if help\n"
170 " were referring to them or they accessors were being highlighted.\n"
171 " This property can have two values: \"normal\" in almost all cases and\n"
172 " \"notice\" when they should have a higher priority to be shown.\n"
173 " </dox:d>\n"
174 " </property>\n"
175 " <!-- Functions -->\n"
176 " <method name=\"GetLayout\">\n"
177 " <annotation value=\"DBusMenuLayoutItem\" name=\"com.trolltech.QtDBus.QtTypeName.Out1\"/>\n"
178 " <dox:d>\n"
179 " Provides the layout and propertiers that are attached to the entries\n"
180 " that are in the layout. It only gives the items that are children\n"
181 " of the item that is specified in @a parentId. It will return all of the\n"
182 " properties or specific ones depending of the value in @a propertyNames.\n"
183 "\n"
184 " The format is recursive, where the second 'v' is in the same format\n"
185 " as the original 'a(ia{sv}av)'. Its content depends on the value\n"
186 " of @a recursionDepth.\n"
187 " </dox:d>\n"
188 " <arg direction=\"in\" type=\"i\" name=\"parentId\">\n"
189 " <dox:d>The ID of the parent node for the layout. For\n"
190 " grabbing the layout from the root node use zero.</dox:d>\n"
191 " </arg>\n"
192 " <arg direction=\"in\" type=\"i\" name=\"recursionDepth\">\n"
193 " <dox:d>\n"
194 " The amount of levels of recursion to use. This affects the\n"
195 " content of the second variant array.\n"
196 " - -1: deliver all the items under the @a parentId.\n"
197 " - 0: no recursion, the array will be empty.\n"
198 " - n: array will contains items up to 'n' level depth.\n"
199 " </dox:d>\n"
200 " </arg>\n"
201 " <arg direction=\"in\" type=\"as\" name=\"propertyNames\">\n"
202 " <dox:d>\n"
203 " The list of item properties we are\n"
204 " interested in. If there are no entries in the list all of\n"
205 " the properties will be sent.\n"
206 " </dox:d>\n"
207 " </arg>\n"
208 " <arg direction=\"out\" type=\"u\" name=\"revision\">\n"
209 " <dox:d>The revision number of the layout. For matching\n"
210 " with layoutUpdated signals.</dox:d>\n"
211 " </arg>\n"
212 " <arg direction=\"out\" type=\"(ia{sv}av)\" name=\"layout\">\n"
213 " <dox:d>The layout, as a recursive structure.</dox:d>\n"
214 " </arg>\n"
215 " </method>\n"
216 " <method name=\"GetGroupProperties\">\n"
217 " <annotation value=\"QList&lt;int>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
218 " <annotation value=\"DBusMenuItemList\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
219 " <dox:d>\n"
220 " Returns the list of items which are children of @a parentId.\n"
221 " </dox:d>\n"
222 " <arg direction=\"in\" type=\"ai\" name=\"ids\">\n"
223 " <dox:d>\n"
224 " A list of ids that we should be finding the properties\n"
225 " on. If the list is empty, all menu items should be sent.\n"
226 " </dox:d>\n"
227 " </arg>\n"
228 " <arg direction=\"in\" type=\"as\" name=\"propertyNames\">\n"
229 " <dox:d>\n"
230 " The list of item properties we are\n"
231 " interested in. If there are no entries in the list all of\n"
232 " the properties will be sent.\n"
233 " </dox:d>\n"
234 " </arg>\n"
235 " <arg direction=\"out\" type=\"a(ia{sv})\" name=\"properties\">\n"
236 " <dox:d>\n"
237 " An array of property values.\n"
238 " An item in this area is represented as a struct following\n"
239 " this format:\n"
240 " @li id unsigned the item id\n"
241 " @li properties map(string => variant) the requested item properties\n"
242 " </dox:d>\n"
243 " </arg>\n"
244 " </method>\n"
245 " <method name=\"GetProperty\">\n"
246 " <dox:d>\n"
247 " Get a signal property on a single item. This is not useful if you're\n"
248 " going to implement this interface, it should only be used if you're\n"
249 " debugging via a commandline tool.\n"
250 " </dox:d>\n"
251 " <arg direction=\"in\" type=\"i\" name=\"id\">\n"
252 " <dox:d>the id of the item which received the event</dox:d>\n"
253 " </arg>\n"
254 " <arg direction=\"in\" type=\"s\" name=\"name\">\n"
255 " <dox:d>the name of the property to get</dox:d>\n"
256 " </arg>\n"
257 " <arg direction=\"out\" type=\"v\" name=\"value\">\n"
258 " <dox:d>the value of the property</dox:d>\n"
259 " </arg>\n"
260 " </method>\n"
261 " <method name=\"Event\">\n"
262 " <dox:d><![CDATA[\n"
263 " This is called by the applet to notify the application an event happened on a\n"
264 " menu item.\n"
265 "\n"
266 " @a type can be one of the following:\n"
267 "\n"
268 " @li \"clicked\"\n"
269 " @li \"hovered\"\n"
270 "\n"
271 " Vendor specific events can be added by prefixing them with \"x-<vendor>-\"\n"
272 " ]]></dox:d>\n"
273 " <arg direction=\"in\" type=\"i\" name=\"id\">\n"
274 " <dox:d>the id of the item which received the event</dox:d>\n"
275 " </arg>\n"
276 " <arg direction=\"in\" type=\"s\" name=\"eventId\">\n"
277 " <dox:d>the type of event</dox:d>\n"
278 " </arg>\n"
279 " <arg direction=\"in\" type=\"v\" name=\"data\">\n"
280 " <dox:d>event-specific data</dox:d>\n"
281 " </arg>\n"
282 " <arg direction=\"in\" type=\"u\" name=\"timestamp\">\n"
283 " <dox:d>The time that the event occured if available or the time the message was sent if not</dox:d>\n"
284 " </arg>\n"
285 " </method>\n"
286 " <method name=\"AboutToShow\">\n"
287 " <dox:d>\n"
288 " This is called by the applet to notify the application that it is about\n"
289 " to show the menu under the specified item.\n"
290 " </dox:d>\n"
291 " <arg direction=\"in\" type=\"i\" name=\"id\">\n"
292 " <dox:d>\n"
293 " Which menu item represents the parent of the item about to be shown.\n"
294 " </dox:d>\n"
295 " </arg>\n"
296 " <arg direction=\"out\" type=\"b\" name=\"needUpdate\">\n"
297 " <dox:d>\n"
298 " Whether this AboutToShow event should result in the menu being updated.\n"
299 " </dox:d>\n"
300 " </arg>\n"
301 " </method>\n"
302 " <!-- Signals -->\n"
303 " <signal name=\"ItemsPropertiesUpdated\">\n"
304 " <annotation value=\"DBusMenuItemList\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
305 " <annotation value=\"DBusMenuItemKeysList\" name=\"com.trolltech.QtDBus.QtTypeName.In1\"/>\n"
306 " <dox:d>\n"
307 " Triggered when there are lots of property updates across many items\n"
308 " so they all get grouped into a single dbus message. The format is\n"
309 " the ID of the item with a hashtable of names and values for those\n"
310 " properties.\n"
311 " </dox:d>\n"
312 " <arg direction=\"out\" type=\"a(ia{sv})\" name=\"updatedProps\"/>\n"
313 " <arg direction=\"out\" type=\"a(ias)\" name=\"removedProps\"/>\n"
314 " </signal>\n"
315 " <signal name=\"LayoutUpdated\">\n"
316 " <dox:d>\n"
317 " Triggered by the application to notify display of a layout update, up to\n"
318 " revision\n"
319 " </dox:d>\n"
320 " <arg direction=\"out\" type=\"u\" name=\"revision\">\n"
321 " <dox:d>The revision of the layout that we're currently on</dox:d>\n"
322 " </arg>\n"
323 " <arg direction=\"out\" type=\"i\" name=\"parent\">\n"
324 " <dox:d>\n"
325 " If the layout update is only of a subtree, this is the\n"
326 " parent item for the entries that have changed. It is zero if\n"
327 " the whole layout should be considered invalid.\n"
328 " </dox:d>\n"
329 " </arg>\n"
330 " </signal>\n"
331 " <signal name=\"ItemActivationRequested\">\n"
332 " <dox:d>\n"
333 " The server is requesting that all clients displaying this\n"
334 " menu open it to the user. This would be for things like\n"
335 " hotkeys that when the user presses them the menu should\n"
336 " open and display itself to the user.\n"
337 " </dox:d>\n"
338 " <arg direction=\"out\" type=\"i\" name=\"id\">\n"
339 " <dox:d>ID of the menu that should be activated</dox:d>\n"
340 " </arg>\n"
341 " <arg direction=\"out\" type=\"u\" name=\"timestamp\">\n"
342 " <dox:d>The time that the event occured</dox:d>\n"
343 " </arg>\n"
344 " </signal>\n"
345 " <!-- End of interesting stuff -->\n"
346 " </interface>\n"
347  "")
348 public:
349  DbusmenuAdaptor(DBusMenuExporterDBus *parent);
350  virtual ~DbusmenuAdaptor();
351 
352  inline DBusMenuExporterDBus *parent() const
353  { return static_cast<DBusMenuExporterDBus *>(QObject::parent()); }
354 
355 public: // PROPERTIES
356  Q_PROPERTY(QString Status READ status)
357  QString status() const;
358 
359  Q_PROPERTY(uint Version READ version)
360  uint version() const;
361 
362 public Q_SLOTS: // METHODS
363  bool AboutToShow(int id);
364  void Event(int id, const QString &eventId, const QDBusVariant &data, uint timestamp);
365  DBusMenuItemList GetGroupProperties(const QList<int> &ids, const QStringList &propertyNames);
366  uint GetLayout(int parentId, int recursionDepth, const QStringList &propertyNames, DBusMenuLayoutItem &layout);
367  QDBusVariant GetProperty(int id, const QString &name);
368 Q_SIGNALS: // SIGNALS
369  void ItemActivationRequested(int id, uint timestamp);
370  void ItemsPropertiesUpdated(DBusMenuItemList updatedProps, DBusMenuItemKeysList removedProps);
371  void LayoutUpdated(uint revision, int parent);
372 };
373 
374 #endif