2 * Copyright © 2010 Codethink Limited
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published
6 * by the Free Software Foundation; either version 2 of the licence or (at
7 * your option) any later version.
9 * This library 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 GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General
15 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 * Authors: Ryan Lortie <desrt@desrt.ca>
20 #ifndef __G_ACTION_H__
21 #define __G_ACTION_H__
23 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
24 #error "Only <gio/gio.h> can be included directly."
27 #include <gio/giotypes.h>
31 #define G_TYPE_ACTION (g_action_get_type ())
32 #define G_ACTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
33 G_TYPE_ACTION, GAction))
34 #define G_IS_ACTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_ACTION))
35 #define G_ACTION_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), \
36 G_TYPE_ACTION, GActionInterface))
38 typedef struct _GActionInterface GActionInterface;
40 struct _GActionInterface
42 GTypeInterface g_iface;
44 /* virtual functions */
45 const gchar * (* get_name) (GAction *action);
46 const GVariantType * (* get_parameter_type) (GAction *action);
47 const GVariantType * (* get_state_type) (GAction *action);
48 GVariant * (* get_state_hint) (GAction *action);
50 gboolean (* get_enabled) (GAction *action);
51 GVariant * (* get_state) (GAction *action);
53 void (* change_state) (GAction *action,
55 void (* activate) (GAction *action,
59 GLIB_AVAILABLE_IN_2_30
60 GType g_action_get_type (void) G_GNUC_CONST;
63 const gchar * g_action_get_name (GAction *action);
65 const GVariantType * g_action_get_parameter_type (GAction *action);
67 const GVariantType * g_action_get_state_type (GAction *action);
69 GVariant * g_action_get_state_hint (GAction *action);
72 gboolean g_action_get_enabled (GAction *action);
74 GVariant * g_action_get_state (GAction *action);
77 void g_action_change_state (GAction *action,
80 void g_action_activate (GAction *action,
83 GLIB_AVAILABLE_IN_2_28
84 gboolean g_action_name_is_valid (const gchar *action_name);
86 GLIB_AVAILABLE_IN_2_38
87 gboolean g_action_parse_detailed_name (const gchar *detailed_name,
89 GVariant **target_value,
92 GLIB_AVAILABLE_IN_2_38
93 gchar * g_action_print_detailed_name (const gchar *action_name,
94 GVariant *target_value);
98 #endif /* __G_ACTION_H__ */