Move markup collect tests to the test framework
[glib.git] / gio / gapplication.h
blob20cc4ea39fc0f6ddc108b8e7b580af999a429e9b
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."
26 #endif
28 #ifndef __G_APPLICATION_H__
29 #define __G_APPLICATION_H__
31 #include <glib-object.h>
32 #include <gio/giotypes.h>
34 G_BEGIN_DECLS
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;
47 /**
48 * GApplication:
50 * The <structname>GApplication</structname> structure contains private
51 * data and should only be accessed using the provided API
53 * Since: 2.26
55 struct _GApplication
57 /*< private >*/
58 GObject parent_instance;
60 GApplicationPrivate *priv;
63 /**
64 * GApplicationClass:
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
71 * private data only
73 * Since: 2.26
75 struct _GApplicationClass
77 /*< private >*/
78 GObjectClass parent_class;
80 /*< public >*/
81 /* signals */
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,
88 GVariant *arguments,
89 GVariant *platform_data);
91 /* vfuncs */
92 void (* run) (GApplication *application);
94 /*< private >*/
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,
106 int argc,
107 char **argv);
109 GApplication * g_application_try_new (const gchar *appid,
110 int argc,
111 char **argv,
112 GError **error);
114 GApplication * g_application_unregistered_try_new (const gchar *appid,
115 int argc,
116 char **argv,
117 GError **error);
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,
125 const gchar *name,
126 const gchar *description);
127 void g_application_remove_action (GApplication *application,
128 const gchar *name);
129 gchar ** g_application_list_actions (GApplication *application);
130 void g_application_set_action_enabled (GApplication *application,
131 const gchar *name,
132 gboolean enabled);
133 gboolean g_application_get_action_enabled (GApplication *application,
134 const gchar *name);
135 G_CONST_RETURN gchar * g_application_get_action_description (GApplication *application,
136 const gchar *name);
137 void g_application_invoke_action (GApplication *application,
138 const gchar *name,
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);
147 G_END_DECLS
149 #endif /* __G_APPLICATION_H__ */