pad the GActionGroup vtable
[platform/upstream/glib.git] / gio / gactiongroup.h
1 /*
2  * Copyright © 2010 Codethink Limited
3  *
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.
8  *
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.
13  *
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.
18  *
19  * Authors: Ryan Lortie <desrt@desrt.ca>
20  */
21
22 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
23 #error "Only <gio/gio.h> can be included directly."
24 #endif
25
26 #ifndef __G_ACTION_GROUP_H__
27 #define __G_ACTION_GROUP_H__
28
29 #include <gio/giotypes.h>
30
31 G_BEGIN_DECLS
32
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))
42
43 typedef struct _GActionGroupPrivate                         GActionGroupPrivate;
44 typedef struct _GActionGroupClass                           GActionGroupClass;
45
46 /**
47  * GActionGroup:
48  *
49  * The #GActionGroup structure contains private data and should only be accessed using the provided API.
50  *
51  * Since: 2.26
52  */
53 struct _GActionGroup
54 {
55   /*< private >*/
56   GObject parent_instance;
57
58   GActionGroupPrivate *priv;
59 };
60
61 /**
62  * GActionGroupClass:
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
76  *
77  * The virtual function table for #GActionGroup.
78  *
79  * Since: 2.26
80  */
81 struct _GActionGroupClass
82 {
83   /*< private >*/
84   GObjectClass parent_class;
85
86   /*< public >*/
87   /* virtual functions */
88   gboolean              (* has_action)              (GActionGroup  *action_group,
89                                                      const gchar   *action_name);
90
91   gchar **              (* list_actions)            (GActionGroup  *action_group);
92
93   gboolean              (* get_enabled)             (GActionGroup  *action_group,
94                                                      const gchar   *action_name);
95
96   const GVariantType *  (* get_parameter_type)      (GActionGroup  *action_group,
97                                                      const gchar   *action_name);
98
99   const GVariantType *  (* get_state_type)          (GActionGroup  *action_group,
100                                                      const gchar   *action_name);
101
102   GVariant *            (* get_state_hint)          (GActionGroup  *action_group,
103                                                      const gchar   *action_name);
104
105   GVariant *            (* get_state)               (GActionGroup  *action_group,
106                                                      const gchar   *action_name);
107
108   void                  (* set_state)               (GActionGroup  *action_group,
109                                                      const gchar   *action_name,
110                                                      GVariant      *value);
111
112   void                  (* activate)                (GActionGroup  *action_group,
113                                                      const gchar   *action_name,
114                                                      GVariant      *parameter);
115
116   /*< private >*/
117   gpointer vtable_padding[6];
118
119   /*< public >*/
120   /* signals */
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,
127                                                      gboolean       enabled);
128   void                  (* action_state_changed)    (GActionGroup   *action_group,
129                                                      const gchar    *action_name,
130                                                      GVariant       *value);
131
132   /*< private >*/
133   gpointer signal_padding[6];
134 };
135
136 GType                   g_action_group_get_type                         (void) G_GNUC_CONST;
137
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);
141
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);
148
149 gboolean                g_action_group_get_enabled                      (GActionGroup *action_group,
150                                                                          const gchar  *action_name);
151
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,
156                                                                          GVariant     *value);
157
158 void                    g_action_group_activate                         (GActionGroup *action_group,
159                                                                          const gchar  *action_name,
160                                                                          GVariant     *parameter);
161
162 /* signals */
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,
169                                                                          gboolean      enabled);
170
171 void                    g_action_group_action_state_changed             (GActionGroup *action_group,
172                                                                          const gchar  *action_name,
173                                                                          GVariant     *state);
174
175 G_END_DECLS
176
177 #endif /* __G_ACTION_GROUP_H__ */