~dbusmenu-team/libdbusmenu/trunk.16.10

« back to all changes in this revision

Viewing changes to libdbusmenu-glib/menuitem.h

Merging in the properties branch to provide some basis to work with.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
#define DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED    "property-changed"
46
46
#define DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED      "item-activated"
 
47
#define DBUSMENU_MENUITEM_SIGNAL_CHILD_ADDED         "child-added"
 
48
#define DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED       "child-removed"
 
49
 
 
50
/**
 
51
        DbusmenuMenuitem:
 
52
 
 
53
        This is the #GObject based object that represents a menu
 
54
        item.  It gets created the same on both the client and
 
55
        the server side and libdbusmenu-glib does the work of making
 
56
        this object model appear on both sides of DBus.  Simple
 
57
        really, though through updates and people coming on and off
 
58
        the bus it can lead to lots of fun complex scenarios.
 
59
*/
 
60
typedef struct _DbusmenuMenuitem      DbusmenuMenuitem;
 
61
struct _DbusmenuMenuitem
 
62
{
 
63
        GObject parent;
 
64
};
47
65
 
48
66
/**
49
67
        DbusmenuMenuitemClass:
50
68
        @property_changed: Slot for #DbusmenuMenuitem::property-changed.
51
69
        @item_activated: Slot for #DbusmenuMenuitem::item-activated.
 
70
        @child_added: Slot for #DbusmenuMenuitem::child-added.
 
71
        @child_removed: Slot for #DbusmenuMenuitem::child-removed.
52
72
        @buildxml: Virtual function that appends the strings required
53
73
                   to represent this menu item in the menu XML file.
54
74
        @reserved1: Reserved for future use.
62
82
        GObjectClass parent_class;
63
83
 
64
84
        /* Signals */
65
 
        void (*property_changed) (gchar * property);
 
85
        void (*property_changed) (gchar * property, gchar * value);
66
86
        void (*item_activated) (void);
 
87
        void (*child_added) (DbusmenuMenuitem * child);
 
88
        void (*child_removed) (DbusmenuMenuitem * child);
67
89
 
68
90
        /* Virtual functions */
69
91
        void (*buildxml) (GPtrArray * stringarray);
74
96
        void (*reserved4) (void);
75
97
};
76
98
 
77
 
/**
78
 
        DbusmenuMenuitem:
79
 
 
80
 
        This is the #GObject based object that represents a menu
81
 
        item.  It gets created the same on both the client and
82
 
        the server side and libdbusmenu-glib does the work of making
83
 
        this object model appear on both sides of DBus.  Simple
84
 
        really, though through updates and people coming on and off
85
 
        the bus it can lead to lots of fun complex scenarios.
86
 
*/
87
 
typedef struct _DbusmenuMenuitem      DbusmenuMenuitem;
88
 
struct _DbusmenuMenuitem
89
 
{
90
 
        GObject parent;
91
 
};
92
 
 
93
99
GType dbusmenu_menuitem_get_type (void);
94
100
 
95
 
DbusmenuMenuitem * dbusmenu_menuitem_new (void);
96
 
DbusmenuMenuitem * dbusmenu_menuitem_new_with_id (guint id);
 
101
DbusmenuMenuitem * dbusmenu_menuitem_new (void) G_GNUC_WARN_UNUSED_RESULT;
 
102
DbusmenuMenuitem * dbusmenu_menuitem_new_with_id (guint id) G_GNUC_WARN_UNUSED_RESULT;
97
103
guint dbusmenu_menuitem_get_id (DbusmenuMenuitem * mi);
98
104
 
99
105
GList * dbusmenu_menuitem_get_children (DbusmenuMenuitem * mi);
100
 
GList * dbusmenu_menuitem_take_children (DbusmenuMenuitem * mi);
 
106
GList * dbusmenu_menuitem_take_children (DbusmenuMenuitem * mi) G_GNUC_WARN_UNUSED_RESULT;
101
107
guint dbusmenu_menuitem_get_position (DbusmenuMenuitem * mi, DbusmenuMenuitem * parent);
102
108
 
103
109
gboolean dbusmenu_menuitem_child_append (DbusmenuMenuitem * mi, DbusmenuMenuitem * child);
104
110
gboolean dbusmenu_menuitem_child_delete (DbusmenuMenuitem * mi, DbusmenuMenuitem * child);
105
111
gboolean dbusmenu_menuitem_child_add_position (DbusmenuMenuitem * mi, DbusmenuMenuitem * child, guint position);
106
112
DbusmenuMenuitem * dbusmenu_menuitem_child_find (DbusmenuMenuitem * mi, guint id);
 
113
DbusmenuMenuitem * dbusmenu_menuitem_find_id (DbusmenuMenuitem * mi, guint id);
107
114
 
108
115
gboolean dbusmenu_menuitem_property_set (DbusmenuMenuitem * mi, const gchar * property, const gchar * value);
109
116
const gchar * dbusmenu_menuitem_property_get (DbusmenuMenuitem * mi, const gchar * property);
110
117
gboolean dbusmenu_menuitem_property_exist (DbusmenuMenuitem * mi, const gchar * property);
 
118
GList * dbusmenu_menuitem_properties_list (DbusmenuMenuitem * mi) G_GNUC_WARN_UNUSED_RESULT;
 
119
GHashTable * dbusmenu_menuitem_properties_copy (DbusmenuMenuitem * mi);
111
120
 
112
121
void dbusmenu_menuitem_buildxml (DbusmenuMenuitem * mi, GPtrArray * array);
 
122
void dbusmenu_menuitem_foreach (DbusmenuMenuitem * mi, void (*func) (DbusmenuMenuitem * mi, gpointer data), gpointer data);
 
123
void dbusmenu_menuitem_activate (DbusmenuMenuitem * mi);
113
124
 
114
125
/**
115
126
        SECTION:menuitem