12 #ifndef DBUSMENUADAPTOR_H 13 #define DBUSMENUADAPTOR_H 15 #include <QtCore/QObject> 16 #include <QtDBus/QtDBus> 17 #include "/home/abuild/rpmbuild/BUILD/libdbusmenu-qt-0.9.2/src/dbusmenuexporterdbus_p.h" 20 template<
class Key,
class Value>
class QMap;
28 class DbusmenuAdaptor:
public QDBusAbstractAdaptor
31 Q_CLASSINFO(
"D-Bus Interface",
"com.canonical.dbusmenu")
32 Q_CLASSINFO("D-Bus Introspection", ""
33 " <interface name=\"com.canonical.dbusmenu\">\n"
35 " A DBus interface to expose menus on DBus.\n"
37 " Menu items are represented with a unique numeric
id and a dictionary of\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"
43 " Available properties are:\n"
49 " <th>Description</th>\n"
50 " <th>Default Value</th>\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"
60 " Vendor specific types can be added by prefixing them with\n"
63 " <td>\"standard\"</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" 81 " <td>Whether the item can be activated or not.</td>\n" 87 " <td>True if the item is visible in the menu.</td>\n" 91 " <td>icon-name</td>\n" 93 " <td>Icon name of the item, following the freedesktop.org icon spec.</td>\n" 97 " <td>icon-data</td>\n" 99 " <td>PNG data of the icon.</td>\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" 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" 117 " <td>toggle-type</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" 129 " <td>toggle-state</td>\n" 132 " Describe the current state of a \"togglable\" item. Can be one of:\n" 135 " - anything else = indeterminate\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" 146 " <td>children-display</td>\n" 149 " If the menu item has children this property should be set to\n" 156 " Vendor specific properties can be added by prefixing them with\n" 157 " \"x-<vendor>-\".\n" 159 " <!-- Properties -->\n" 160 " <property access=\"read\" type=\"u\" name=\"Version\">\n" 162 " Provides the version of the DBusmenu API that this API is\n" 166 " <property access=\"read\" type=\"s\" name=\"Status\">\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" 175 " <!-- Functions -->\n" 176 " <method name=\"GetLayout\">\n" 177 " <annotation value=\"DBusMenuLayoutItem\" name=\"com.trolltech.QtDBus.QtTypeName.Out1\"/>\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" 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" 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" 192 " <arg direction=\"in\" type=\"i\" name=\"recursionDepth\">\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" 201 " <arg direction=\"in\" type=\"as\" name=\"propertyNames\">\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" 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" 212 " <arg direction=\"out\" type=\"(ia{sv}av)\" name=\"layout\">\n" 213 " <dox:d>The layout, as a recursive structure.</dox:d>\n" 216 " <method name=\"GetGroupProperties\">\n" 217 " <annotation value=\"QList<int>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n" 218 " <annotation value=\"DBusMenuItemList\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n" 220 " Returns the list of items which are children of @a parentId.\n" 222 " <arg direction=\"in\" type=\"ai\" name=\"ids\">\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" 228 " <arg direction=\"in\" type=\"as\" name=\"propertyNames\">\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" 235 " <arg direction=\"out\" type=\"a(ia{sv})\" name=\"properties\">\n" 237 " An array of property values.\n" 238 " An item in this area is represented as a struct following\n" 240 " @li id unsigned the item id\n" 241 " @li properties map(string => variant) the requested item properties\n" 245 " <method name=\"GetProperty\">\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" 251 " <arg direction=\"in\" type=\"i\" name=\"id\">\n" 252 " <dox:d>the id of the item which received the event</dox:d>\n" 254 " <arg direction=\"in\" type=\"s\" name=\"name\">\n" 255 " <dox:d>the name of the property to get</dox:d>\n" 257 " <arg direction=\"out\" type=\"v\" name=\"value\">\n" 258 " <dox:d>the value of the property</dox:d>\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" 266 " @a type can be one of the following:\n" 271 " Vendor specific events can be added by prefixing them with \"x-<vendor>-\"\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" 276 " <arg direction=\"in\" type=\"s\" name=\"eventId\">\n" 277 " <dox:d>the type of event</dox:d>\n" 279 " <arg direction=\"in\" type=\"v\" name=\"data\">\n" 280 " <dox:d>event-specific data</dox:d>\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" 286 " <method name=\"AboutToShow\">\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" 291 " <arg direction=\"in\" type=\"i\" name=\"id\">\n" 293 " Which menu item represents the parent of the item about to be shown.\n" 296 " <arg direction=\"out\" type=\"b\" name=\"needUpdate\">\n" 298 " Whether this AboutToShow event should result in the menu being updated.\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" 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" 312 " <arg direction=\"out\" type=\"a(ia{sv})\" name=\"updatedProps\"/>\n" 313 " <arg direction=\"out\" type=\"a(ias)\" name=\"removedProps\"/>\n" 315 " <signal name=\"LayoutUpdated\">\n" 317 " Triggered by the application to notify display of a layout update, up to\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" 323 " <arg direction=\"out\" type=\"i\" name=\"parent\">\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" 331 " <signal name=\"ItemActivationRequested\">\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" 338 " <arg direction=\"out\" type=\"i\" name=\"id\">\n" 339 " <dox:d>ID of the menu that should be activated</dox:d>\n" 341 " <arg direction=\"out\" type=\"u\" name=\"timestamp\">\n" 342 " <dox:d>The time that the event occured</dox:d>\n" 345 " <!-- End of interesting stuff -->\n" 349 DbusmenuAdaptor(DBusMenuExporterDBus *parent);
350 virtual ~DbusmenuAdaptor();
352 inline DBusMenuExporterDBus *parent()
const 353 {
return static_cast<DBusMenuExporterDBus *
>(QObject::parent()); }
356 Q_PROPERTY(QString Status READ status)
357 QString status()
const;
359 Q_PROPERTY(uint Version READ version)
360 uint version()
const;
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);
369 void ItemActivationRequested(
int id, uint timestamp);
370 void ItemsPropertiesUpdated(DBusMenuItemList updatedProps, DBusMenuItemKeysList removedProps);
371 void LayoutUpdated(uint revision,
int parent);
Definition: dbusmenuadaptor.h:20
Definition: dbusmenuadaptor.h:19