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, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 * Author: Ryan Lortie <desrt@desrt.ca>
25 #include <gio/gmenumodel.h>
29 #define G_TYPE_MENU (g_menu_get_type ())
30 #define G_MENU(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
32 #define G_IS_MENU(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
35 #define G_TYPE_MENU_ITEM (g_menu_item_get_type ())
36 #define G_MENU_ITEM(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
37 G_TYPE_MENU_ITEM, GMenuItem))
38 #define G_IS_MENU_ITEM(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
41 typedef struct _GMenuItem GMenuItem;
42 typedef struct _GMenu GMenu;
44 GLIB_AVAILABLE_IN_2_32
45 GType g_menu_get_type (void) G_GNUC_CONST;
46 GLIB_AVAILABLE_IN_2_32
47 GMenu * g_menu_new (void);
49 void g_menu_freeze (GMenu *menu);
51 void g_menu_insert_item (GMenu *menu,
54 void g_menu_prepend_item (GMenu *menu,
56 void g_menu_append_item (GMenu *menu,
58 void g_menu_remove (GMenu *menu,
61 void g_menu_insert (GMenu *menu,
64 const gchar *detailed_action);
65 void g_menu_prepend (GMenu *menu,
67 const gchar *detailed_action);
68 void g_menu_append (GMenu *menu,
70 const gchar *detailed_action);
72 void g_menu_insert_section (GMenu *menu,
76 void g_menu_prepend_section (GMenu *menu,
79 void g_menu_append_section (GMenu *menu,
83 void g_menu_insert_submenu (GMenu *menu,
87 void g_menu_prepend_submenu (GMenu *menu,
90 void g_menu_append_submenu (GMenu *menu,
95 GType g_menu_item_get_type (void) G_GNUC_CONST;
96 GMenuItem * g_menu_item_new (const gchar *label,
97 const gchar *detailed_action);
99 GLIB_AVAILABLE_IN_2_34
100 GMenuItem * g_menu_item_new_from_model (GMenuModel *model,
103 GMenuItem * g_menu_item_new_submenu (const gchar *label,
104 GMenuModel *submenu);
106 GMenuItem * g_menu_item_new_section (const gchar *label,
107 GMenuModel *section);
109 GLIB_AVAILABLE_IN_2_34
110 GVariant * g_menu_item_get_attribute_value (GMenuItem *menu_item,
111 const gchar *attribute,
112 const GVariantType *expected_value);
113 GLIB_AVAILABLE_IN_2_34
114 gboolean g_menu_item_get_attribute (GMenuItem *menu_item,
115 const gchar *attribute,
116 const gchar *format_string,
118 GLIB_AVAILABLE_IN_2_34
119 GMenuModel *g_menu_item_get_link (GMenuItem *menu_item,
122 void g_menu_item_set_attribute_value (GMenuItem *menu_item,
123 const gchar *attribute,
125 void g_menu_item_set_attribute (GMenuItem *menu_item,
126 const gchar *attribute,
127 const gchar *format_string,
129 void g_menu_item_set_link (GMenuItem *menu_item,
132 void g_menu_item_set_label (GMenuItem *menu_item,
134 void g_menu_item_set_submenu (GMenuItem *menu_item,
135 GMenuModel *submenu);
136 void g_menu_item_set_section (GMenuItem *menu_item,
137 GMenuModel *section);
138 void g_menu_item_set_action_and_target_value (GMenuItem *menu_item,
140 GVariant *target_value);
141 void g_menu_item_set_action_and_target (GMenuItem *menu_item,
143 const gchar *format_string,
145 void g_menu_item_set_detailed_action (GMenuItem *menu_item,
146 const gchar *detailed_action);
150 #endif /* __G_MENU_H__ */