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  * Conversion parameters:
26  * inFile  = GActionGroup.html
27  * outPack = gio
28  * outFile = ActionGroupIF
29  * strct   = GActionGroup
30  * realStrct=
31  * ctorStrct=
32  * clss    = ActionGroupT
33  * interf  = ActionGroupIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- g_action_group_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- glib.Str
47  * 	- glib.Variant
48  * 	- glib.VariantType
49  * structWrap:
50  * 	- GVariant* -> Variant
51  * 	- GVariantType* -> VariantType
52  * module aliases:
53  * local aliases:
54  * overrides:
55  */
56 
57 module gio.ActionGroupIF;
58 
59 public  import gtkc.giotypes;
60 
61 private import gtkc.gio;
62 private import glib.ConstructionException;
63 private import gobject.ObjectG;
64 
65 private import gobject.Signals;
66 public  import gtkc.gdktypes;
67 
68 private import glib.Str;
69 private import glib.Variant;
70 private import glib.VariantType;
71 
72 
73 
74 
75 /**
76  * Description
77  * GActionGroup represents a group of actions.
78  * Each action in the group has a unique name (which is a string). All
79  * method calls, except g_action_group_list_actions() take the name of
80  * an action as an argument.
81  * The GActionGroup API is meant to be the 'public' API to the action
82  * group. The calls here are exactly the interaction that 'external
83  * forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
84  * with actions. 'Internal' APIs (ie: ones meant only to be accessed by
85  * the action group implementation) are found on subclasses. This is
86  * why you will find -- for example -- g_action_group_get_enabled() but
87  * not an equivalent set() call.
88  * Signals are emitted on the action group in response to state changes
89  * on individual actions.
90  */
91 public interface ActionGroupIF
92 {
93 	
94 	
95 	public GActionGroup* getActionGroupTStruct();
96 	
97 	/** the main Gtk struct as a void* */
98 	protected void* getStruct();
99 	
100 	
101 	/**
102 	 */
103 	
104 	void delegate(string, ActionGroupIF)[] onActionAddedListeners();
105 	/**
106 	 * Signals that a new action was just added to the group. This signal
107 	 * is emitted after the action has been added and is now visible.
108 	 * Since 2.28
109 	 */
110 	void addOnActionAdded(void delegate(string, ActionGroupIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
111 	void delegate(string, gboolean, ActionGroupIF)[] onActionEnabledChangedListeners();
112 	/**
113 	 * Signals that the enabled status of the named action has changed.
114 	 * Since 2.28
115 	 */
116 	void addOnActionEnabledChanged(void delegate(string, gboolean, ActionGroupIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
117 	void delegate(string, ActionGroupIF)[] onActionRemovedListeners();
118 	/**
119 	 * Signals that an action is just about to be removed from the group.
120 	 * This signal is emitted before the action is removed, so the action
121 	 * is still visible and can be queried from the signal handler.
122 	 * Since 2.28
123 	 */
124 	void addOnActionRemoved(void delegate(string, ActionGroupIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
125 	void delegate(string, Variant, ActionGroupIF)[] onActionStateChangedListeners();
126 	/**
127 	 * Signals that the state of the named action has changed.
128 	 * Since 2.28
129 	 */
130 	void addOnActionStateChanged(void delegate(string, Variant, ActionGroupIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
131 	
132 	/**
133 	 * Checks if the named action exists within action_group.
134 	 * Since 2.28
135 	 * Params:
136 	 * actionName = the name of the action to check for
137 	 * Returns: whether the named action exists
138 	 */
139 	public int hasAction(string actionName);
140 	
141 	/**
142 	 * Lists the actions contained within action_group.
143 	 * The caller is responsible for freeing the list with g_strfreev() when
144 	 * it is no longer required.
145 	 * Since 2.28
146 	 * Returns: a NULL-terminated array of the names of the actions in the groupb. [transfer full]
147 	 */
148 	public string[] listActions();
149 	
150 	/**
151 	 * Checks if the named action within action_group is currently enabled.
152 	 * An action must be enabled in order to be activated or in order to
153 	 * have its state changed from outside callers.
154 	 * Since 2.28
155 	 * Params:
156 	 * actionName = the name of the action to query
157 	 * Returns: whether or not the action is currently enabled
158 	 */
159 	public int getActionEnabled(string actionName);
160 	
161 	/**
162 	 * Queries the type of the parameter that must be given when activating
163 	 * the named action within action_group.
164 	 * When activating the action using g_action_group_activate(), the
165 	 * GVariant given to that function must be of the type returned by this
166 	 * function.
167 	 * In the case that this function returns NULL, you must not give any
168 	 * GVariant, but NULL instead.
169 	 * The parameter type of a particular action will never change but it is
170 	 * possible for an action to be removed and for a new action to be added
171 	 * with the same name but a different parameter type.
172 	 * Since 2.28
173 	 * Params:
174 	 * actionName = the name of the action to query
175 	 * Returns: the parameter type
176 	 */
177 	public VariantType getActionParameterType(string actionName);
178 	
179 	/**
180 	 * Queries the type of the state of the named action within
181 	 * action_group.
182 	 * If the action is stateful then this function returns the
183 	 * GVariantType of the state. All calls to g_action_group_set_state()
184 	 * must give a GVariant of this type and g_action_group_get_state()
185 	 * will return a GVariant of the same type.
186 	 * If the action is not stateful then this function will return NULL.
187 	 * In that case, g_action_group_get_state() will return NULL and you
188 	 * must not call g_action_group_set_state().
189 	 * The state type of a particular action will never change but it is
190 	 * possible for an action to be removed and for a new action to be added
191 	 * with the same name but a different state type.
192 	 * Since 2.28
193 	 * Params:
194 	 * actionName = the name of the action to query
195 	 * Returns: the state type, if the action is stateful. [transfer full]
196 	 */
197 	public VariantType getActionStateType(string actionName);
198 	
199 	/**
200 	 * Requests a hint about the valid range of values for the state of the
201 	 * named action within action_group.
202 	 * If NULL is returned it either means that the action is not stateful
203 	 * or that there is no hint about the valid range of values for the
204 	 * state of the action.
205 	 * If a GVariant array is returned then each item in the array is a
206 	 * possible value for the state. If a GVariant pair (ie: two-tuple) is
207 	 * returned then the tuple specifies the inclusive lower and upper bound
208 	 * of valid values for the state.
209 	 * In any case, the information is merely a hint. It may be possible to
210 	 * have a state value outside of the hinted range and setting a value
211 	 * within the range may fail.
212 	 * The return value (if non-NULL) should be freed with
213 	 * g_variant_unref() when it is no longer required.
214 	 * Since 2.28
215 	 * Params:
216 	 * actionName = the name of the action to query
217 	 * Returns: the state range hint. [transfer full]
218 	 */
219 	public Variant getActionStateHint(string actionName);
220 	
221 	/**
222 	 * Queries the current state of the named action within action_group.
223 	 * If the action is not stateful then NULL will be returned. If the
224 	 * action is stateful then the type of the return value is the type
225 	 * given by g_action_group_get_state_type().
226 	 * The return value (if non-NULL) should be freed with
227 	 * g_variant_unref() when it is no longer required.
228 	 * Since 2.28
229 	 * Params:
230 	 * actionName = the name of the action to query
231 	 * Returns: the current state of the action. [allow-none]
232 	 */
233 	public Variant getActionState(string actionName);
234 	
235 	/**
236 	 * Request for the state of the named action within action_group to be
237 	 * changed to value.
238 	 * The action must be stateful and value must be of the correct type.
239 	 * See g_action_group_get_state_type().
240 	 * This call merely requests a change. The action may refuse to change
241 	 * its state or may change its state to something other than value.
242 	 * See g_action_group_get_state_hint().
243 	 * If the value GVariant is floating, it is consumed.
244 	 * Since 2.28
245 	 * Params:
246 	 * actionName = the name of the action to request the change on
247 	 * value = the new state
248 	 */
249 	public void changeActionState(string actionName, Variant value);
250 	
251 	/**
252 	 * Activate the named action within action_group.
253 	 * If the action is expecting a parameter, then the correct type of
254 	 * parameter must be given as parameter. If the action is expecting no
255 	 * parameters then parameter must be NULL. See
256 	 * g_action_group_get_parameter_type().
257 	 * Since 2.28
258 	 * Params:
259 	 * actionName = the name of the action to activate
260 	 * parameter = parameters to the activation. [allow-none]
261 	 */
262 	public void activateAction(string actionName, Variant parameter);
263 	
264 	/**
265 	 * Emits the "action-added" signal on action_group.
266 	 * This function should only be called by GActionGroup implementations.
267 	 * Since 2.28
268 	 * Params:
269 	 * actionName = the name of an action in the group
270 	 */
271 	public void actionAdded(string actionName);
272 	
273 	/**
274 	 * Emits the "action-removed" signal on action_group.
275 	 * This function should only be called by GActionGroup implementations.
276 	 * Since 2.28
277 	 * Params:
278 	 * actionName = the name of an action in the group
279 	 */
280 	public void actionRemoved(string actionName);
281 	
282 	/**
283 	 * Emits the "action-enabled-changed" signal on action_group.
284 	 * This function should only be called by GActionGroup implementations.
285 	 * Since 2.28
286 	 * Params:
287 	 * actionName = the name of an action in the group
288 	 * enabled = whether or not the action is now enabled
289 	 */
290 	public void actionEnabledChanged(string actionName, int enabled);
291 	
292 	/**
293 	 * Emits the "action-state-changed" signal on action_group.
294 	 * This function should only be called by GActionGroup implementations.
295 	 * Since 2.28
296 	 * Signal Details
297 	 * The "action-added" signal
298 	 * void user_function (GActionGroup *action_group,
299 	 *  gchar *action_name,
300 	 *  gpointer user_data) : Has Details
301 	 * Signals that a new action was just added to the group. This signal
302 	 * is emitted after the action has been added and is now visible.
303 	 * Since 2.28
304 	 * Params:
305 	 * actionName = the name of an action in the group
306 	 * state = the new state of the named action
307 	 * actionName = the name of the action in action_group
308 	 */
309 	public void actionStateChanged(string actionName, Variant state);
310 }