2 * Copyright © 2011 Canonical Ltd.
4 * This library is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * licence, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 * Author: Ryan Lortie <desrt@desrt.ca>
23 #include <gio/gmenumodel.h>
27 #define G_TYPE_MENU (g_menu_get_type ())
28 #define G_MENU(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
30 #define G_IS_MENU(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
33 #define G_TYPE_MENU_ITEM (g_menu_item_get_type ())
34 #define G_MENU_ITEM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
35 G_TYPE_MENU_ITEM, GMenuItem))
36 #define G_IS_MENU_ITEM(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
39 typedef struct _GMenuItem GMenuItem;
40 typedef struct _GMenu GMenu;
42 GLIB_AVAILABLE_IN_2_32
43 GType g_menu_get_type (void) G_GNUC_CONST;
44 GLIB_AVAILABLE_IN_2_32
45 GMenu * g_menu_new (void);
47 GLIB_AVAILABLE_IN_2_32
48 void g_menu_freeze (GMenu *menu);
50 GLIB_AVAILABLE_IN_2_32
51 void g_menu_insert_item (GMenu *menu,
54 GLIB_AVAILABLE_IN_2_32
55 void g_menu_prepend_item (GMenu *menu,
57 GLIB_AVAILABLE_IN_2_32
58 void g_menu_append_item (GMenu *menu,
60 GLIB_AVAILABLE_IN_2_32
61 void g_menu_remove (GMenu *menu,
64 GLIB_AVAILABLE_IN_2_38
65 void g_menu_remove_all (GMenu *menu);
67 GLIB_AVAILABLE_IN_2_32
68 void g_menu_insert (GMenu *menu,
71 const gchar *detailed_action);
72 GLIB_AVAILABLE_IN_2_32
73 void g_menu_prepend (GMenu *menu,
75 const gchar *detailed_action);
76 GLIB_AVAILABLE_IN_2_32
77 void g_menu_append (GMenu *menu,
79 const gchar *detailed_action);
81 GLIB_AVAILABLE_IN_2_32
82 void g_menu_insert_section (GMenu *menu,
86 GLIB_AVAILABLE_IN_2_32
87 void g_menu_prepend_section (GMenu *menu,
90 GLIB_AVAILABLE_IN_2_32
91 void g_menu_append_section (GMenu *menu,
95 GLIB_AVAILABLE_IN_2_32
96 void g_menu_insert_submenu (GMenu *menu,
100 GLIB_AVAILABLE_IN_2_32
101 void g_menu_prepend_submenu (GMenu *menu,
103 GMenuModel *submenu);
104 GLIB_AVAILABLE_IN_2_32
105 void g_menu_append_submenu (GMenu *menu,
107 GMenuModel *submenu);
110 GLIB_AVAILABLE_IN_2_32
111 GType g_menu_item_get_type (void) G_GNUC_CONST;
112 GLIB_AVAILABLE_IN_2_32
113 GMenuItem * g_menu_item_new (const gchar *label,
114 const gchar *detailed_action);
116 GLIB_AVAILABLE_IN_2_34
117 GMenuItem * g_menu_item_new_from_model (GMenuModel *model,
120 GLIB_AVAILABLE_IN_2_32
121 GMenuItem * g_menu_item_new_submenu (const gchar *label,
122 GMenuModel *submenu);
124 GLIB_AVAILABLE_IN_2_32
125 GMenuItem * g_menu_item_new_section (const gchar *label,
126 GMenuModel *section);
128 GLIB_AVAILABLE_IN_2_34
129 GVariant * g_menu_item_get_attribute_value (GMenuItem *menu_item,
130 const gchar *attribute,
131 const GVariantType *expected_type);
132 GLIB_AVAILABLE_IN_2_34
133 gboolean g_menu_item_get_attribute (GMenuItem *menu_item,
134 const gchar *attribute,
135 const gchar *format_string,
137 GLIB_AVAILABLE_IN_2_34
138 GMenuModel *g_menu_item_get_link (GMenuItem *menu_item,
141 GLIB_AVAILABLE_IN_2_32
142 void g_menu_item_set_attribute_value (GMenuItem *menu_item,
143 const gchar *attribute,
145 GLIB_AVAILABLE_IN_2_32
146 void g_menu_item_set_attribute (GMenuItem *menu_item,
147 const gchar *attribute,
148 const gchar *format_string,
150 GLIB_AVAILABLE_IN_2_32
151 void g_menu_item_set_link (GMenuItem *menu_item,
154 GLIB_AVAILABLE_IN_2_32
155 void g_menu_item_set_label (GMenuItem *menu_item,
157 GLIB_AVAILABLE_IN_2_32
158 void g_menu_item_set_submenu (GMenuItem *menu_item,
159 GMenuModel *submenu);
160 GLIB_AVAILABLE_IN_2_32
161 void g_menu_item_set_section (GMenuItem *menu_item,
162 GMenuModel *section);
163 GLIB_AVAILABLE_IN_2_32
164 void g_menu_item_set_action_and_target_value (GMenuItem *menu_item,
166 GVariant *target_value);
167 GLIB_AVAILABLE_IN_2_32
168 void g_menu_item_set_action_and_target (GMenuItem *menu_item,
170 const gchar *format_string,
172 GLIB_AVAILABLE_IN_2_32
173 void g_menu_item_set_detailed_action (GMenuItem *menu_item,
174 const gchar *detailed_action);
176 GLIB_AVAILABLE_IN_2_38
177 void g_menu_item_set_icon (GMenuItem *menu_item,
182 #endif /* __G_MENU_H__ */