get_state_type


Description:

[ Version ( since = "2.28" ) ]
public abstract unowned VariantType? get_state_type ()

Queries the type of the state of this.

If the action is stateful (e.g. created with [ctor@Gio.SimpleAction.new_stateful]) then this function returns the [type@GLib.VariantType] of the state. This is the type of the initial value given as the state. All calls to [method@Gio.Action.change_state] must give a [ type@GLib.Variant] of this type and [method@Gio.Action.get_state] will return a [type@GLib.Variant] of the same type.

If the action is not stateful (e.g. created with [ctor@Gio.SimpleAction.new]) then this function will return `NULL`. In that case, [ method@Gio.Action.get_state] will return `NULL` and you must not call [method@Gio.Action.change_state].

Parameters:

this

a [type@Gio.Action]

Returns:

the state type, if the action is stateful