query_action


Description:

[ Version ( since = "2.32" ) ]
public virtual bool query_action (string action_name, out bool enabled, out unowned VariantType parameter_type, out unowned VariantType state_type, out Variant state_hint, out Variant state)

Queries all aspects of the named action within an this.

This function acquires the information available from [method@Gio.ActionGroup.has_action], [method@Gio.ActionGroup.get_action_enabled], [ method@Gio.ActionGroup.get_action_parameter_type], [method@Gio.ActionGroup.get_action_state_type], [method@Gio.ActionGroup.get_action_state_hint ] and [method@Gio.ActionGroup.get_action_state] with a single function call.

This provides two main benefits.

The first is the improvement in efficiency that comes with not having to perform repeated lookups of the action in order to discover different things about it. The second is that implementing [type@Gio.ActionGroup] can now be done by only overriding this one virtual function.

The interface provides a default implementation of this function that calls the individual functions, as required, to fetch the information. The interface also provides default implementations of those functions that call this function. All implementations, therefore, must override either this function or all of the others.

If the action exists, `TRUE` is returned and any of the requested fields (as indicated by having a non-`NULL` reference passed in) are filled. If the action doesn’t exist, `FALSE` is returned and the fields may or may not have been modified.

Parameters:

this

a [type@Gio.ActionGroup]

action_name

the name of an action in the group

enabled

if the action is presently enabled

parameter_type

the parameter type, or `NULL` if none needed

state_type

the state type, or `NULL` if stateless

state_hint

the state hint, or `NULL` if none

state

the current state, or `NULL` if stateless

Returns:

`TRUE` if the action exists, else `FALSE`