2 * Copyright © 2011 Canonical Ltd.
4 * SPDX-License-Identifier: LGPL-2.1-or-later
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
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;
45 GType g_menu_get_type (void) G_GNUC_CONST;
47 GMenu * g_menu_new (void);
50 void g_menu_freeze (GMenu *menu);
53 void g_menu_insert_item (GMenu *menu,
57 void g_menu_prepend_item (GMenu *menu,
60 void g_menu_append_item (GMenu *menu,
63 void g_menu_remove (GMenu *menu,
67 void g_menu_remove_all (GMenu *menu);
70 void g_menu_insert (GMenu *menu,
73 const gchar *detailed_action);
75 void g_menu_prepend (GMenu *menu,
77 const gchar *detailed_action);
79 void g_menu_append (GMenu *menu,
81 const gchar *detailed_action);
84 void g_menu_insert_section (GMenu *menu,
89 void g_menu_prepend_section (GMenu *menu,
93 void g_menu_append_section (GMenu *menu,
98 void g_menu_insert_submenu (GMenu *menu,
101 GMenuModel *submenu);
102 GIO_AVAILABLE_IN_2_32
103 void g_menu_prepend_submenu (GMenu *menu,
105 GMenuModel *submenu);
106 GIO_AVAILABLE_IN_2_32
107 void g_menu_append_submenu (GMenu *menu,
109 GMenuModel *submenu);
112 GIO_AVAILABLE_IN_2_32
113 GType g_menu_item_get_type (void) G_GNUC_CONST;
114 GIO_AVAILABLE_IN_2_32
115 GMenuItem * g_menu_item_new (const gchar *label,
116 const gchar *detailed_action);
118 GIO_AVAILABLE_IN_2_34
119 GMenuItem * g_menu_item_new_from_model (GMenuModel *model,
122 GIO_AVAILABLE_IN_2_32
123 GMenuItem * g_menu_item_new_submenu (const gchar *label,
124 GMenuModel *submenu);
126 GIO_AVAILABLE_IN_2_32
127 GMenuItem * g_menu_item_new_section (const gchar *label,
128 GMenuModel *section);
130 GIO_AVAILABLE_IN_2_34
131 GVariant * g_menu_item_get_attribute_value (GMenuItem *menu_item,
132 const gchar *attribute,
133 const GVariantType *expected_type);
134 GIO_AVAILABLE_IN_2_34
135 gboolean g_menu_item_get_attribute (GMenuItem *menu_item,
136 const gchar *attribute,
137 const gchar *format_string,
139 GIO_AVAILABLE_IN_2_34
140 GMenuModel *g_menu_item_get_link (GMenuItem *menu_item,
143 GIO_AVAILABLE_IN_2_32
144 void g_menu_item_set_attribute_value (GMenuItem *menu_item,
145 const gchar *attribute,
147 GIO_AVAILABLE_IN_2_32
148 void g_menu_item_set_attribute (GMenuItem *menu_item,
149 const gchar *attribute,
150 const gchar *format_string,
152 GIO_AVAILABLE_IN_2_32
153 void g_menu_item_set_link (GMenuItem *menu_item,
156 GIO_AVAILABLE_IN_2_32
157 void g_menu_item_set_label (GMenuItem *menu_item,
159 GIO_AVAILABLE_IN_2_32
160 void g_menu_item_set_submenu (GMenuItem *menu_item,
161 GMenuModel *submenu);
162 GIO_AVAILABLE_IN_2_32
163 void g_menu_item_set_section (GMenuItem *menu_item,
164 GMenuModel *section);
165 GIO_AVAILABLE_IN_2_32
166 void g_menu_item_set_action_and_target_value (GMenuItem *menu_item,
168 GVariant *target_value);
169 GIO_AVAILABLE_IN_2_32
170 void g_menu_item_set_action_and_target (GMenuItem *menu_item,
172 const gchar *format_string,
174 GIO_AVAILABLE_IN_2_32
175 void g_menu_item_set_detailed_action (GMenuItem *menu_item,
176 const gchar *detailed_action);
178 GIO_AVAILABLE_IN_2_38
179 void g_menu_item_set_icon (GMenuItem *menu_item,
184 #endif /* __G_MENU_H__ */