Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gappinfo.h
Go to the documentation of this file.
1/* GIO - GLib Input, Output and Streaming Library
2 *
3 * Copyright (C) 2006-2007 Red Hat, Inc.
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General
18 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 *
20 * Author: Alexander Larsson <alexl@redhat.com>
21 */
22
23#ifndef __G_APP_INFO_H__
24#define __G_APP_INFO_H__
25
26#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
27#error "Only <gio/gio.h> can be included directly."
28#endif
29
30#include <gio/giotypes.h>
31
33
34#define G_TYPE_APP_INFO (g_app_info_get_type ())
35#define G_APP_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_APP_INFO, GAppInfo))
36#define G_IS_APP_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_APP_INFO))
37#define G_APP_INFO_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_APP_INFO, GAppInfoIface))
38
39#define G_TYPE_APP_LAUNCH_CONTEXT (g_app_launch_context_get_type ())
40#define G_APP_LAUNCH_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_APP_LAUNCH_CONTEXT, GAppLaunchContext))
41#define G_APP_LAUNCH_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_APP_LAUNCH_CONTEXT, GAppLaunchContextClass))
42#define G_IS_APP_LAUNCH_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_APP_LAUNCH_CONTEXT))
43#define G_IS_APP_LAUNCH_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_APP_LAUNCH_CONTEXT))
44#define G_APP_LAUNCH_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_APP_LAUNCH_CONTEXT, GAppLaunchContextClass))
45
47typedef struct _GAppLaunchContextPrivate GAppLaunchContextPrivate;
48
49/**
50 * GAppInfoIface:
51 * @g_iface: The parent interface.
52 * @dup: Copies a [iface@Gio.AppInfo].
53 * @equal: Checks two [iface@Gio.AppInfo]s for equality.
54 * @get_id: Gets a string identifier for a [iface@Gio.AppInfo].
55 * @get_name: Gets the name of the application for a [iface@Gio.AppInfo].
56 * @get_description: Gets a short description for the application described by
57 * the [iface@Gio.AppInfo].
58 * @get_executable: Gets the executable name for the [iface@Gio.AppInfo].
59 * @get_icon: Gets the [iface@Gio.Icon] for the [iface@Gio.AppInfo].
60 * @launch: Launches an application specified by the [iface@Gio.AppInfo].
61 * @supports_uris: Indicates whether the application specified supports
62 * launching URIs.
63 * @supports_files: Indicates whether the application specified accepts
64 * filename arguments.
65 * @launch_uris: Launches an application with a list of URIs.
66 * @should_show: Returns whether an application should be shown (e.g. when
67 * getting a list of installed applications).
68 * [FreeDesktop.Org Startup Notification Specification](http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt).
69 * @set_as_default_for_type: Sets an application as default for a given content
70 * type.
71 * @set_as_default_for_extension: Sets an application as default for a given
72 * file extension.
73 * @add_supports_type: Adds to the [iface@Gio.AppInfo] information about
74 * supported file types.
75 * @can_remove_supports_type: Checks for support for removing supported file
76 * types from a [iface@Gio.AppInfo].
77 * @remove_supports_type: Removes a supported application type from a
78 * [iface@Gio.AppInfo].
79 * @can_delete: Checks if a [iface@Gio.AppInfo] can be deleted. (Since 2.20)
80 * @do_delete: Deletes a [iface@Gio.AppInfo]. (Since 2.20)
81 * @get_commandline: Gets the commandline for the [iface@Gio.AppInfo].
82 * (Since 2.20)
83 * @get_display_name: Gets the display name for the [iface@Gio.AppInfo].
84 * (Since 2.24)
85 * @set_as_last_used_for_type: Sets the application as the last used. See
86 * [method@Gio.AppInfo.set_as_last_used_for_type].
87 * @get_supported_types: Retrieves the list of content types that @app_info
88 * claims to support.
89 * @launch_uris_async: Asynchronously launches an application with a list of
90 * URIs. (Since: 2.60)
91 * @launch_uris_finish: Finishes an operation started with @launch_uris_async.
92 * (Since: 2.60)
93
94 * Application Information interface, for operating system portability.
95 */
97
99{
101
102 /* Virtual Table */
103
104 GAppInfo * (* dup) (GAppInfo *appinfo);
105 gboolean (* equal) (GAppInfo *appinfo1,
106 GAppInfo *appinfo2);
107 const char * (* get_id) (GAppInfo *appinfo);
108 const char * (* get_name) (GAppInfo *appinfo);
109 const char * (* get_description) (GAppInfo *appinfo);
110 const char * (* get_executable) (GAppInfo *appinfo);
111 GIcon * (* get_icon) (GAppInfo *appinfo);
112 gboolean (* launch) (GAppInfo *appinfo,
113 GList *files,
114 GAppLaunchContext *context,
115 GError **error);
119 GList *uris,
120 GAppLaunchContext *context,
121 GError **error);
123
124 /* For changing associations */
126 const char *content_type,
127 GError **error);
129 const char *extension,
130 GError **error);
132 const char *content_type,
133 GError **error);
136 const char *content_type,
137 GError **error);
140 const char * (* get_commandline) (GAppInfo *appinfo);
141 const char * (* get_display_name) (GAppInfo *appinfo);
143 const char *content_type,
144 GError **error);
145 const char ** (* get_supported_types) (GAppInfo *appinfo);
146 void (* launch_uris_async) (GAppInfo *appinfo,
147 GList *uris,
148 GAppLaunchContext *context,
149 GCancellable *cancellable,
150 GAsyncReadyCallback callback,
151 gpointer user_data);
153 GAsyncResult *result,
154 GError **error);
155};
156
161 const char *application_name,
163 GError **error);
168 GAppInfo *appinfo2);
170const char *g_app_info_get_id (GAppInfo *appinfo);
172const char *g_app_info_get_name (GAppInfo *appinfo);
178const char *g_app_info_get_executable (GAppInfo *appinfo);
185 GList *files,
186 GAppLaunchContext *context,
187 GError **error);
194 GList *uris,
195 GAppLaunchContext *context,
196 GError **error);
199 GList *uris,
200 GAppLaunchContext *context,
201 GCancellable *cancellable,
202 GAsyncReadyCallback callback,
203 gpointer user_data);
206 GAsyncResult *result,
207 GError **error);
208
211
214 const char *content_type,
215 GError **error);
218 const char *extension,
219 GError **error);
222 const char *content_type,
223 GError **error);
228 const char *content_type,
229 GError **error);
232
237
240 const char *content_type,
241 GError **error);
242
246GList * g_app_info_get_all_for_type (const char *content_type);
251
253void g_app_info_reset_type_associations (const char *content_type);
255GAppInfo *g_app_info_get_default_for_type (const char *content_type,
256 gboolean must_support_uris);
258void g_app_info_get_default_for_type_async (const char *content_type,
259 gboolean must_support_uris,
260 GCancellable *cancellable,
261 GAsyncReadyCallback callback,
262 gpointer user_data);
265 GError **error);
268
271 GCancellable *cancellable,
272 GAsyncReadyCallback callback,
273 gpointer user_data);
276 GError **error);
277
280 GAppLaunchContext *context,
281 GError **error);
282
285 GAppLaunchContext *context,
286 GCancellable *cancellable,
287 GAsyncReadyCallback callback,
288 gpointer user_data);
291 GError **error);
292
293
294/**
295 * GAppLaunchContext:
296 *
297 * Integrating the launch with the launching application. This is used to
298 * handle for instance startup notification and launching the new application
299 * on the same screen as the launching window.
300 */
308
310{
312
313 char * (* get_display) (GAppLaunchContext *context,
314 GAppInfo *info,
315 GList *files);
316 char * (* get_startup_notify_id) (GAppLaunchContext *context,
317 GAppInfo *info,
318 GList *files);
320 const char *startup_notify_id);
321 void (* launched) (GAppLaunchContext *context,
322 GAppInfo *info,
323 GVariant *platform_data);
325 GAppInfo *info,
326 GVariant *platform_data);
327
328 /* Padding for future expansion */
329 void (*_g_reserved1) (void);
330 void (*_g_reserved2) (void);
331 void (*_g_reserved3) (void);
332};
333
338
341 const char *variable,
342 const char *value);
345 const char *variable);
348
351 GAppInfo *info,
352 GList *files);
355 GAppInfo *info,
356 GList *files);
359 const char * startup_notify_id);
360
361#define G_TYPE_APP_INFO_MONITOR (g_app_info_monitor_get_type ())
362#define G_APP_INFO_MONITOR(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
363 G_TYPE_APP_INFO_MONITOR, GAppInfoMonitor))
364#define G_IS_APP_INFO_MONITOR(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
365 G_TYPE_APP_INFO_MONITOR))
366
367typedef struct _GAppInfoMonitor GAppInfoMonitor;
368
371
374
376
377#endif /* __G_APP_INFO_H__ */
const char * extension
Definition civetweb.c:8222
GIO_AVAILABLE_IN_2_74 void g_app_info_get_default_for_type_async(const char *content_type, gboolean must_support_uris, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_AVAILABLE_IN_ALL GAppLaunchContext * g_app_launch_context_new(void)
GIO_AVAILABLE_IN_ALL GList * g_app_info_get_fallback_for_type(const gchar *content_type)
GIO_AVAILABLE_IN_ALL gboolean g_app_info_set_as_last_used_for_type(GAppInfo *appinfo, const char *content_type, GError **error)
GIO_AVAILABLE_IN_2_60 gboolean g_app_info_launch_uris_finish(GAppInfo *appinfo, GAsyncResult *result, GError **error)
GIO_AVAILABLE_IN_ALL GIcon * g_app_info_get_icon(GAppInfo *appinfo)
GIO_AVAILABLE_IN_ALL gboolean g_app_info_launch(GAppInfo *appinfo, GList *files, GAppLaunchContext *context, GError **error)
struct _GAppLaunchContextPrivate GAppLaunchContextPrivate
Definition gappinfo.h:47
GIO_AVAILABLE_IN_ALL gboolean g_app_info_should_show(GAppInfo *appinfo)
GIO_AVAILABLE_IN_ALL const char * g_app_info_get_description(GAppInfo *appinfo)
GIO_AVAILABLE_IN_ALL gboolean g_app_info_set_as_default_for_type(GAppInfo *appinfo, const char *content_type, GError **error)
GIO_AVAILABLE_IN_ALL gboolean g_app_info_launch_uris(GAppInfo *appinfo, GList *uris, GAppLaunchContext *context, GError **error)
GIO_AVAILABLE_IN_ALL gboolean g_app_info_remove_supports_type(GAppInfo *appinfo, const char *content_type, GError **error)
GIO_AVAILABLE_IN_ALL void g_app_launch_context_launch_failed(GAppLaunchContext *context, const char *startup_notify_id)
GIO_AVAILABLE_IN_2_74 void g_app_info_get_default_for_uri_scheme_async(const char *uri_scheme, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_AVAILABLE_IN_ALL const char * g_app_info_get_display_name(GAppInfo *appinfo)
GIO_AVAILABLE_IN_ALL GList * g_app_info_get_recommended_for_type(const gchar *content_type)
GIO_AVAILABLE_IN_2_34 const char ** g_app_info_get_supported_types(GAppInfo *appinfo)
GIO_AVAILABLE_IN_2_60 void g_app_info_launch_uris_async(GAppInfo *appinfo, GList *uris, GAppLaunchContext *context, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_AVAILABLE_IN_2_32 char ** g_app_launch_context_get_environment(GAppLaunchContext *context)
GIO_AVAILABLE_IN_ALL char * g_app_launch_context_get_display(GAppLaunchContext *context, GAppInfo *info, GList *files)
GIO_AVAILABLE_IN_ALL gboolean g_app_info_can_remove_supports_type(GAppInfo *appinfo)
GIO_AVAILABLE_IN_ALL gboolean g_app_info_set_as_default_for_extension(GAppInfo *appinfo, const char *extension, GError **error)
GIO_AVAILABLE_IN_ALL void g_app_info_reset_type_associations(const char *content_type)
GIO_AVAILABLE_IN_ALL char * g_app_launch_context_get_startup_notify_id(GAppLaunchContext *context, GAppInfo *info, GList *files)
GIO_AVAILABLE_IN_ALL GList * g_app_info_get_all_for_type(const char *content_type)
GIO_AVAILABLE_IN_ALL const char * g_app_info_get_name(GAppInfo *appinfo)
GIO_AVAILABLE_IN_ALL GType g_app_info_get_type(void) G_GNUC_CONST
GIO_AVAILABLE_IN_ALL GAppInfo * g_app_info_get_default_for_type(const char *content_type, gboolean must_support_uris)
GIO_AVAILABLE_IN_2_32 void g_app_launch_context_unsetenv(GAppLaunchContext *context, const char *variable)
GIO_AVAILABLE_IN_ALL gboolean g_app_info_can_delete(GAppInfo *appinfo)
GIO_AVAILABLE_IN_2_74 GAppInfo * g_app_info_get_default_for_uri_scheme_finish(GAsyncResult *result, GError **error)
GIO_AVAILABLE_IN_2_50 gboolean g_app_info_launch_default_for_uri_finish(GAsyncResult *result, GError **error)
GIO_AVAILABLE_IN_ALL GAppInfo * g_app_info_get_default_for_uri_scheme(const char *uri_scheme)
GIO_AVAILABLE_IN_ALL const char * g_app_info_get_commandline(GAppInfo *appinfo)
GIO_AVAILABLE_IN_ALL gboolean g_app_info_delete(GAppInfo *appinfo)
GIO_AVAILABLE_IN_ALL GList * g_app_info_get_all(void)
GIO_AVAILABLE_IN_ALL gboolean g_app_info_supports_uris(GAppInfo *appinfo)
GIO_AVAILABLE_IN_2_40 GAppInfoMonitor * g_app_info_monitor_get(void)
GIO_AVAILABLE_IN_2_40 GType g_app_info_monitor_get_type(void)
GIO_AVAILABLE_IN_2_74 GAppInfo * g_app_info_get_default_for_type_finish(GAsyncResult *result, GError **error)
struct _GAppInfoMonitor GAppInfoMonitor
Definition gappinfo.h:367
GIO_AVAILABLE_IN_ALL gboolean g_app_info_add_supports_type(GAppInfo *appinfo, const char *content_type, GError **error)
GIO_AVAILABLE_IN_2_32 void g_app_launch_context_setenv(GAppLaunchContext *context, const char *variable, const char *value)
GIO_AVAILABLE_IN_ALL const char * g_app_info_get_executable(GAppInfo *appinfo)
GIO_AVAILABLE_IN_2_50 void g_app_info_launch_default_for_uri_async(const char *uri, GAppLaunchContext *context, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GIO_AVAILABLE_IN_ALL GAppInfo * g_app_info_create_from_commandline(const char *commandline, const char *application_name, GAppInfoCreateFlags flags, GError **error)
GIO_AVAILABLE_IN_ALL gboolean g_app_info_launch_default_for_uri(const char *uri, GAppLaunchContext *context, GError **error)
GIO_AVAILABLE_IN_ALL const char * g_app_info_get_id(GAppInfo *appinfo)
GIO_AVAILABLE_IN_ALL GType g_app_launch_context_get_type(void) G_GNUC_CONST
GIO_AVAILABLE_IN_ALL GAppInfo * g_app_info_dup(GAppInfo *appinfo)
GIO_AVAILABLE_IN_ALL gboolean g_app_info_equal(GAppInfo *appinfo1, GAppInfo *appinfo2)
GIO_AVAILABLE_IN_ALL gboolean g_app_info_supports_files(GAppInfo *appinfo)
#define GIO_AVAILABLE_IN_ALL
#define GIO_AVAILABLE_IN_2_74
#define GIO_AVAILABLE_IN_2_32
#define GIO_AVAILABLE_IN_2_60
#define GIO_AVAILABLE_IN_2_40
#define GIO_AVAILABLE_IN_2_34
#define GIO_AVAILABLE_IN_2_50
GAppInfoCreateFlags
Definition gioenums.h:45
struct _GIcon GIcon
Definition giotypes.h:92
typedefG_BEGIN_DECLS struct _GAppLaunchContext GAppLaunchContext
Definition giotypes.h:34
struct _GAppInfo GAppInfo
Definition giotypes.h:35
struct _GAsyncResult GAsyncResult
Definition giotypes.h:36
void(* GAsyncReadyCallback)(GObject *source_object, GAsyncResult *res, gpointer data)
Definition giotypes.h:190
typedefG_BEGIN_DECLS struct _GList GList
Definition glist.h:39
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_CONST
Definition gmacros.h:637
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
G_BEGIN_DECLS typedef char gchar
Definition gtypes.h:52
void * gpointer
Definition gtypes.h:109
typedefG_BEGIN_DECLS struct _GVariant GVariant
Definition gvariant.h:36
int value
Definition lsqlite3.c:2155
static void error(LoadState *S, const char *why)
gboolean(* add_supports_type)(GAppInfo *appinfo, const char *content_type, GError **error)
Definition gappinfo.h:131
gboolean(* set_as_default_for_type)(GAppInfo *appinfo, const char *content_type, GError **error)
Definition gappinfo.h:125
gboolean(* set_as_default_for_extension)(GAppInfo *appinfo, const char *extension, GError **error)
Definition gappinfo.h:128
gboolean(* do_delete)(GAppInfo *appinfo)
Definition gappinfo.h:139
GTypeInterface g_iface
Definition gappinfo.h:100
gboolean(* can_remove_supports_type)(GAppInfo *appinfo)
Definition gappinfo.h:134
gboolean(* launch)(GAppInfo *appinfo, GList *files, GAppLaunchContext *context, GError **error)
Definition gappinfo.h:112
void(* launch_uris_async)(GAppInfo *appinfo, GList *uris, GAppLaunchContext *context, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition gappinfo.h:146
gboolean(* launch_uris)(GAppInfo *appinfo, GList *uris, GAppLaunchContext *context, GError **error)
Definition gappinfo.h:118
gboolean(* equal)(GAppInfo *appinfo1, GAppInfo *appinfo2)
Definition gappinfo.h:105
gboolean(* supports_files)(GAppInfo *appinfo)
Definition gappinfo.h:117
gboolean(* set_as_last_used_for_type)(GAppInfo *appinfo, const char *content_type, GError **error)
Definition gappinfo.h:142
gboolean(* should_show)(GAppInfo *appinfo)
Definition gappinfo.h:122
gboolean(* launch_uris_finish)(GAppInfo *appinfo, GAsyncResult *result, GError **error)
Definition gappinfo.h:152
gboolean(* can_delete)(GAppInfo *appinfo)
Definition gappinfo.h:138
gboolean(* remove_supports_type)(GAppInfo *appinfo, const char *content_type, GError **error)
Definition gappinfo.h:135
gboolean(* supports_uris)(GAppInfo *appinfo)
Definition gappinfo.h:116
void(* _g_reserved3)(void)
Definition gappinfo.h:331
GObjectClass parent_class
Definition gappinfo.h:311
void(* launch_started)(GAppLaunchContext *context, GAppInfo *info, GVariant *platform_data)
Definition gappinfo.h:324
void(* _g_reserved2)(void)
Definition gappinfo.h:330
void(* _g_reserved1)(void)
Definition gappinfo.h:329
void(* launch_failed)(GAppLaunchContext *context, const char *startup_notify_id)
Definition gappinfo.h:319
void(* launched)(GAppLaunchContext *context, GAppInfo *info, GVariant *platform_data)
Definition gappinfo.h:321
GAppLaunchContextPrivate * priv
Definition gappinfo.h:306
GObject parent_instance
Definition gappinfo.h:303