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_with_data: class handler for the #GApplication::action-with-data signal
66 * @quit_with_data: class handler for the #GApplication::quit-with-data signal
67 * @prepare_activation: class handler for the #GApplication::prepare-activation signal
68 * @run: virtual function, called by g_application_run()
70 * The <structname>GApplicationClass</structname> structure contains
75 struct _GApplicationClass
78 GObjectClass parent_class
;
82 void (* action_with_data
) (GApplication
*application
,
83 const gchar
*action_name
,
84 GVariant
*platform_data
);
85 gboolean (* quit_with_data
) (GApplication
*application
,
86 GVariant
*platform_data
);
87 void (* prepare_activation
) (GApplication
*application
,
89 GVariant
*platform_data
);
92 void (* run
) (GApplication
*application
);
95 /* Padding for future expansion */
96 void (*_g_reserved1
) (void);
97 void (*_g_reserved2
) (void);
98 void (*_g_reserved3
) (void);
99 void (*_g_reserved4
) (void);
100 void (*_g_reserved5
) (void);
101 void (*_g_reserved6
) (void);
103 GType
g_application_get_type (void) G_GNUC_CONST
;
105 GApplication
* g_application_new (const gchar
*appid
,
109 GApplication
* g_application_try_new (const gchar
*appid
,
114 GApplication
* g_application_unregistered_try_new (const gchar
*appid
,
119 gboolean
g_application_register (GApplication
*application
);
121 GApplication
* g_application_get_instance (void);
122 G_CONST_RETURN gchar
* g_application_get_id (GApplication
*application
);
124 void g_application_add_action (GApplication
*application
,
126 const gchar
*description
);
127 void g_application_remove_action (GApplication
*application
,
129 gchar
** g_application_list_actions (GApplication
*application
);
130 void g_application_set_action_enabled (GApplication
*application
,
133 gboolean
g_application_get_action_enabled (GApplication
*application
,
135 G_CONST_RETURN gchar
* g_application_get_action_description (GApplication
*application
,
137 void g_application_invoke_action (GApplication
*application
,
139 GVariant
*platform_data
);
141 void g_application_run (GApplication
*application
);
142 gboolean
g_application_quit_with_data (GApplication
*application
,
143 GVariant
*platform_data
);
145 gboolean
g_application_is_remote (GApplication
*application
);
149 #endif /* __G_APPLICATION_H__ */