Merge branch 'test-ip_mreq_source-android-only' into 'master'
[glib.git] / gio / gactiongroup.h
blobbba8a236b77cf46ed745e9fe00a24cf13dd7d803
1 /*
2 * Copyright © 2010 Codethink Limited
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at 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_GROUP_H__
21 #define __G_ACTION_GROUP_H__
23 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
24 #error "Only <gio/gio.h> can be included directly."
25 #endif
27 #include <gio/giotypes.h>
29 G_BEGIN_DECLS
32 #define G_TYPE_ACTION_GROUP (g_action_group_get_type ())
33 #define G_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
34 G_TYPE_ACTION_GROUP, GActionGroup))
35 #define G_IS_ACTION_GROUP(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
36 G_TYPE_ACTION_GROUP))
37 #define G_ACTION_GROUP_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), \
38 G_TYPE_ACTION_GROUP, GActionGroupInterface))
40 typedef struct _GActionGroupInterface GActionGroupInterface;
42 struct _GActionGroupInterface
44 GTypeInterface g_iface;
46 /* virtual functions */
47 gboolean (* has_action) (GActionGroup *action_group,
48 const gchar *action_name);
50 gchar ** (* list_actions) (GActionGroup *action_group);
52 gboolean (* get_action_enabled) (GActionGroup *action_group,
53 const gchar *action_name);
55 const GVariantType * (* get_action_parameter_type) (GActionGroup *action_group,
56 const gchar *action_name);
58 const GVariantType * (* get_action_state_type) (GActionGroup *action_group,
59 const gchar *action_name);
61 GVariant * (* get_action_state_hint) (GActionGroup *action_group,
62 const gchar *action_name);
64 GVariant * (* get_action_state) (GActionGroup *action_group,
65 const gchar *action_name);
67 void (* change_action_state) (GActionGroup *action_group,
68 const gchar *action_name,
69 GVariant *value);
71 void (* activate_action) (GActionGroup *action_group,
72 const gchar *action_name,
73 GVariant *parameter);
75 /* signals */
76 void (* action_added) (GActionGroup *action_group,
77 const gchar *action_name);
78 void (* action_removed) (GActionGroup *action_group,
79 const gchar *action_name);
80 void (* action_enabled_changed) (GActionGroup *action_group,
81 const gchar *action_name,
82 gboolean enabled);
83 void (* action_state_changed) (GActionGroup *action_group,
84 const gchar *action_name,
85 GVariant *state);
87 /* more virtual functions */
88 gboolean (* query_action) (GActionGroup *action_group,
89 const gchar *action_name,
90 gboolean *enabled,
91 const GVariantType **parameter_type,
92 const GVariantType **state_type,
93 GVariant **state_hint,
94 GVariant **state);
97 GLIB_AVAILABLE_IN_ALL
98 GType g_action_group_get_type (void) G_GNUC_CONST;
100 GLIB_AVAILABLE_IN_ALL
101 gboolean g_action_group_has_action (GActionGroup *action_group,
102 const gchar *action_name);
103 GLIB_AVAILABLE_IN_ALL
104 gchar ** g_action_group_list_actions (GActionGroup *action_group);
106 GLIB_AVAILABLE_IN_ALL
107 const GVariantType * g_action_group_get_action_parameter_type (GActionGroup *action_group,
108 const gchar *action_name);
109 GLIB_AVAILABLE_IN_ALL
110 const GVariantType * g_action_group_get_action_state_type (GActionGroup *action_group,
111 const gchar *action_name);
112 GLIB_AVAILABLE_IN_ALL
113 GVariant * g_action_group_get_action_state_hint (GActionGroup *action_group,
114 const gchar *action_name);
116 GLIB_AVAILABLE_IN_ALL
117 gboolean g_action_group_get_action_enabled (GActionGroup *action_group,
118 const gchar *action_name);
120 GLIB_AVAILABLE_IN_ALL
121 GVariant * g_action_group_get_action_state (GActionGroup *action_group,
122 const gchar *action_name);
123 GLIB_AVAILABLE_IN_ALL
124 void g_action_group_change_action_state (GActionGroup *action_group,
125 const gchar *action_name,
126 GVariant *value);
128 GLIB_AVAILABLE_IN_ALL
129 void g_action_group_activate_action (GActionGroup *action_group,
130 const gchar *action_name,
131 GVariant *parameter);
133 /* signals */
134 GLIB_AVAILABLE_IN_ALL
135 void g_action_group_action_added (GActionGroup *action_group,
136 const gchar *action_name);
137 GLIB_AVAILABLE_IN_ALL
138 void g_action_group_action_removed (GActionGroup *action_group,
139 const gchar *action_name);
140 GLIB_AVAILABLE_IN_ALL
141 void g_action_group_action_enabled_changed (GActionGroup *action_group,
142 const gchar *action_name,
143 gboolean enabled);
145 GLIB_AVAILABLE_IN_ALL
146 void g_action_group_action_state_changed (GActionGroup *action_group,
147 const gchar *action_name,
148 GVariant *state);
150 GLIB_AVAILABLE_IN_2_32
151 gboolean g_action_group_query_action (GActionGroup *action_group,
152 const gchar *action_name,
153 gboolean *enabled,
154 const GVariantType **parameter_type,
155 const GVariantType **state_type,
156 GVariant **state_hint,
157 GVariant **state);
159 G_END_DECLS
161 #endif /* __G_ACTION_GROUP_H__ */