1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright © 2010 Red Hat, Inc
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation; either version 2 of the licence or (at
8 * your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Authors: Colin Walters <walters@verbum.org>
21 * Emmanuele Bassi <ebassi@linux.intel.com>
24 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
25 #error "Only <gio/gio.h> can be included directly."
28 #ifndef __G_APPLICATION_H__
29 #define __G_APPLICATION_H__
31 #include <glib-object.h>
32 #include <gio/giotypes.h>
36 #define G_TYPE_APPLICATION (g_application_get_type ())
37 #define G_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_APPLICATION, GApplication))
38 #define G_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), G_TYPE_APPLICATION, GApplicationClass))
39 #define G_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_APPLICATION))
40 #define G_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), G_TYPE_APPLICATION))
41 #define G_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), G_TYPE_APPLICATION, GApplicationClass))
43 typedef struct _GApplication GApplication;
44 typedef struct _GApplicationPrivate GApplicationPrivate;
45 typedef struct _GApplicationClass GApplicationClass;
50 * The <structname>GApplication</structname> structure contains private
51 * data and should only be accessed using the provided API
58 GObject parent_instance;
60 GApplicationPrivate *priv;
65 * @action: class handler for the #GApplication::action signal
66 * @quit: class handler for the #GApplication::quit signal
67 * @prepare_activation: class handler for the #GApplication::prepare-activation signal
68 * @run: virtual function, called by g_application_run()
69 * @format_activation_data: virtual function, called by g_application_format_activation_data()
71 * The <structname>GApplicationClass</structname> structure contains
76 struct _GApplicationClass
79 GObjectClass parent_class;
83 void (* action) (GApplication *application,
84 const gchar *action_name,
86 gboolean (* quit) (GApplication *application,
88 void (* prepare_activation) (GApplication *application,
90 GVariant *platform_data);
93 void (* run) (GApplication *application);
94 void (*format_activation_data) (GApplication *application,
95 GVariantBuilder *builder);
98 /* Padding for future expansion */
99 void (*_g_reserved1) (void);
100 void (*_g_reserved2) (void);
101 void (*_g_reserved3) (void);
102 void (*_g_reserved4) (void);
103 void (*_g_reserved5) (void);
104 void (*_g_reserved6) (void);
106 GType g_application_get_type (void) G_GNUC_CONST;
108 GApplication * g_application_new (const gchar *appid);
110 void g_application_register_with_data (GApplication *application,
113 GVariant *platform_data);
115 GApplication * g_application_new_and_register (const gchar *appid,
119 GApplication * g_application_get_instance (void);
120 G_CONST_RETURN gchar * g_application_get_id (GApplication *application);
122 void g_application_add_action (GApplication *application,
124 const gchar *description);
125 void g_application_remove_action (GApplication *application,
127 gchar ** g_application_list_actions (GApplication *application);
128 void g_application_set_action_enabled (GApplication *application,
131 gboolean g_application_get_action_enabled (GApplication *application,
133 G_CONST_RETURN gchar * g_application_get_action_description (GApplication *application,
135 void g_application_invoke_action (GApplication *application,
139 void g_application_run (GApplication *application);
140 gboolean g_application_quit (GApplication *app,
143 gboolean g_application_is_remote (GApplication *application);
145 void g_application_format_activation_data (GApplication *app,
146 GVariantBuilder *builder);
151 #endif /* __G_APPLICATION_H__ */