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 public  import gtkc.giotypes;
33 
34 
35 /**
36  * The GActionMap interface is implemented by #GActionGroup
37  * implementations that operate by containing a number of
38  * named #GAction instances, such as #GSimpleActionGroup.
39  * 
40  * One useful application of this interface is to map the
41  * names of actions from various action groups to unique,
42  * prefixed names (e.g. by prepending "app." or "win.").
43  * This is the motivation for the 'Map' part of the interface
44  * name.
45  *
46  * Since: 2.32
47  */
48 public interface ActionMapIF{
49 	/** Get the main Gtk struct */
50 	public GActionMap* getActionMapStruct(bool transferOwnership = false);
51 
52 	/** the main Gtk struct as a void* */
53 	protected void* getStruct();
54 
55 
56 	/** */
57 	public static GType getType()
58 	{
59 		return g_action_map_get_type();
60 	}
61 
62 	/**
63 	 * Adds an action to the @action_map.
64 	 *
65 	 * If the action map already contains an action with the same name
66 	 * as @action then the old action is dropped from the action map.
67 	 *
68 	 * The action map takes its own reference on @action.
69 	 *
70 	 * Params:
71 	 *     action = a #GAction
72 	 *
73 	 * Since: 2.32
74 	 */
75 	public void addAction(ActionIF action);
76 
77 	/**
78 	 * A convenience function for creating multiple #GSimpleAction instances
79 	 * and adding them to a #GActionMap.
80 	 *
81 	 * Each action is constructed as per one #GActionEntry.
82 	 *
83 	 * |[<!-- language="C" -->
84 	 * static void
85 	 * activate_quit (GSimpleAction *simple,
86 	 * GVariant      *parameter,
87 	 * gpointer       user_data)
88 	 * {
89 	 * exit (0);
90 	 * }
91 	 *
92 	 * static void
93 	 * activate_print_string (GSimpleAction *simple,
94 	 * GVariant      *parameter,
95 	 * gpointer       user_data)
96 	 * {
97 	 * g_print ("%s\n", g_variant_get_string (parameter, NULL));
98 	 * }
99 	 *
100 	 * static GActionGroup *
101 	 * create_action_group (void)
102 	 * {
103 	 * const GActionEntry entries[] = {
104 	 * { "quit",         activate_quit              },
105 	 * { "print-string", activate_print_string, "s" }
106 	 * };
107 	 * GSimpleActionGroup *group;
108 	 *
109 	 * group = g_simple_action_group_new ();
110 	 * g_action_map_add_action_entries (G_ACTION_MAP (group), entries, G_N_ELEMENTS (entries), NULL);
111 	 *
112 	 * return G_ACTION_GROUP (group);
113 	 * }
114 	 * ]|
115 	 *
116 	 * Params:
117 	 *     entries = a pointer to
118 	 *         the first item in an array of #GActionEntry structs
119 	 *     userData = the user data for signal connections
120 	 *
121 	 * Since: 2.32
122 	 */
123 	public void addActionEntries(GActionEntry[] entries, void* userData);
124 
125 	/**
126 	 * Looks up the action with the name @action_name in @action_map.
127 	 *
128 	 * If no such action exists, returns %NULL.
129 	 *
130 	 * Params:
131 	 *     actionName = the name of an action
132 	 *
133 	 * Returns: a #GAction, or %NULL
134 	 *
135 	 * Since: 2.32
136 	 */
137 	public ActionIF lookupAction(string actionName);
138 
139 	/**
140 	 * Removes the named action from the action map.
141 	 *
142 	 * If no action of this name is in the map then nothing happens.
143 	 *
144 	 * Params:
145 	 *     actionName = the name of the action
146 	 *
147 	 * Since: 2.32
148 	 */
149 	public void removeAction(string actionName);
150 }