source: appstream-generator/build/girepo/gio/ActionMapIF.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 2 years ago

Initial release

File size: 3.7 KB
RevLine 
[4841]1/*
2 * Licensed under the GNU Lesser General Public License Version 3
3 *
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 published by
6 * the Free Software Foundation, either version 3 of the license, or
7 * (at your option) any later version.
8 *
9 * This software is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18// generated automatically - do not change
19
20
21module gio.ActionMapIF;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.Action;
26private import gio.ActionIF;
27private import glib.Str;
28private import gobject.ObjectG;
29
30
31/**
32 * The GActionMap interface is implemented by #GActionGroup
33 * implementations that operate by containing a number of
34 * named #GAction instances, such as #GSimpleActionGroup.
35 *
36 * One useful application of this interface is to map the
37 * names of actions from various action groups to unique,
38 * prefixed names (e.g. by prepending "app." or "win.").
39 * This is the motivation for the 'Map' part of the interface
40 * name.
41 */
42public interface ActionMapIF{
43        /** Get the main Gtk struct */
44        public GActionMap* getActionMapStruct();
45
46        /** the main Gtk struct as a void* */
47        protected void* getStruct();
48
49
50        /**
51         * Adds an action to the @action_map.
52         *
53         * If the action map already contains an action with the same name
54         * as @action then the old action is dropped from the action map.
55         *
56         * The action map takes its own reference on @action.
57         *
58         * Params:
59         *     action = a #GAction
60         *
61         * Since: 2.32
62         */
63        public void addAction(ActionIF action);
64
65        /**
66         * A convenience function for creating multiple #GSimpleAction instances
67         * and adding them to a #GActionMap.
68         *
69         * Each action is constructed as per one #GActionEntry.
70         *
71         * |[<!-- language="C" -->
72         * static void
73         * activate_quit (GSimpleAction *simple,
74         * GVariant      *parameter,
75         * gpointer       user_data)
76         * {
77         * exit (0);
78         * }
79         *
80         * static void
81         * activate_print_string (GSimpleAction *simple,
82         * GVariant      *parameter,
83         * gpointer       user_data)
84         * {
85         * g_print ("%s\n", g_variant_get_string (parameter, NULL));
86         * }
87         *
88         * static GActionGroup *
89         * create_action_group (void)
90         * {
91         * const GActionEntry entries[] = {
92         * { "quit",         activate_quit              },
93         * { "print-string", activate_print_string, "s" }
94         * };
95         * GSimpleActionGroup *group;
96         *
97         * group = g_simple_action_group_new ();
98         * g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
99         *
100         * return G_ACTION_GROUP (group);
101         * }
102         * ]|
103         *
104         * Params:
105         *     entries = a pointer to
106         *         the first item in an array of #GActionEntry structs
107         *     nEntries = the length of @entries, or -1 if @entries is %NULL-terminated
108         *     userData = the user data for signal connections
109         *
110         * Since: 2.32
111         */
112        public void addActionEntries(GActionEntry[] entries, void* userData);
113
114        /**
115         * Looks up the action with the name @action_name in @action_map.
116         *
117         * If no such action exists, returns %NULL.
118         *
119         * Params:
120         *     actionName = the name of an action
121         *
122         * Returns: a #GAction, or %NULL
123         *
124         * Since: 2.32
125         */
126        public ActionIF lookupAction(string actionName);
127
128        /**
129         * Removes the named action from the action map.
130         *
131         * If no action of this name is in the map then nothing happens.
132         *
133         * Params:
134         *     actionName = the name of the action
135         *
136         * Since: 2.32
137         */
138        public void removeAction(string actionName);
139}
Note: See TracBrowser for help on using the repository browser.