1 /*
2 A library to communicate a menu object set accross DBus and
3 track updates and maintain consistency.
4 
5 Copyright 2009 Canonical Ltd.
6 
7 Authors:
8     Ted Gould <ted@canonical.com>
9 
10 This program is free software: you can redistribute it and/or modify it
11 under the terms of either or both of the following licenses:
12 
13 1) the GNU Lesser General Public License version 3, as published by the
14 Free Software Foundation; and/or
15 2) the GNU Lesser General Public License version 2.1, as published by
16 the Free Software Foundation.
17 
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranties of
20 MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
21 PURPOSE.  See the applicable version of the GNU Lesser General Public
22 License for more details.
23 
24 You should have received a copy of both the GNU Lesser General Public
25 License version 3 and version 2.1 along with this program.  If not, see
26 <http://www.gnu.org/licenses/>
27 */
28 
29 #ifndef __DBUSMENU_MENUITEM_H__
30 #define __DBUSMENU_MENUITEM_H__
31 
32 #include <glib.h>
33 #include <glib-object.h>
34 
35 G_BEGIN_DECLS
36 
37 #define DBUSMENU_TYPE_MENUITEM            (dbusmenu_menuitem_get_type ())
38 #define DBUSMENU_MENUITEM(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), DBUSMENU_TYPE_MENUITEM, DbusmenuMenuitem))
39 #define DBUSMENU_MENUITEM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), DBUSMENU_TYPE_MENUITEM, DbusmenuMenuitemClass))
40 #define DBUSMENU_IS_MENUITEM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DBUSMENU_TYPE_MENUITEM))
41 #define DBUSMENU_IS_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUSMENU_TYPE_MENUITEM))
42 #define DBUSMENU_MENUITEM_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUSMENU_TYPE_MENUITEM, DbusmenuMenuitemClass))
43 
44 /* ***************************************** */
45 /* *********  GLib Object Signals  ********* */
46 /* ***************************************** */
47 /**
48  * DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED:
49  *
50  * String to attach to signal #DbusmenuServer::property-changed
51  */
52 #define DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED    "property-changed"
53 /**
54  * DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED:
55  *
56  * String to attach to signal #DbusmenuServer::item-activated
57  */
58 #define DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED      "item-activated"
59 /**
60  * DBUSMENU_MENUITEM_SIGNAL_CHILD_ADDED:
61  *
62  * String to attach to signal #DbusmenuServer::child-added
63  */
64 #define DBUSMENU_MENUITEM_SIGNAL_CHILD_ADDED         "child-added"
65 /**
66  * DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED:
67  *
68  * String to attach to signal #DbusmenuServer::child-removed
69  */
70 #define DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED       "child-removed"
71 /**
72  * DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED:
73  *
74  * String to attach to signal #DbusmenuServer::child-moved
75  */
76 #define DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED         "child-moved"
77 /**
78  * DBUSMENU_MENUITEM_SIGNAL_REALIZED:
79  *
80  * String to attach to signal #DbusmenuServer::realized
81  */
82 #define DBUSMENU_MENUITEM_SIGNAL_REALIZED            "realized"
83 /**
84  * DBUSMENU_MENUITEM_SIGNAL_REALIZED_ID:
85  *
86  * ID to attach to signal #DbusmenuServer::realized
87  */
88 #define DBUSMENU_MENUITEM_SIGNAL_REALIZED_ID         (g_signal_lookup(DBUSMENU_MENUITEM_SIGNAL_REALIZED, DBUSMENU_TYPE_MENUITEM))
89 /**
90  * DBUSMENU_MENUITEM_SIGNAL_SHOW_TO_USER:
91  *
92  * String to attach to signal #DbusmenuServer::show-to-user
93  */
94 #define DBUSMENU_MENUITEM_SIGNAL_SHOW_TO_USER        "show-to-user"
95 /**
96  * DBUSMENU_MENUITEM_SIGNAL_ABOUT_TO_SHOW:
97  *
98  * String to attach to signal #DbusmenuServer::about-to-show
99  */
100 #define DBUSMENU_MENUITEM_SIGNAL_ABOUT_TO_SHOW       "about-to-show"
101 /**
102  * DBUSMENU_MENUITEM_SIGNAL_EVENT:
103  *
104  * String to attach to signal #DbusmenuServer::event
105  */
106 #define DBUSMENU_MENUITEM_SIGNAL_EVENT               "event"
107 
108 /* ***************************************** */
109 /* *********  Menuitem Properties  ********* */
110 /* ***************************************** */
111 /**
112  * DBUSMENU_MENUITEM_PROP_TYPE:
113  *
114  * #DbusmenuMenuitem property used to represent what type of menuitem
115  * this object represents.  Type: #G_VARIANT_TYPE_STRING.
116  */
117 #define DBUSMENU_MENUITEM_PROP_TYPE                  "type"
118 /**
119  * DBUSMENU_MENUITEM_PROP_VISIBLE:
120  *
121  * #DbusmenuMenuitem property used to represent whether the menuitem
122  * should be shown or not.  Type: #G_VARIANT_TYPE_BOOLEAN.
123  */
124 #define DBUSMENU_MENUITEM_PROP_VISIBLE               "visible"
125 /**
126  * DBUSMENU_MENUITEM_PROP_ENABLED:
127  *
128  * #DbusmenuMenuitem property used to represent whether the menuitem
129  * is clickable or not.  Type: #G_VARIANT_TYPE_BOOLEAN.
130  */
131 #define DBUSMENU_MENUITEM_PROP_ENABLED               "enabled"
132 /**
133  * DBUSMENU_MENUITEM_PROP_LABEL:
134  *
135  * #DbusmenuMenuitem property used for the text on the menu item.
136  * Type: #G_VARIANT_TYPE_STRING
137  */
138 #define DBUSMENU_MENUITEM_PROP_LABEL                 "label"
139 /**
140  * DBUSMENU_MENUITEM_PROP_ICON_NAME:
141  *
142  * #DbusmenuMenuitem property that is the name of the icon under the
143  * Freedesktop.org icon naming spec.  Type: #G_VARIANT_TYPE_STRING
144  */
145 #define DBUSMENU_MENUITEM_PROP_ICON_NAME             "icon-name"
146 /**
147  * DBUSMENU_MENUITEM_PROP_ICON_DATA:
148  *
149  * #DbusmenuMenuitem property that is the raw data of a custom icon
150  * used in the application.  Type: #G_VARIANT_TYPE_VARIANT
151  *
152  * It is recommended that this is not set directly but instead the
153  * libdbusmenu-gtk library is used with the function dbusmenu_menuitem_property_set_image()
154  */
155 #define DBUSMENU_MENUITEM_PROP_ICON_DATA             "icon-data"
156 /**
157  * DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC:
158  *
159  * #DbusmenuMenuitem property used to provide a textual description of any
160  * information that the icon may convey. The contents of this property are
161  * passed through to assistive technologies such as the Orca screen reader.
162  * The contents of this property will not be visible in the menu item. If
163  * this property is set, Orca will use this property instead of the label
164  * property.
165  * Type: #G_VARIANT_TYPE_STRING
166  */
167 #define DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC       "accessible-desc"
168 /**
169  * DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE:
170  *
171  * #DbusmenuMenuitem property that says what type of toggle entry should
172  * be shown in the menu.  Should be either #DBUSMENU_MENUITEM_TOGGLE_CHECK
173  * or #DBUSMENU_MENUITEM_TOGGLE_RADIO.  Type: #G_VARIANT_TYPE_STRING
174  */
175 #define DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE           "toggle-type"
176 /**
177  * DBUSMENU_MENUITEM_PROP_TOGGLE_STATE:
178  *
179  * #DbusmenuMenuitem property that says what state a toggle entry should
180  * be shown as the menu.  Should be either #DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED
181  * #DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED or #DBUSMENU_MENUITEM_TOGGLE_STATUE_UNKNOWN.
182  * Type: #G_VARIANT_TYPE_INT32
183  */
184 #define DBUSMENU_MENUITEM_PROP_TOGGLE_STATE          "toggle-state"
185 /**
186  * DBUSMENU_MENUITEM_PROP_SHORTCUT:
187  *
188  * #DbusmenuMenuitem property that is the entries that represent a shortcut
189  * to activate the menuitem.  It is an array of arrays of strings.
190  * Type: #G_VARIANT_TYPE_ARRAY
191  *
192  * It is recommended that this is not set directly but instead the
193  * libdbusmenu-gtk library is used with the function dbusmenu_menuitem_property_set_shortcut()
194  */
195 #define DBUSMENU_MENUITEM_PROP_SHORTCUT              "shortcut"
196 /**
197  * DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY:
198  *
199  * #DbusmenuMenuitem property that tells how the children of this menuitem
200  * should be displayed.  Most likely this will be unset or of the value
201  * #DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU.  Type: #G_VARIANT_TYPE_STRING
202  */
203 #define DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY         "children-display"
204 /**
205  * DBUSMENU_MENUITEM_PROP_DISPOSITION:
206  *
207  * #DbusmenuMenuitem property to tell what type of information that the
208  * menu item is displaying to the user.  Type: #G_VARIANT_TYPE_STRING
209  */
210 #define DBUSMENU_MENUITEM_PROP_DISPOSITION           "disposition"
211 
212 /* ***************************************** */
213 /* *********    Toggle Values      ********* */
214 /* ***************************************** */
215 /**
216  * DBUSMENU_MENUITEM_TOGGLE_CHECK:
217  *
218  * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE to be a standard
219  * check mark item.
220  */
221 #define DBUSMENU_MENUITEM_TOGGLE_CHECK               "checkmark"
222 /**
223  * DBUSMENU_MENUITEM_TOGGLE_RADIO:
224  *
225  * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE to be a standard
226  * radio item.
227  */
228 #define DBUSMENU_MENUITEM_TOGGLE_RADIO               "radio"
229 
230 /* ***************************************** */
231 /* *********    Toggle States      ********* */
232 /* ***************************************** */
233 /**
234  * DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED:
235  *
236  * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's
237  * toggle item is empty.
238  */
239 #define DBUSMENU_MENUITEM_TOGGLE_STATE_UNCHECKED     0
240 /**
241  * DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED:
242  *
243  * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's
244  * toggle item is filled.
245  */
246 #define DBUSMENU_MENUITEM_TOGGLE_STATE_CHECKED       1
247 /**
248  * DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN:
249  *
250  * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's
251  * toggle item is undecided.
252  */
253 #define DBUSMENU_MENUITEM_TOGGLE_STATE_UNKNOWN       -1
254 
255 /* ***************************************** */
256 /* *********    Icon specials      ********* */
257 /* ***************************************** */
258 /**
259  * DBUSMENU_MENUITEM_ICON_NAME_BLANK:
260  *
261  * Used to set #DBUSMENU_MENUITEM_PROP_TOGGLE_STATE so that the menu's
262  * toggle item is undecided.
263  */
264 #define DBUSMENU_MENUITEM_ICON_NAME_BLANK            "blank-icon"
265 
266 /* ***************************************** */
267 /* *********  Shortcut Modifiers   ********* */
268 /* ***************************************** */
269 /**
270  * DBUSMENU_MENUITEM_SHORTCUT_CONTROL:
271  *
272  * Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the
273  * control key.
274  */
275 #define DBUSMENU_MENUITEM_SHORTCUT_CONTROL           "Control"
276 /**
277  * DBUSMENU_MENUITEM_SHORTCUT_ALT:
278  *
279  * Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the
280  * alternate key.
281  */
282 #define DBUSMENU_MENUITEM_SHORTCUT_ALT               "Alt"
283 /**
284  * DBUSMENU_MENUITEM_SHORTCUT_SHIFT:
285  *
286  * Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the
287  * shift key.
288  */
289 #define DBUSMENU_MENUITEM_SHORTCUT_SHIFT             "Shift"
290 /**
291  * DBUSMENU_MENUITEM_SHORTCUT_SUPER:
292  *
293  * Used in #DBUSMENU_MENUITEM_PROP_SHORTCUT to represent the
294  * super key.
295  */
296 #define DBUSMENU_MENUITEM_SHORTCUT_SUPER             "Super"
297 
298 /* ***************************************** */
299 /* *********  Child Display Types  ********* */
300 /* ***************************************** */
301 /**
302  * DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU:
303  *
304  * Used in #DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY to have the
305  * subitems displayed as a submenu.
306  */
307 #define DBUSMENU_MENUITEM_CHILD_DISPLAY_SUBMENU      "submenu"
308 
309 /* ***************************************** */
310 /* ********* Menuitem Dispositions ********* */
311 /* ***************************************** */
312 /**
313  * DBUSMENU_MENUITEM_DISPOSITION_NORMAL:
314  *
315  * Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu
316  * item displayed in the normal manner.  Default value.
317  */
318 #define DBUSMENU_MENUITEM_DISPOSITION_NORMAL         "normal"
319 /**
320  * DBUSMENU_MENUITEM_DISPOSITION_INFORMATIVE:
321  *
322  * Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu
323  * item displayed in a way that conveys it's giving additional
324  * information to the user.
325  */
326 #define DBUSMENU_MENUITEM_DISPOSITION_INFORMATIVE    "informative"
327 /**
328  * DBUSMENU_MENUITEM_DISPOSITION_WARNING:
329  *
330  * Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu
331  * item displayed in a way that conveys it's giving a warning
332  * to the user.
333  */
334 #define DBUSMENU_MENUITEM_DISPOSITION_WARNING        "warning"
335 /**
336  * DBUSMENU_MENUITEM_DISPOSITION_ALERT:
337  *
338  * Used in #DBUSMENU_MENUITEM_PROP_DISPOSITION to have a menu
339  * item displayed in a way that conveys it's giving an alert
340  * to the user.
341  */
342 #define DBUSMENU_MENUITEM_DISPOSITION_ALERT          "alert"
343 
344 /* ***************************************** */
345 /* *********   Dbusmenu Events     ********* */
346 /* ***************************************** */
347 /**
348  * DBUSMENU_MENUITEM_EVENT_ACTIVATED:
349  *
350  * String for the event identifier when a menu item is clicked
351  * on by the user.
352  */
353 #define DBUSMENU_MENUITEM_EVENT_ACTIVATED            "clicked"
354 
355 /**
356  * DBUSMENU_MENUITEM_EVENT_OPENED:
357  *
358  * String for the event identifier when a menu is opened and
359  * displayed to the user.  Only valid for items that contain
360  * submenus.
361  */
362 #define DBUSMENU_MENUITEM_EVENT_OPENED               "opened"
363 
364 /**
365  * DBUSMENU_MENUITEM_EVENT_CLOSED:
366  *
367  * String for the event identifier when a menu is closed and
368  * displayed to the user.  Only valid for items that contain
369  * submenus.
370  */
371 #define DBUSMENU_MENUITEM_EVENT_CLOSED               "closed"
372 
373 typedef struct _DbusmenuMenuitemPrivate DbusmenuMenuitemPrivate;
374 
375 /**
376  * DbusmenuMenuitem:
377  * @parent: Parent object
378  * @priv: Private data
379  *
380  * This is the #GObject based object that represents a menu
381  * item.  It gets created the same on both the client and
382  * the server side and libdbusmenu-glib does the work of making
383  * this object model appear on both sides of DBus.  Simple
384  * really, though through updates and people coming on and off
385  * the bus it can lead to lots of fun complex scenarios.
386  */
387 typedef struct _DbusmenuMenuitem      DbusmenuMenuitem;
388 struct _DbusmenuMenuitem
389 {
390 	GObject parent;
391 
392 	/*< Private >*/
393 	DbusmenuMenuitemPrivate * priv;
394 };
395 
396 /**
397  * dbusmenu_menuitem_about_to_show_cb:
398  * @mi: Menu item that should be shown
399  * @user_data: (closure): Extra user data sent with the function
400  *
401  * Callback prototype for a callback that is called when the
402  * menu should be shown.
403  */
404 typedef void (*dbusmenu_menuitem_about_to_show_cb) (DbusmenuMenuitem * mi, gpointer user_data);
405 
406 /**
407  * dbusmenu_menuitem_buildvariant_slot_t:
408  * @mi: (in): Menu item that should be built from
409  * @properties: (allow-none): A list of properties that should be the only ones in the resulting variant structure
410  *
411  * This is the function that is called to represent this menu item
412  * as a variant.  Should call its own children.
413  *
414  * Return value: (transfer full): A variant representing this item and its children
415  */
416 typedef GVariant * (*dbusmenu_menuitem_buildvariant_slot_t) (DbusmenuMenuitem * mi, gchar ** properties);
417 
418 /**
419  * DbusmenuMenuitemClass:
420  * @parent_class: Functions and signals from our parent
421  * @property_changed: Slot for #DbusmenuMenuitem::property-changed.
422  * @item_activated: Slot for #DbusmenuMenuitem::item-activated.
423  * @child_added: Slot for #DbusmenuMenuitem::child-added.
424  * @child_removed: Slot for #DbusmenuMenuitem::child-removed.
425  * @child_moved: Slot for #DbusmenuMenuitem::child-moved.
426  * @realized: Slot for #DbusmenuMenuitem::realized.
427  * @about_to_show: Slot for #DbusmenuMenuitem::about-to-show.
428  * @buildvariant: Virtual function that appends the strings required to represent this menu item in the menu variant.
429  * @handle_event: This function is to override how events are handled by subclasses.  Look at #dbusmenu_menuitem_handle_event for lots of good information.
430  * @send_about_to_show: Virtual function that notifies server that the client is about to show a menu.
431  * @show_to_user: Slot for #DbusmenuMenuitem::show-to-user.
432  * @event: Slot for #DbsumenuMenuitem::event.
433  * @reserved1: Reserved for future use.
434  * @reserved2: Reserved for future use.
435  * @reserved3: Reserved for future use.
436  * @reserved4: Reserved for future use.
437  * @reserved5: Reserved for future use.
438  *
439  * Functions and signals that every menuitem should know something
440  * about.
441  */
442 typedef struct _DbusmenuMenuitemClass DbusmenuMenuitemClass;
443 struct _DbusmenuMenuitemClass
444 {
445 	GObjectClass parent_class;
446 
447 	/* Signals */
448 	void (*property_changed) (gchar * property, GVariant * value);
449 	void (*item_activated) (guint timestamp);
450 	void (*child_added) (DbusmenuMenuitem * child, guint position);
451 	void (*child_removed) (DbusmenuMenuitem * child);
452 	void (*child_moved) (DbusmenuMenuitem * child, guint newpos, guint oldpos);
453 	void (*realized) (void);
454 
455 	/* Virtual functions */
456 	dbusmenu_menuitem_buildvariant_slot_t buildvariant;
457 	void (*handle_event) (DbusmenuMenuitem * mi, const gchar * name, GVariant * variant, guint timestamp);
458 	void (*send_about_to_show) (DbusmenuMenuitem * mi, dbusmenu_menuitem_about_to_show_cb cb, gpointer cb_data);
459 
460 	void (*show_to_user) (DbusmenuMenuitem * mi, guint timestamp, gpointer cb_data);
461 	gboolean (*about_to_show) (void);
462 
463 	void (*event) (const gchar * name, GVariant * value, guint timestamp);
464 
465 	/*< Private >*/
466 	void (*reserved1) (void);
467 	void (*reserved2) (void);
468 	void (*reserved3) (void);
469 	void (*reserved4) (void);
470 	void (*reserved5) (void);
471 };
472 
473 GType dbusmenu_menuitem_get_type (void);
474 
475 DbusmenuMenuitem * dbusmenu_menuitem_new (void) G_GNUC_WARN_UNUSED_RESULT;
476 DbusmenuMenuitem * dbusmenu_menuitem_new_with_id (gint id) G_GNUC_WARN_UNUSED_RESULT;
477 gint dbusmenu_menuitem_get_id (DbusmenuMenuitem * mi);
478 
479 GList * dbusmenu_menuitem_get_children (DbusmenuMenuitem * mi);
480 GList * dbusmenu_menuitem_take_children (DbusmenuMenuitem * mi) G_GNUC_WARN_UNUSED_RESULT;
481 guint dbusmenu_menuitem_get_position (DbusmenuMenuitem * mi, DbusmenuMenuitem * parent);
482 guint dbusmenu_menuitem_get_position_realized (DbusmenuMenuitem * mi, DbusmenuMenuitem * parent);
483 
484 gboolean dbusmenu_menuitem_child_append (DbusmenuMenuitem * mi, DbusmenuMenuitem * child);
485 gboolean dbusmenu_menuitem_child_prepend (DbusmenuMenuitem * mi, DbusmenuMenuitem * child);
486 gboolean dbusmenu_menuitem_child_delete (DbusmenuMenuitem * mi, DbusmenuMenuitem * child);
487 gboolean dbusmenu_menuitem_child_add_position (DbusmenuMenuitem * mi, DbusmenuMenuitem * child, guint position);
488 gboolean dbusmenu_menuitem_child_reorder (DbusmenuMenuitem * mi, DbusmenuMenuitem * child, guint position);
489 DbusmenuMenuitem * dbusmenu_menuitem_child_find (DbusmenuMenuitem * mi, gint id);
490 DbusmenuMenuitem * dbusmenu_menuitem_find_id (DbusmenuMenuitem * mi, gint id);
491 
492 gboolean dbusmenu_menuitem_set_parent (DbusmenuMenuitem * mi, DbusmenuMenuitem * parent);
493 gboolean dbusmenu_menuitem_unparent (DbusmenuMenuitem *mi);
494 DbusmenuMenuitem * dbusmenu_menuitem_get_parent (DbusmenuMenuitem * mi);
495 
496 gboolean dbusmenu_menuitem_property_set (DbusmenuMenuitem * mi, const gchar * property, const gchar * value);
497 gboolean dbusmenu_menuitem_property_set_variant (DbusmenuMenuitem * mi, const gchar * property, GVariant * value);
498 gboolean dbusmenu_menuitem_property_set_bool (DbusmenuMenuitem * mi, const gchar * property, const gboolean value);
499 gboolean dbusmenu_menuitem_property_set_int (DbusmenuMenuitem * mi, const gchar * property, const gint value);
500 gboolean dbusmenu_menuitem_property_set_byte_array (DbusmenuMenuitem * mi, const gchar * property, const guchar * value, gsize nelements);
501 const gchar * dbusmenu_menuitem_property_get (const DbusmenuMenuitem * mi, const gchar * property);
502 GVariant * dbusmenu_menuitem_property_get_variant (const DbusmenuMenuitem * mi, const gchar * property);
503 gboolean dbusmenu_menuitem_property_get_bool (const DbusmenuMenuitem * mi, const gchar * property);
504 gint dbusmenu_menuitem_property_get_int (const DbusmenuMenuitem * mi, const gchar * property);
505 const guchar * dbusmenu_menuitem_property_get_byte_array (const DbusmenuMenuitem * mi, const gchar * property, gsize * nelements);
506 gboolean dbusmenu_menuitem_property_exist (const DbusmenuMenuitem * mi, const gchar * property);
507 GList * dbusmenu_menuitem_properties_list (DbusmenuMenuitem * mi) G_GNUC_WARN_UNUSED_RESULT;
508 GHashTable * dbusmenu_menuitem_properties_copy (DbusmenuMenuitem * mi);
509 void dbusmenu_menuitem_property_remove (DbusmenuMenuitem * mi, const gchar * property);
510 
511 void dbusmenu_menuitem_set_root (DbusmenuMenuitem * mi, gboolean root);
512 gboolean dbusmenu_menuitem_get_root (DbusmenuMenuitem * mi);
513 
514 void dbusmenu_menuitem_foreach (DbusmenuMenuitem * mi, void (*func) (DbusmenuMenuitem * mi, gpointer data), gpointer data);
515 void dbusmenu_menuitem_handle_event (DbusmenuMenuitem * mi, const gchar * name, GVariant * variant, guint timestamp);
516 void dbusmenu_menuitem_send_about_to_show (DbusmenuMenuitem * mi, void (*cb) (DbusmenuMenuitem * mi, gpointer user_data), gpointer cb_data);
517 
518 void dbusmenu_menuitem_show_to_user (DbusmenuMenuitem * mi, guint timestamp);
519 
520 /**
521  * SECTION:menuitem
522  * @short_description: A lowlevel represenation of a menuitem
523  * @stability: Unstable
524  * @include: libdbusmenu-glib/menuitem.h
525  *
526  * A #DbusmenuMenuitem is the lowest level of represenation of a
527  * single item in a menu.  It gets created on the server side
528  * and copied over to the client side where it gets rendered.  As
529  * the server starts to change it, and grow it, and do all kinds
530  * of fun stuff that information is transfered over DBus and the
531  * client updates its understanding of the object model.
532  *
533  * Most people using either the client or the server should be
534  * able to deal mostly with #DbusmenuMenuitem objects.  These
535  * are simple, but then they can be attached to more complex
536  * objects and handled appropriately.
537  */
538 
539 G_END_DECLS
540 
541 #endif
542