GApplication: More documentation tweaks
[glib.git] / gio / gsimpleaction.h
blobd2015799a0e238f8fa498c73f32f663168f9e615
1 /*
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."
24 #endif
26 #ifndef __G_SIMPLE_ACTION_H__
27 #define __G_SIMPLE_ACTION_H__
29 #include <gio/giotypes.h>
31 G_BEGIN_DECLS
33 #define G_TYPE_SIMPLE_ACTION (g_simple_action_get_type ())
34 #define G_SIMPLE_ACTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
35 G_TYPE_SIMPLE_ACTION, GSimpleAction))
36 #define G_SIMPLE_ACTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
37 G_TYPE_SIMPLE_ACTION, GSimpleActionClass))
38 #define G_IS_SIMPLE_ACTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
39 G_TYPE_SIMPLE_ACTION))
40 #define G_IS_SIMPLE_ACTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
41 G_TYPE_SIMPLE_ACTION))
42 #define G_SIMPLE_ACTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
43 G_TYPE_SIMPLE_ACTION, GSimpleActionClass))
45 typedef struct _GSimpleActionPrivate GSimpleActionPrivate;
46 typedef struct _GSimpleActionClass GSimpleActionClass;
48 /**
49 * GSimpleAction:
51 * The <structname>GSimpleAction</structname> structure contains private
52 * data and should only be accessed using the provided API
54 * Since: 2.28
56 struct _GSimpleAction
58 /*< private >*/
59 GObject parent_instance;
61 GSimpleActionPrivate *priv;
64 /**
65 * GSimpleActionClass:
66 * @activate: the class closure for the activate signal
68 * Since: 2.28
70 struct _GSimpleActionClass
72 GObjectClass parent_class;
74 /* signals */
75 void (* activate) (GSimpleAction *simple,
76 GVariant *parameter);
77 /*< private >*/
78 gpointer padding[6];
81 GType g_simple_action_get_type (void) G_GNUC_CONST;
83 GSimpleAction * g_simple_action_new (const gchar *name,
84 const GVariantType *parameter_type);
86 GSimpleAction * g_simple_action_new_stateful (const gchar *name,
87 const GVariantType *parameter_type,
88 GVariant *state);
90 void g_simple_action_set_enabled (GSimpleAction *simple,
91 gboolean enabled);
93 G_END_DECLS
95 #endif /* __G_SIMPLE_ACTION_H__ */