dbusmenu-qt 0.9.2

src/dbusmenuadaptor.h

00001 /*
00002  * This file was generated by qdbusxml2cpp version 0.7
00003  * 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
00004  *
00005  * qdbusxml2cpp is Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
00006  *
00007  * This is an auto-generated file.
00008  * This file may have been hand-edited. Look for HAND-EDIT comments
00009  * before re-generating it.
00010  */
00011 
00012 #ifndef DBUSMENUADAPTOR_H_1361329028
00013 #define DBUSMENUADAPTOR_H_1361329028
00014 
00015 #include <QtCore/QObject>
00016 #include <QtDBus/QtDBus>
00017 #include "/tmp/builds/libdbusmenu-qt/tmp/libdbusmenu-qt-0.9.2/src/dbusmenuexporterdbus_p.h"
00018 class QByteArray;
00019 template<class T> class QList;
00020 template<class Key, class Value> class QMap;
00021 class QString;
00022 class QStringList;
00023 class QVariant;
00024 
00025 /*
00026  * Adaptor class for interface com.canonical.dbusmenu
00027  */
00028 class DbusmenuAdaptor: public QDBusAbstractAdaptor
00029 {
00030     Q_OBJECT
00031     Q_CLASSINFO("D-Bus Interface", "com.canonical.dbusmenu")
00032     Q_CLASSINFO("D-Bus Introspection", ""
00033 "  <interface name=\"com.canonical.dbusmenu\">\n"
00034 "    <dox:d><![CDATA[\n"
00035 "       A DBus interface to expose menus on DBus.\n"
00036 "\n"
00037 "       Menu items are represented with a unique numeric id and a dictionary of\n"
00038 "       properties.\n"
00039 "\n"
00040 "       To reduce the amount of DBus traffic, a property should only be returned\n"
00041 "       if its value is not the default value.\n"
00042 "\n"
00043 "       Available properties are:\n"
00044 "\n"
00045 "       <table>\n"
00046 "       <tr>\n"
00047 "           <th>Name</th>\n"
00048 "           <th>Type</th>\n"
00049 "           <th>Description</th>\n"
00050 "           <th>Default Value</th>\n"
00051 "       </tr>\n"
00052 "       <tr>\n"
00053 "           <td>type</td>\n"
00054 "           <td>String</td>\n"
00055 "           <td>Can be one of:\n"
00056 "           - \"standard\": an item which can be clicked to trigger an action or\n"
00057 "             show another menu\n"
00058 "           - \"separator\": a separator\n"
00059 "\n"
00060 "           Vendor specific types can be added by prefixing them with\n"
00061 "           \"x-<vendor>-\".\n"
00062 "           </td>\n"
00063 "           <td>\"standard\"</td>\n"
00064 "       </tr>\n"
00065 "       <tr>\n"
00066 "           <td>label</td>\n"
00067 "           <td>string</td>\n"
00068 "           <td>Text of the item, except that:\n"
00069 "           -# two consecutive underscore characters \"__\" are displayed as a\n"
00070 "           single underscore,\n"
00071 "           -# any remaining underscore characters are not displayed at all,\n"
00072 "           -# the first of those remaining underscore characters (unless it is\n"
00073 "           the last character in the string) indicates that the following\n"
00074 "           character is the access key.\n"
00075 "           </td>\n"
00076 "           <td>\"\"</td>\n"
00077 "       </tr>\n"
00078 "       <tr>\n"
00079 "           <td>enabled</td>\n"
00080 "           <td>boolean</td>\n"
00081 "           <td>Whether the item can be activated or not.</td>\n"
00082 "           <td>true</td>\n"
00083 "       </tr>\n"
00084 "       <tr>\n"
00085 "           <td>visible</td>\n"
00086 "           <td>boolean</td>\n"
00087 "           <td>True if the item is visible in the menu.</td>\n"
00088 "           <td>true</td>\n"
00089 "       </tr>\n"
00090 "       <tr>\n"
00091 "           <td>icon-name</td>\n"
00092 "           <td>string</td>\n"
00093 "           <td>Icon name of the item, following the freedesktop.org icon spec.</td>\n"
00094 "           <td>\"\"</td>\n"
00095 "       </tr>\n"
00096 "       <tr>\n"
00097 "           <td>icon-data</td>\n"
00098 "           <td>binary</td>\n"
00099 "           <td>PNG data of the icon.</td>\n"
00100 "           <td>Empty</td>\n"
00101 "       </tr>\n"
00102 "       <tr>\n"
00103 "           <td>shortcut</td>\n"
00104 "           <td>array of arrays of strings</td>\n"
00105 "           <td>The shortcut of the item. Each array represents the key press\n"
00106 "           in the list of keypresses. Each list of strings contains a list of\n"
00107 "           modifiers and then the key that is used. The modifier strings\n"
00108 "           allowed are: \"Control\", \"Alt\", \"Shift\" and \"Super\".\n"
00109 "\n"
00110 "           - A simple shortcut like Ctrl+S is represented as:\n"
00111 "             [[\"Control\", \"S\"]]\n"
00112 "           - A complex shortcut like Ctrl+Q, Alt+X is represented as:\n"
00113 "             [[\"Control\", \"Q\"], [\"Alt\", \"X\"]]</td>\n"
00114 "           <td>Empty</td>\n"
00115 "       </tr>\n"
00116 "       <tr>\n"
00117 "           <td>toggle-type</td>\n"
00118 "           <td>string</td>\n"
00119 "           <td>\n"
00120 "           If the item can be toggled, this property should be set to:\n"
00121 "           - \"checkmark\": Item is an independent togglable item\n"
00122 "           - \"radio\": Item is part of a group where only one item can be\n"
00123 "             toggled at a time\n"
00124 "           - \"\": Item cannot be toggled\n"
00125 "           </td>\n"
00126 "           <td>\"\"</td>\n"
00127 "       </tr>\n"
00128 "       <tr>\n"
00129 "           <td>toggle-state</td>\n"
00130 "           <td>int</td>\n"
00131 "           <td>\n"
00132 "           Describe the current state of a \"togglable\" item. Can be one of:\n"
00133 "           - 0 = off\n"
00134 "           - 1 = on\n"
00135 "           - anything else = indeterminate\n"
00136 "\n"
00137 "           Note:\n"
00138 "           The implementation does not itself handle ensuring that only one\n"
00139 "           item in a radio group is set to \"on\", or that a group does not have\n"
00140 "           \"on\" and \"indeterminate\" items simultaneously; maintaining this\n"
00141 "           policy is up to the toolkit wrappers.\n"
00142 "           </td>\n"
00143 "           <td>-1</td>\n"
00144 "       </tr>\n"
00145 "       <tr>\n"
00146 "           <td>children-display</td>\n"
00147 "           <td>string</td>\n"
00148 "           <td>\n"
00149 "           If the menu item has children this property should be set to\n"
00150 "           \"submenu\".\n"
00151 "           </td>\n"
00152 "           <td>\"\"</td>\n"
00153 "       </tr>\n"
00154 "       </table>\n"
00155 "\n"
00156 "       Vendor specific properties can be added by prefixing them with\n"
00157 "       \"x-<vendor>-\".\n"
00158 "       ]]></dox:d>\n"
00159 "    <!-- Properties -->\n"
00160 "    <property access=\"read\" type=\"u\" name=\"Version\">\n"
00161 "      <dox:d>\n"
00162 "           Provides the version of the DBusmenu API that this API is\n"
00163 "           implementing.\n"
00164 "           </dox:d>\n"
00165 "    </property>\n"
00166 "    <property access=\"read\" type=\"s\" name=\"Status\">\n"
00167 "      <dox:d>\n"
00168 "            Tells if the menus are in a normal state or they believe that they\n"
00169 "            could use some attention.  Cases for showing them would be if help\n"
00170 "            were referring to them or they accessors were being highlighted.\n"
00171 "            This property can have two values: \"normal\" in almost all cases and\n"
00172 "            \"notice\" when they should have a higher priority to be shown.\n"
00173 "            </dox:d>\n"
00174 "    </property>\n"
00175 "    <!-- Functions -->\n"
00176 "    <method name=\"GetLayout\">\n"
00177 "      <annotation value=\"DBusMenuLayoutItem\" name=\"com.trolltech.QtDBus.QtTypeName.Out1\"/>\n"
00178 "      <dox:d>\n"
00179 "             Provides the layout and propertiers that are attached to the entries\n"
00180 "             that are in the layout.  It only gives the items that are children\n"
00181 "             of the item that is specified in @a parentId.  It will return all of the\n"
00182 "             properties or specific ones depending of the value in @a propertyNames.\n"
00183 "\n"
00184 "             The format is recursive, where the second 'v' is in the same format\n"
00185 "             as the original 'a(ia{sv}av)'.  Its content depends on the value\n"
00186 "             of @a recursionDepth.\n"
00187 "           </dox:d>\n"
00188 "      <arg direction=\"in\" type=\"i\" name=\"parentId\">\n"
00189 "        <dox:d>The ID of the parent node for the layout.  For\n"
00190 "               grabbing the layout from the root node use zero.</dox:d>\n"
00191 "      </arg>\n"
00192 "      <arg direction=\"in\" type=\"i\" name=\"recursionDepth\">\n"
00193 "        <dox:d>\n"
00194 "                 The amount of levels of recursion to use.  This affects the\n"
00195 "                 content of the second variant array.\n"
00196 "                 - -1: deliver all the items under the @a parentId.\n"
00197 "                 - 0: no recursion, the array will be empty.\n"
00198 "                 - n: array will contains items up to 'n' level depth.\n"
00199 "               </dox:d>\n"
00200 "      </arg>\n"
00201 "      <arg direction=\"in\" type=\"as\" name=\"propertyNames\">\n"
00202 "        <dox:d>\n"
00203 "                   The list of item properties we are\n"
00204 "                   interested in.  If there are no entries in the list all of\n"
00205 "                   the properties will be sent.\n"
00206 "               </dox:d>\n"
00207 "      </arg>\n"
00208 "      <arg direction=\"out\" type=\"u\" name=\"revision\">\n"
00209 "        <dox:d>The revision number of the layout.  For matching\n"
00210 "               with layoutUpdated signals.</dox:d>\n"
00211 "      </arg>\n"
00212 "      <arg direction=\"out\" type=\"(ia{sv}av)\" name=\"layout\">\n"
00213 "        <dox:d>The layout, as a recursive structure.</dox:d>\n"
00214 "      </arg>\n"
00215 "    </method>\n"
00216 "    <method name=\"GetGroupProperties\">\n"
00217 "      <annotation value=\"QList&lt;int>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
00218 "      <annotation value=\"DBusMenuItemList\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
00219 "      <dox:d>\n"
00220 "           Returns the list of items which are children of @a parentId.\n"
00221 "           </dox:d>\n"
00222 "      <arg direction=\"in\" type=\"ai\" name=\"ids\">\n"
00223 "        <dox:d>\n"
00224 "                   A list of ids that we should be finding the properties\n"
00225 "                   on.  If the list is empty, all menu items should be sent.\n"
00226 "               </dox:d>\n"
00227 "      </arg>\n"
00228 "      <arg direction=\"in\" type=\"as\" name=\"propertyNames\">\n"
00229 "        <dox:d>\n"
00230 "                   The list of item properties we are\n"
00231 "                   interested in.  If there are no entries in the list all of\n"
00232 "                   the properties will be sent.\n"
00233 "               </dox:d>\n"
00234 "      </arg>\n"
00235 "      <arg direction=\"out\" type=\"a(ia{sv})\" name=\"properties\">\n"
00236 "        <dox:d>\n"
00237 "                   An array of property values.\n"
00238 "                   An item in this area is represented as a struct following\n"
00239 "                   this format:\n"
00240 "                   @li id unsigned the item id\n"
00241 "                   @li properties map(string => variant) the requested item properties\n"
00242 "               </dox:d>\n"
00243 "      </arg>\n"
00244 "    </method>\n"
00245 "    <method name=\"GetProperty\">\n"
00246 "      <dox:d>\n"
00247 "             Get a signal property on a single item.  This is not useful if you're\n"
00248 "             going to implement this interface, it should only be used if you're\n"
00249 "             debugging via a commandline tool.\n"
00250 "           </dox:d>\n"
00251 "      <arg direction=\"in\" type=\"i\" name=\"id\">\n"
00252 "        <dox:d>the id of the item which received the event</dox:d>\n"
00253 "      </arg>\n"
00254 "      <arg direction=\"in\" type=\"s\" name=\"name\">\n"
00255 "        <dox:d>the name of the property to get</dox:d>\n"
00256 "      </arg>\n"
00257 "      <arg direction=\"out\" type=\"v\" name=\"value\">\n"
00258 "        <dox:d>the value of the property</dox:d>\n"
00259 "      </arg>\n"
00260 "    </method>\n"
00261 "    <method name=\"Event\">\n"
00262 "      <dox:d><![CDATA[\n"
00263 "           This is called by the applet to notify the application an event happened on a\n"
00264 "           menu item.\n"
00265 "\n"
00266 "           @a type can be one of the following:\n"
00267 "\n"
00268 "           @li \"clicked\"\n"
00269 "           @li \"hovered\"\n"
00270 "\n"
00271 "           Vendor specific events can be added by prefixing them with \"x-<vendor>-\"\n"
00272 "           ]]></dox:d>\n"
00273 "      <arg direction=\"in\" type=\"i\" name=\"id\">\n"
00274 "        <dox:d>the id of the item which received the event</dox:d>\n"
00275 "      </arg>\n"
00276 "      <arg direction=\"in\" type=\"s\" name=\"eventId\">\n"
00277 "        <dox:d>the type of event</dox:d>\n"
00278 "      </arg>\n"
00279 "      <arg direction=\"in\" type=\"v\" name=\"data\">\n"
00280 "        <dox:d>event-specific data</dox:d>\n"
00281 "      </arg>\n"
00282 "      <arg direction=\"in\" type=\"u\" name=\"timestamp\">\n"
00283 "        <dox:d>The time that the event occured if available or the time the message was sent if not</dox:d>\n"
00284 "      </arg>\n"
00285 "    </method>\n"
00286 "    <method name=\"AboutToShow\">\n"
00287 "      <dox:d>\n"
00288 "           This is called by the applet to notify the application that it is about\n"
00289 "           to show the menu under the specified item.\n"
00290 "           </dox:d>\n"
00291 "      <arg direction=\"in\" type=\"i\" name=\"id\">\n"
00292 "        <dox:d>\n"
00293 "               Which menu item represents the parent of the item about to be shown.\n"
00294 "               </dox:d>\n"
00295 "      </arg>\n"
00296 "      <arg direction=\"out\" type=\"b\" name=\"needUpdate\">\n"
00297 "        <dox:d>\n"
00298 "               Whether this AboutToShow event should result in the menu being updated.\n"
00299 "               </dox:d>\n"
00300 "      </arg>\n"
00301 "    </method>\n"
00302 "    <!-- Signals -->\n"
00303 "    <signal name=\"ItemsPropertiesUpdated\">\n"
00304 "      <annotation value=\"DBusMenuItemList\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
00305 "      <annotation value=\"DBusMenuItemKeysList\" name=\"com.trolltech.QtDBus.QtTypeName.In1\"/>\n"
00306 "      <dox:d>\n"
00307 "           Triggered when there are lots of property updates across many items\n"
00308 "           so they all get grouped into a single dbus message.  The format is\n"
00309 "           the ID of the item with a hashtable of names and values for those\n"
00310 "           properties.\n"
00311 "           </dox:d>\n"
00312 "      <arg direction=\"out\" type=\"a(ia{sv})\" name=\"updatedProps\"/>\n"
00313 "      <arg direction=\"out\" type=\"a(ias)\" name=\"removedProps\"/>\n"
00314 "    </signal>\n"
00315 "    <signal name=\"LayoutUpdated\">\n"
00316 "      <dox:d>\n"
00317 "           Triggered by the application to notify display of a layout update, up to\n"
00318 "           revision\n"
00319 "           </dox:d>\n"
00320 "      <arg direction=\"out\" type=\"u\" name=\"revision\">\n"
00321 "        <dox:d>The revision of the layout that we're currently on</dox:d>\n"
00322 "      </arg>\n"
00323 "      <arg direction=\"out\" type=\"i\" name=\"parent\">\n"
00324 "        <dox:d>\n"
00325 "               If the layout update is only of a subtree, this is the\n"
00326 "               parent item for the entries that have changed.  It is zero if\n"
00327 "               the whole layout should be considered invalid.\n"
00328 "               </dox:d>\n"
00329 "      </arg>\n"
00330 "    </signal>\n"
00331 "    <signal name=\"ItemActivationRequested\">\n"
00332 "      <dox:d>\n"
00333 "             The server is requesting that all clients displaying this\n"
00334 "             menu open it to the user.  This would be for things like\n"
00335 "             hotkeys that when the user presses them the menu should\n"
00336 "             open and display itself to the user.\n"
00337 "           </dox:d>\n"
00338 "      <arg direction=\"out\" type=\"i\" name=\"id\">\n"
00339 "        <dox:d>ID of the menu that should be activated</dox:d>\n"
00340 "      </arg>\n"
00341 "      <arg direction=\"out\" type=\"u\" name=\"timestamp\">\n"
00342 "        <dox:d>The time that the event occured</dox:d>\n"
00343 "      </arg>\n"
00344 "    </signal>\n"
00345 "    <!-- End of interesting stuff -->\n"
00346 "  </interface>\n"
00347         "")
00348 public:
00349     DbusmenuAdaptor(DBusMenuExporterDBus *parent);
00350     virtual ~DbusmenuAdaptor();
00351 
00352     inline DBusMenuExporterDBus *parent() const
00353     { return static_cast<DBusMenuExporterDBus *>(QObject::parent()); }
00354 
00355 public: // PROPERTIES
00356     Q_PROPERTY(QString Status READ status)
00357     QString status() const;
00358 
00359     Q_PROPERTY(uint Version READ version)
00360     uint version() const;
00361 
00362 public Q_SLOTS: // METHODS
00363     bool AboutToShow(int id);
00364     void Event(int id, const QString &eventId, const QDBusVariant &data, uint timestamp);
00365     DBusMenuItemList GetGroupProperties(const QList<int> &ids, const QStringList &propertyNames);
00366     uint GetLayout(int parentId, int recursionDepth, const QStringList &propertyNames, DBusMenuLayoutItem &layout);
00367     QDBusVariant GetProperty(int id, const QString &name);
00368 Q_SIGNALS: // SIGNALS
00369     void ItemActivationRequested(int id, uint timestamp);
00370     void ItemsPropertiesUpdated(DBusMenuItemList updatedProps, DBusMenuItemKeysList removedProps);
00371     void LayoutUpdated(uint revision, int parent);
00372 };
00373 
00374 #endif
 All Classes Functions