File indexing completed on 2025-01-18 09:59:54
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #ifndef __G_APP_INFO_H__
0024 #define __G_APP_INFO_H__
0025
0026 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0027 #error "Only <gio/gio.h> can be included directly."
0028 #endif
0029
0030 #include <gio/giotypes.h>
0031
0032 G_BEGIN_DECLS
0033
0034 #define G_TYPE_APP_INFO (g_app_info_get_type ())
0035 #define G_APP_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_APP_INFO, GAppInfo))
0036 #define G_IS_APP_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_APP_INFO))
0037 #define G_APP_INFO_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_APP_INFO, GAppInfoIface))
0038
0039 #define G_TYPE_APP_LAUNCH_CONTEXT (g_app_launch_context_get_type ())
0040 #define G_APP_LAUNCH_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_APP_LAUNCH_CONTEXT, GAppLaunchContext))
0041 #define G_APP_LAUNCH_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_APP_LAUNCH_CONTEXT, GAppLaunchContextClass))
0042 #define G_IS_APP_LAUNCH_CONTEXT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_APP_LAUNCH_CONTEXT))
0043 #define G_IS_APP_LAUNCH_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_APP_LAUNCH_CONTEXT))
0044 #define G_APP_LAUNCH_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_APP_LAUNCH_CONTEXT, GAppLaunchContextClass))
0045
0046 typedef struct _GAppLaunchContextClass GAppLaunchContextClass;
0047 typedef struct _GAppLaunchContextPrivate GAppLaunchContextPrivate;
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096 typedef struct _GAppInfoIface GAppInfoIface;
0097
0098 struct _GAppInfoIface
0099 {
0100 GTypeInterface g_iface;
0101
0102
0103
0104 GAppInfo * (* dup) (GAppInfo *appinfo);
0105 gboolean (* equal) (GAppInfo *appinfo1,
0106 GAppInfo *appinfo2);
0107 const char * (* get_id) (GAppInfo *appinfo);
0108 const char * (* get_name) (GAppInfo *appinfo);
0109 const char * (* get_description) (GAppInfo *appinfo);
0110 const char * (* get_executable) (GAppInfo *appinfo);
0111 GIcon * (* get_icon) (GAppInfo *appinfo);
0112 gboolean (* launch) (GAppInfo *appinfo,
0113 GList *files,
0114 GAppLaunchContext *context,
0115 GError **error);
0116 gboolean (* supports_uris) (GAppInfo *appinfo);
0117 gboolean (* supports_files) (GAppInfo *appinfo);
0118 gboolean (* launch_uris) (GAppInfo *appinfo,
0119 GList *uris,
0120 GAppLaunchContext *context,
0121 GError **error);
0122 gboolean (* should_show) (GAppInfo *appinfo);
0123
0124
0125 gboolean (* set_as_default_for_type) (GAppInfo *appinfo,
0126 const char *content_type,
0127 GError **error);
0128 gboolean (* set_as_default_for_extension) (GAppInfo *appinfo,
0129 const char *extension,
0130 GError **error);
0131 gboolean (* add_supports_type) (GAppInfo *appinfo,
0132 const char *content_type,
0133 GError **error);
0134 gboolean (* can_remove_supports_type) (GAppInfo *appinfo);
0135 gboolean (* remove_supports_type) (GAppInfo *appinfo,
0136 const char *content_type,
0137 GError **error);
0138 gboolean (* can_delete) (GAppInfo *appinfo);
0139 gboolean (* do_delete) (GAppInfo *appinfo);
0140 const char * (* get_commandline) (GAppInfo *appinfo);
0141 const char * (* get_display_name) (GAppInfo *appinfo);
0142 gboolean (* set_as_last_used_for_type) (GAppInfo *appinfo,
0143 const char *content_type,
0144 GError **error);
0145 const char ** (* get_supported_types) (GAppInfo *appinfo);
0146 void (* launch_uris_async) (GAppInfo *appinfo,
0147 GList *uris,
0148 GAppLaunchContext *context,
0149 GCancellable *cancellable,
0150 GAsyncReadyCallback callback,
0151 gpointer user_data);
0152 gboolean (* launch_uris_finish) (GAppInfo *appinfo,
0153 GAsyncResult *result,
0154 GError **error);
0155 };
0156
0157 GIO_AVAILABLE_IN_ALL
0158 GType g_app_info_get_type (void) G_GNUC_CONST;
0159 GIO_AVAILABLE_IN_ALL
0160 GAppInfo * g_app_info_create_from_commandline (const char *commandline,
0161 const char *application_name,
0162 GAppInfoCreateFlags flags,
0163 GError **error);
0164 GIO_AVAILABLE_IN_ALL
0165 GAppInfo * g_app_info_dup (GAppInfo *appinfo);
0166 GIO_AVAILABLE_IN_ALL
0167 gboolean g_app_info_equal (GAppInfo *appinfo1,
0168 GAppInfo *appinfo2);
0169 GIO_AVAILABLE_IN_ALL
0170 const char *g_app_info_get_id (GAppInfo *appinfo);
0171 GIO_AVAILABLE_IN_ALL
0172 const char *g_app_info_get_name (GAppInfo *appinfo);
0173 GIO_AVAILABLE_IN_ALL
0174 const char *g_app_info_get_display_name (GAppInfo *appinfo);
0175 GIO_AVAILABLE_IN_ALL
0176 const char *g_app_info_get_description (GAppInfo *appinfo);
0177 GIO_AVAILABLE_IN_ALL
0178 const char *g_app_info_get_executable (GAppInfo *appinfo);
0179 GIO_AVAILABLE_IN_ALL
0180 const char *g_app_info_get_commandline (GAppInfo *appinfo);
0181 GIO_AVAILABLE_IN_ALL
0182 GIcon * g_app_info_get_icon (GAppInfo *appinfo);
0183 GIO_AVAILABLE_IN_ALL
0184 gboolean g_app_info_launch (GAppInfo *appinfo,
0185 GList *files,
0186 GAppLaunchContext *context,
0187 GError **error);
0188 GIO_AVAILABLE_IN_ALL
0189 gboolean g_app_info_supports_uris (GAppInfo *appinfo);
0190 GIO_AVAILABLE_IN_ALL
0191 gboolean g_app_info_supports_files (GAppInfo *appinfo);
0192 GIO_AVAILABLE_IN_ALL
0193 gboolean g_app_info_launch_uris (GAppInfo *appinfo,
0194 GList *uris,
0195 GAppLaunchContext *context,
0196 GError **error);
0197 GIO_AVAILABLE_IN_2_60
0198 void g_app_info_launch_uris_async (GAppInfo *appinfo,
0199 GList *uris,
0200 GAppLaunchContext *context,
0201 GCancellable *cancellable,
0202 GAsyncReadyCallback callback,
0203 gpointer user_data);
0204 GIO_AVAILABLE_IN_2_60
0205 gboolean g_app_info_launch_uris_finish (GAppInfo *appinfo,
0206 GAsyncResult *result,
0207 GError **error);
0208
0209 GIO_AVAILABLE_IN_ALL
0210 gboolean g_app_info_should_show (GAppInfo *appinfo);
0211
0212 GIO_AVAILABLE_IN_ALL
0213 gboolean g_app_info_set_as_default_for_type (GAppInfo *appinfo,
0214 const char *content_type,
0215 GError **error);
0216 GIO_AVAILABLE_IN_ALL
0217 gboolean g_app_info_set_as_default_for_extension (GAppInfo *appinfo,
0218 const char *extension,
0219 GError **error);
0220 GIO_AVAILABLE_IN_ALL
0221 gboolean g_app_info_add_supports_type (GAppInfo *appinfo,
0222 const char *content_type,
0223 GError **error);
0224 GIO_AVAILABLE_IN_ALL
0225 gboolean g_app_info_can_remove_supports_type (GAppInfo *appinfo);
0226 GIO_AVAILABLE_IN_ALL
0227 gboolean g_app_info_remove_supports_type (GAppInfo *appinfo,
0228 const char *content_type,
0229 GError **error);
0230 GIO_AVAILABLE_IN_2_34
0231 const char **g_app_info_get_supported_types (GAppInfo *appinfo);
0232
0233 GIO_AVAILABLE_IN_ALL
0234 gboolean g_app_info_can_delete (GAppInfo *appinfo);
0235 GIO_AVAILABLE_IN_ALL
0236 gboolean g_app_info_delete (GAppInfo *appinfo);
0237
0238 GIO_AVAILABLE_IN_ALL
0239 gboolean g_app_info_set_as_last_used_for_type (GAppInfo *appinfo,
0240 const char *content_type,
0241 GError **error);
0242
0243 GIO_AVAILABLE_IN_ALL
0244 GList * g_app_info_get_all (void);
0245 GIO_AVAILABLE_IN_ALL
0246 GList * g_app_info_get_all_for_type (const char *content_type);
0247 GIO_AVAILABLE_IN_ALL
0248 GList * g_app_info_get_recommended_for_type (const gchar *content_type);
0249 GIO_AVAILABLE_IN_ALL
0250 GList * g_app_info_get_fallback_for_type (const gchar *content_type);
0251
0252 GIO_AVAILABLE_IN_ALL
0253 void g_app_info_reset_type_associations (const char *content_type);
0254 GIO_AVAILABLE_IN_ALL
0255 GAppInfo *g_app_info_get_default_for_type (const char *content_type,
0256 gboolean must_support_uris);
0257 GIO_AVAILABLE_IN_2_74
0258 void g_app_info_get_default_for_type_async (const char *content_type,
0259 gboolean must_support_uris,
0260 GCancellable *cancellable,
0261 GAsyncReadyCallback callback,
0262 gpointer user_data);
0263 GIO_AVAILABLE_IN_2_74
0264 GAppInfo *g_app_info_get_default_for_type_finish (GAsyncResult *result,
0265 GError **error);
0266 GIO_AVAILABLE_IN_ALL
0267 GAppInfo *g_app_info_get_default_for_uri_scheme (const char *uri_scheme);
0268
0269 GIO_AVAILABLE_IN_2_74
0270 void g_app_info_get_default_for_uri_scheme_async (const char *uri_scheme,
0271 GCancellable *cancellable,
0272 GAsyncReadyCallback callback,
0273 gpointer user_data);
0274 GIO_AVAILABLE_IN_2_74
0275 GAppInfo *g_app_info_get_default_for_uri_scheme_finish (GAsyncResult *result,
0276 GError **error);
0277
0278 GIO_AVAILABLE_IN_ALL
0279 gboolean g_app_info_launch_default_for_uri (const char *uri,
0280 GAppLaunchContext *context,
0281 GError **error);
0282
0283 GIO_AVAILABLE_IN_2_50
0284 void g_app_info_launch_default_for_uri_async (const char *uri,
0285 GAppLaunchContext *context,
0286 GCancellable *cancellable,
0287 GAsyncReadyCallback callback,
0288 gpointer user_data);
0289 GIO_AVAILABLE_IN_2_50
0290 gboolean g_app_info_launch_default_for_uri_finish (GAsyncResult *result,
0291 GError **error);
0292
0293
0294
0295
0296
0297
0298
0299
0300
0301 struct _GAppLaunchContext
0302 {
0303 GObject parent_instance;
0304
0305
0306 GAppLaunchContextPrivate *priv;
0307 };
0308
0309 struct _GAppLaunchContextClass
0310 {
0311 GObjectClass parent_class;
0312
0313 char * (* get_display) (GAppLaunchContext *context,
0314 GAppInfo *info,
0315 GList *files);
0316 char * (* get_startup_notify_id) (GAppLaunchContext *context,
0317 GAppInfo *info,
0318 GList *files);
0319 void (* launch_failed) (GAppLaunchContext *context,
0320 const char *startup_notify_id);
0321 void (* launched) (GAppLaunchContext *context,
0322 GAppInfo *info,
0323 GVariant *platform_data);
0324 void (* launch_started) (GAppLaunchContext *context,
0325 GAppInfo *info,
0326 GVariant *platform_data);
0327
0328
0329 void (*_g_reserved1) (void);
0330 void (*_g_reserved2) (void);
0331 void (*_g_reserved3) (void);
0332 };
0333
0334 GIO_AVAILABLE_IN_ALL
0335 GType g_app_launch_context_get_type (void) G_GNUC_CONST;
0336 GIO_AVAILABLE_IN_ALL
0337 GAppLaunchContext *g_app_launch_context_new (void);
0338
0339 GIO_AVAILABLE_IN_2_32
0340 void g_app_launch_context_setenv (GAppLaunchContext *context,
0341 const char *variable,
0342 const char *value);
0343 GIO_AVAILABLE_IN_2_32
0344 void g_app_launch_context_unsetenv (GAppLaunchContext *context,
0345 const char *variable);
0346 GIO_AVAILABLE_IN_2_32
0347 char ** g_app_launch_context_get_environment (GAppLaunchContext *context);
0348
0349 GIO_AVAILABLE_IN_ALL
0350 char * g_app_launch_context_get_display (GAppLaunchContext *context,
0351 GAppInfo *info,
0352 GList *files);
0353 GIO_AVAILABLE_IN_ALL
0354 char * g_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
0355 GAppInfo *info,
0356 GList *files);
0357 GIO_AVAILABLE_IN_ALL
0358 void g_app_launch_context_launch_failed (GAppLaunchContext *context,
0359 const char * startup_notify_id);
0360
0361 #define G_TYPE_APP_INFO_MONITOR (g_app_info_monitor_get_type ())
0362 #define G_APP_INFO_MONITOR(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
0363 G_TYPE_APP_INFO_MONITOR, GAppInfoMonitor))
0364 #define G_IS_APP_INFO_MONITOR(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
0365 G_TYPE_APP_INFO_MONITOR))
0366
0367 typedef struct _GAppInfoMonitor GAppInfoMonitor;
0368
0369 GIO_AVAILABLE_IN_2_40
0370 GType g_app_info_monitor_get_type (void);
0371
0372 GIO_AVAILABLE_IN_2_40
0373 GAppInfoMonitor * g_app_info_monitor_get (void);
0374
0375 G_END_DECLS
0376
0377 #endif