summaryrefslogtreecommitdiff
path: root/gio/gappinfo.h
blob: 53e537cd8f2ed47f1a5731811fbe8a681d822891 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef __G_APP_INFO_H__
#define __G_APP_INFO_H__

#include <glib-object.h>
#include <gio/gicon.h>

G_BEGIN_DECLS

#define G_TYPE_APP_INFO            (g_app_info_get_type ())
#define G_APP_INFO(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_TYPE_APP_INFO, GAppInfo))
#define G_IS_APP_INFO(obj)	   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_APP_INFO))
#define G_APP_INFO_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_APP_INFO, GAppInfoIface))

typedef struct _GAppInfo         GAppInfo; /* Dummy typedef */
typedef struct _GAppInfoIface    GAppInfoIface;

struct _GAppInfoIface
{
  GTypeInterface g_iface;

  /* Virtual Table */

  GAppInfo *          (*dup)                (GAppInfo                *appinfo);
  gboolean            (*equal)              (GAppInfo                *appinfo1,
					     GAppInfo                *appinfo2);
  char *              (*get_name)           (GAppInfo                *appinfo);
  char *              (*get_description)    (GAppInfo                *appinfo);
  GIcon *             (*get_icon)           (GAppInfo                *appinfo);
  gboolean            (*launch)             (GAppInfo                *appinfo,
					     GList                   *filenames,
					     char                   **envp,
					     GError                 **error);
  gboolean            (*supports_uris)      (GAppInfo                *appinfo);
  gboolean            (*launch_uris)        (GAppInfo                *appinfo,
					     GList                   *uris,
					     char                   **envp,
					     GError                 **error);
  gboolean            (*should_show)        (GAppInfo                *appinfo,
					     const char              *desktop_env);
  gboolean            (*supports_xdg_startup_notify) (GAppInfo       *appinfo);
  gboolean            (*set_as_default_for_type) (GAppInfo           *appinfo,
						  const char         *content_type,
						  GError            **error);
};

GType g_app_info_get_type (void) G_GNUC_CONST;

GAppInfo *g_app_info_create_from_commandline     (const char  *commandline,
						  const char  *application_name,
						  GError **error);
GAppInfo *g_app_info_dup                         (GAppInfo    *appinfo);
gboolean  g_app_info_equal                       (GAppInfo    *appinfo1,
						  GAppInfo    *appinfo2);
char *    g_app_info_get_name                    (GAppInfo    *appinfo);
char *    g_app_info_get_description             (GAppInfo    *appinfo);
GIcon *   g_app_info_get_icon                    (GAppInfo    *appinfo);
gboolean  g_app_info_launch                      (GAppInfo    *appinfo,
						  GList       *filenames,
						  char       **envp,
						  GError     **error);
gboolean  g_app_info_supports_uris               (GAppInfo    *appinfo);
gboolean  g_app_info_supports_xdg_startup_notify (GAppInfo    *appinfo);
gboolean  g_app_info_launch_uris                 (GAppInfo    *appinfo,
						  GList       *uris,
						  char       **envp,
						  GError     **error);
gboolean  g_app_info_should_show                 (GAppInfo    *appinfo,
						  const char  *desktop_env);
gboolean  g_app_info_set_as_default_for_type     (GAppInfo    *appinfo,
						  const char  *content_type,
						  GError     **error);

GList *   g_get_all_app_info                     (void);
GList *   g_get_all_app_info_for_type            (const char  *content_type);
GAppInfo *g_get_default_app_info_for_type        (const char  *content_type);

/* TODO: Possibly missing operations:
   create new content type from extension
*/


G_END_DECLS

#endif /* __G_APP_INFO_H__ */