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

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

Initial release

File size: 13.7 KB
Line 
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.ActionGroupIF;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import glib.Str;
26private import glib.Variant;
27private import glib.VariantType;
28private import gobject.Signals;
29private import std.algorithm;
30
31
32/**
33 * #GActionGroup represents a group of actions. Actions can be used to
34 * expose functionality in a structured way, either from one part of a
35 * program to another, or to the outside world. Action groups are often
36 * used together with a #GMenuModel that provides additional
37 * representation data for displaying the actions to the user, e.g. in
38 * a menu.
39 *
40 * The main way to interact with the actions in a GActionGroup is to
41 * activate them with g_action_group_activate_action(). Activating an
42 * action may require a #GVariant parameter. The required type of the
43 * parameter can be inquired with g_action_group_get_action_parameter_type().
44 * Actions may be disabled, see g_action_group_get_action_enabled().
45 * Activating a disabled action has no effect.
46 *
47 * Actions may optionally have a state in the form of a #GVariant. The
48 * current state of an action can be inquired with
49 * g_action_group_get_action_state(). Activating a stateful action may
50 * change its state, but it is also possible to set the state by calling
51 * g_action_group_change_action_state().
52 *
53 * As typical example, consider a text editing application which has an
54 * option to change the current font to 'bold'. A good way to represent
55 * this would be a stateful action, with a boolean state. Activating the
56 * action would toggle the state.
57 *
58 * Each action in the group has a unique name (which is a string).  All
59 * method calls, except g_action_group_list_actions() take the name of
60 * an action as an argument.
61 *
62 * The #GActionGroup API is meant to be the 'public' API to the action
63 * group.  The calls here are exactly the interaction that 'external
64 * forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have
65 * with actions.  'Internal' APIs (ie: ones meant only to be accessed by
66 * the action group implementation) are found on subclasses.  This is
67 * why you will find - for example - g_action_group_get_action_enabled()
68 * but not an equivalent set() call.
69 *
70 * Signals are emitted on the action group in response to state changes
71 * on individual actions.
72 *
73 * Implementations of #GActionGroup should provide implementations for
74 * the virtual functions g_action_group_list_actions() and
75 * g_action_group_query_action().  The other virtual functions should
76 * not be implemented - their "wrappers" are actually implemented with
77 * calls to g_action_group_query_action().
78 */
79public interface ActionGroupIF{
80        /** Get the main Gtk struct */
81        public GActionGroup* getActionGroupStruct();
82
83        /** the main Gtk struct as a void* */
84        protected void* getStruct();
85
86
87        /**
88         * Emits the #GActionGroup::action-added signal on @action_group.
89         *
90         * This function should only be called by #GActionGroup implementations.
91         *
92         * Params:
93         *     actionName = the name of an action in the group
94         *
95         * Since: 2.28
96         */
97        public void actionAdded(string actionName);
98
99        /**
100         * Emits the #GActionGroup::action-enabled-changed signal on @action_group.
101         *
102         * This function should only be called by #GActionGroup implementations.
103         *
104         * Params:
105         *     actionName = the name of an action in the group
106         *     enabled = whether or not the action is now enabled
107         *
108         * Since: 2.28
109         */
110        public void actionEnabledChanged(string actionName, bool enabled);
111
112        /**
113         * Emits the #GActionGroup::action-removed signal on @action_group.
114         *
115         * This function should only be called by #GActionGroup implementations.
116         *
117         * Params:
118         *     actionName = the name of an action in the group
119         *
120         * Since: 2.28
121         */
122        public void actionRemoved(string actionName);
123
124        /**
125         * Emits the #GActionGroup::action-state-changed signal on @action_group.
126         *
127         * This function should only be called by #GActionGroup implementations.
128         *
129         * Params:
130         *     actionName = the name of an action in the group
131         *     state = the new state of the named action
132         *
133         * Since: 2.28
134         */
135        public void actionStateChanged(string actionName, Variant state);
136
137        /**
138         * Activate the named action within @action_group.
139         *
140         * If the action is expecting a parameter, then the correct type of
141         * parameter must be given as @parameter.  If the action is expecting no
142         * parameters then @parameter must be %NULL.  See
143         * g_action_group_get_action_parameter_type().
144         *
145         * Params:
146         *     actionName = the name of the action to activate
147         *     parameter = parameters to the activation
148         *
149         * Since: 2.28
150         */
151        public void activateAction(string actionName, Variant parameter);
152
153        /**
154         * Request for the state of the named action within @action_group to be
155         * changed to @value.
156         *
157         * The action must be stateful and @value must be of the correct type.
158         * See g_action_group_get_action_state_type().
159         *
160         * This call merely requests a change.  The action may refuse to change
161         * its state or may change its state to something other than @value.
162         * See g_action_group_get_action_state_hint().
163         *
164         * If the @value GVariant is floating, it is consumed.
165         *
166         * Params:
167         *     actionName = the name of the action to request the change on
168         *     value = the new state
169         *
170         * Since: 2.28
171         */
172        public void changeActionState(string actionName, Variant value);
173
174        /**
175         * Checks if the named action within @action_group is currently enabled.
176         *
177         * An action must be enabled in order to be activated or in order to
178         * have its state changed from outside callers.
179         *
180         * Params:
181         *     actionName = the name of the action to query
182         *
183         * Returns: whether or not the action is currently enabled
184         *
185         * Since: 2.28
186         */
187        public bool getActionEnabled(string actionName);
188
189        /**
190         * Queries the type of the parameter that must be given when activating
191         * the named action within @action_group.
192         *
193         * When activating the action using g_action_group_activate_action(),
194         * the #GVariant given to that function must be of the type returned
195         * by this function.
196         *
197         * In the case that this function returns %NULL, you must not give any
198         * #GVariant, but %NULL instead.
199         *
200         * The parameter type of a particular action will never change but it is
201         * possible for an action to be removed and for a new action to be added
202         * with the same name but a different parameter type.
203         *
204         * Params:
205         *     actionName = the name of the action to query
206         *
207         * Returns: the parameter type
208         *
209         * Since: 2.28
210         */
211        public VariantType getActionParameterType(string actionName);
212
213        /**
214         * Queries the current state of the named action within @action_group.
215         *
216         * If the action is not stateful then %NULL will be returned.  If the
217         * action is stateful then the type of the return value is the type
218         * given by g_action_group_get_action_state_type().
219         *
220         * The return value (if non-%NULL) should be freed with
221         * g_variant_unref() when it is no longer required.
222         *
223         * Params:
224         *     actionName = the name of the action to query
225         *
226         * Returns: the current state of the action
227         *
228         * Since: 2.28
229         */
230        public Variant getActionState(string actionName);
231
232        /**
233         * Requests a hint about the valid range of values for the state of the
234         * named action within @action_group.
235         *
236         * If %NULL is returned it either means that the action is not stateful
237         * or that there is no hint about the valid range of values for the
238         * state of the action.
239         *
240         * If a #GVariant array is returned then each item in the array is a
241         * possible value for the state.  If a #GVariant pair (ie: two-tuple) is
242         * returned then the tuple specifies the inclusive lower and upper bound
243         * of valid values for the state.
244         *
245         * In any case, the information is merely a hint.  It may be possible to
246         * have a state value outside of the hinted range and setting a value
247         * within the range may fail.
248         *
249         * The return value (if non-%NULL) should be freed with
250         * g_variant_unref() when it is no longer required.
251         *
252         * Params:
253         *     actionName = the name of the action to query
254         *
255         * Returns: the state range hint
256         *
257         * Since: 2.28
258         */
259        public Variant getActionStateHint(string actionName);
260
261        /**
262         * Queries the type of the state of the named action within
263         * @action_group.
264         *
265         * If the action is stateful then this function returns the
266         * #GVariantType of the state.  All calls to
267         * g_action_group_change_action_state() must give a #GVariant of this
268         * type and g_action_group_get_action_state() will return a #GVariant
269         * of the same type.
270         *
271         * If the action is not stateful then this function will return %NULL.
272         * In that case, g_action_group_get_action_state() will return %NULL
273         * and you must not call g_action_group_change_action_state().
274         *
275         * The state type of a particular action will never change but it is
276         * possible for an action to be removed and for a new action to be added
277         * with the same name but a different state type.
278         *
279         * Params:
280         *     actionName = the name of the action to query
281         *
282         * Returns: the state type, if the action is stateful
283         *
284         * Since: 2.28
285         */
286        public VariantType getActionStateType(string actionName);
287
288        /**
289         * Checks if the named action exists within @action_group.
290         *
291         * Params:
292         *     actionName = the name of the action to check for
293         *
294         * Returns: whether the named action exists
295         *
296         * Since: 2.28
297         */
298        public bool hasAction(string actionName);
299
300        /**
301         * Lists the actions contained within @action_group.
302         *
303         * The caller is responsible for freeing the list with g_strfreev() when
304         * it is no longer required.
305         *
306         * Returns: a %NULL-terminated array of the names of the
307         *     actions in the groupb
308         *
309         * Since: 2.28
310         */
311        public string[] listActions();
312
313        /**
314         * Queries all aspects of the named action within an @action_group.
315         *
316         * This function acquires the information available from
317         * g_action_group_has_action(), g_action_group_get_action_enabled(),
318         * g_action_group_get_action_parameter_type(),
319         * g_action_group_get_action_state_type(),
320         * g_action_group_get_action_state_hint() and
321         * g_action_group_get_action_state() with a single function call.
322         *
323         * This provides two main benefits.
324         *
325         * The first is the improvement in efficiency that comes with not having
326         * to perform repeated lookups of the action in order to discover
327         * different things about it.  The second is that implementing
328         * #GActionGroup can now be done by only overriding this one virtual
329         * function.
330         *
331         * The interface provides a default implementation of this function that
332         * calls the individual functions, as required, to fetch the
333         * information.  The interface also provides default implementations of
334         * those functions that call this function.  All implementations,
335         * therefore, must override either this function or all of the others.
336         *
337         * If the action exists, %TRUE is returned and any of the requested
338         * fields (as indicated by having a non-%NULL reference passed in) are
339         * filled.  If the action doesn't exist, %FALSE is returned and the
340         * fields may or may not have been modified.
341         *
342         * Params:
343         *     actionName = the name of an action in the group
344         *     enabled = if the action is presently enabled
345         *     parameterType = the parameter type, or %NULL if none needed
346         *     stateType = the state type, or %NULL if stateless
347         *     stateHint = the state hint, or %NULL if none
348         *     state = the current state, or %NULL if stateless
349         *
350         * Returns: %TRUE if the action exists, else %FALSE
351         *
352         * Since: 2.32
353         */
354        public bool queryAction(string actionName, out bool enabled, out VariantType parameterType, out VariantType stateType, out Variant stateHint, out Variant state);
355
356        /**
357         * Signals that a new action was just added to the group.
358         * This signal is emitted after the action has been added
359         * and is now visible.
360         *
361         * Params:
362         *     actionName = the name of the action in @action_group
363         *
364         * Since: 2.28
365         */
366        gulong addOnActionAdded(void delegate(string, ActionGroupIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
367
368        /**
369         * Signals that the enabled status of the named action has changed.
370         *
371         * Params:
372         *     actionName = the name of the action in @action_group
373         *     enabled = whether the action is enabled or not
374         *
375         * Since: 2.28
376         */
377        gulong addOnActionEnabledChanged(void delegate(string, bool, ActionGroupIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
378
379        /**
380         * Signals that an action is just about to be removed from the group.
381         * This signal is emitted before the action is removed, so the action
382         * is still visible and can be queried from the signal handler.
383         *
384         * Params:
385         *     actionName = the name of the action in @action_group
386         *
387         * Since: 2.28
388         */
389        gulong addOnActionRemoved(void delegate(string, ActionGroupIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
390
391        /**
392         * Signals that the state of the named action has changed.
393         *
394         * Params:
395         *     actionName = the name of the action in @action_group
396         *     value = the new value of the state
397         *
398         * Since: 2.28
399         */
400        gulong addOnActionStateChanged(void delegate(string, Variant, ActionGroupIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0);
401}
Note: See TracBrowser for help on using the repository browser.