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