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, write to the
16 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
17 * Boston, MA 02111-1307, USA.
19 * Authors: Ryan Lortie <desrt@desrt.ca>
22 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
23 #error "Only <gio/gio.h> can be included directly."
26 #ifndef __G_ACTION_GROUP_H__
27 #define __G_ACTION_GROUP_H__
29 #include <gio/giotypes.h>
33 #define G_TYPE_ACTION_GROUP (g_action_group_get_type ())
34 #define G_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
35 G_TYPE_ACTION_GROUP, GActionGroup))
36 #define G_ACTION_GROUP_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
37 G_TYPE_ACTION_GROUP, GActionGroupClass))
38 #define G_IS_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), G_TYPE_ACTION))
39 #define G_IS_ACTION_GROUP_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_ACTION))
40 #define G_ACTION_GROUP_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
41 G_TYPE_ACTION_GROUP, GActionGroupClass))
43 typedef struct _GActionGroupPrivate GActionGroupPrivate;
44 typedef struct _GActionGroupClass GActionGroupClass;
49 * The #GActionGroup structure contains private data and should only be accessed using the provided API.
56 GObject parent_instance;
58 GActionGroupPrivate *priv;
63 * @has_action: the virtual function pointer for g_action_group_has_action()
64 * @list_actions: the virtual function pointer for g_action_group_list_actions()
65 * @get_parameter_type: the virtual function pointer for g_action_group_get_parameter_type()
66 * @get_state_type: the virtual function pointer for g_action_group_get_state_type()
67 * @get_state_hint: the virtual function pointer for g_action_group_get_state_hint()
68 * @get_enabled: the virtual function pointer for g_action_group_get_enabled()
69 * @get_state: the virtual function pointer for g_action_group_get_state()
70 * @set_state: the virtual function pointer for g_action_group_set_state()
71 * @activate: the virtual function pointer for g_action_group_activate()
72 * @action_added: the class closure for the action-added signal
73 * @action_removed: the class closure for the action-removed signal
74 * @action_enabled_changed: the class closure for the action-enabled-changed signal
75 * @action_state_changed: the class closure for the action-enabled-changed signal
77 * The virtual function table for #GActionGroup.
81 struct _GActionGroupClass
84 GObjectClass parent_class;
87 /* virtual functions */
88 gboolean (* has_action) (GActionGroup *action_group,
89 const gchar *action_name);
91 gchar ** (* list_actions) (GActionGroup *action_group);
93 gboolean (* get_enabled) (GActionGroup *action_group,
94 const gchar *action_name);
96 const GVariantType * (* get_parameter_type) (GActionGroup *action_group,
97 const gchar *action_name);
99 const GVariantType * (* get_state_type) (GActionGroup *action_group,
100 const gchar *action_name);
102 GVariant * (* get_state_hint) (GActionGroup *action_group,
103 const gchar *action_name);
105 GVariant * (* get_state) (GActionGroup *action_group,
106 const gchar *action_name);
108 void (* set_state) (GActionGroup *action_group,
109 const gchar *action_name,
112 void (* activate) (GActionGroup *action_group,
113 const gchar *action_name,
114 GVariant *parameter);
117 gpointer vtable_padding[6];
121 void (* action_added) (GActionGroup *action_group,
122 const gchar *action_name);
123 void (* action_removed) (GActionGroup *action_group,
124 const gchar *action_name);
125 void (* action_enabled_changed) (GActionGroup *action_group,
126 const gchar *action_name,
128 void (* action_state_changed) (GActionGroup *action_group,
129 const gchar *action_name,
133 gpointer signal_padding[6];
136 GType g_action_group_get_type (void) G_GNUC_CONST;
138 gboolean g_action_group_has_action (GActionGroup *action_group,
139 const gchar *action_name);
140 gchar ** g_action_group_list_actions (GActionGroup *action_group);
142 const GVariantType * g_action_group_get_parameter_type (GActionGroup *action_group,
143 const gchar *action_name);
144 const GVariantType * g_action_group_get_state_type (GActionGroup *action_group,
145 const gchar *action_name);
146 GVariant * g_action_group_get_state_hint (GActionGroup *action_group,
147 const gchar *action_name);
149 gboolean g_action_group_get_enabled (GActionGroup *action_group,
150 const gchar *action_name);
152 GVariant * g_action_group_get_state (GActionGroup *action_group,
153 const gchar *action_name);
154 void g_action_group_set_state (GActionGroup *action_group,
155 const gchar *action_name,
158 void g_action_group_activate (GActionGroup *action_group,
159 const gchar *action_name,
160 GVariant *parameter);
163 void g_action_group_action_added (GActionGroup *action_group,
164 const gchar *action_name);
165 void g_action_group_action_removed (GActionGroup *action_group,
166 const gchar *action_name);
167 void g_action_group_action_enabled_changed (GActionGroup *action_group,
168 const gchar *action_name,
171 void g_action_group_action_state_changed (GActionGroup *action_group,
172 const gchar *action_name,
177 #endif /* __G_ACTION_GROUP_H__ */