ftp://ftp.redhat.com/pub/redhat/linux/rawhide/SRPMS/SRPMS/gnome-vfs2-2.3.8-1.src.rpm
[gnome-vfs-httpcaptive.git] / libgnomevfs / gnome-vfs-application-registry.h
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2
3 /* gnome-vfs-application-registry.h
4  *
5  * Copyright (C) 1998 Miguel de Icaza
6  * Copyright (C) 2000 Eazel, Inc
7  *
8  * The Gnome Library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public License as
10  * published by the Free Software Foundation; either version 2 of the
11  * License, or (at your option) any later version.
12  *
13  * The Gnome Library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with the Gnome Library; see the file COPYING.LIB.  If not,
20  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA. 
22  */
23 /*
24  * Authors: George Lebl
25  *      Based on original mime-info database code by Miguel de Icaza
26  */
27
28 #ifndef GNOME_VFS_APPLICATION_REGISTRY_H
29 #define GNOME_VFS_APPLICATION_REGISTRY_H
30
31 #include <libgnomevfs/gnome-vfs-mime-handlers.h>
32
33 G_BEGIN_DECLS
34         
35 /**
36  * GNOME_VFS_APPLICATION_REGISTRY_COMMAND:
37  *
38  * Application registry key for fetching the command to execute
39  * an application.
40  **/
41 #define GNOME_VFS_APPLICATION_REGISTRY_COMMAND "command"
42
43 /**
44  * GNOME_VFS_APPLICATION_REGISTRY_NAME:
45  *
46  * Application registry key for fetching the name of an application.
47  **/
48 #define GNOME_VFS_APPLICATION_REGISTRY_NAME "name"
49
50 /**
51  * GNOME_VFS_APPLICATION_REGISTRY_CAN_OPEN_MULTIPLE_FILES:
52  *
53  * Application registry key for determining if an application 
54  * can open multiple files in the same invocation.
55  **/
56 #define GNOME_VFS_APPLICATION_REGISTRY_CAN_OPEN_MULTIPLE_FILES "can_open_multiple_files"
57
58 /**
59  * GNOME_VFS_APPLICATION_REGISTRY_REQUIRES_TERMINAL:
60  *
61  * Application registry key for determining if an application
62  * needs to run from within a terminal (for example, mpg123)
63  **/
64 #define GNOME_VFS_APPLICATION_REGISTRY_REQUIRES_TERMINAL "requires_terminal"
65
66 /** 
67  * 
68  * Application registry key for determining if an application
69  * is using gnome-vfs and thus can open any URI supported by
70  * gnome-vfs
71  */
72 #define GNOME_VFS_APPLICATION_REGISTRY_USES_GNOMEVFS "uses_gnomevfs"
73
74 /**
75  * GNOME_VFS_APPLICATION_REGISTRY_STARTUP_NOTIFY:
76  *
77  * Application registry key for determining if an application
78  * supports freedesktop.org-style startup notification.
79  **/
80 #define GNOME_VFS_APPLICATION_REGISTRY_STARTUP_NOTIFY "startup_notify"
81         
82 /*
83  * Existance check
84  */
85 gboolean        gnome_vfs_application_registry_exists           (const char *app_id);
86
87 /*
88  * Getting arbitrary keys
89  */
90 GList           *gnome_vfs_application_registry_get_keys        (const char *app_id);
91 const char      *gnome_vfs_application_registry_peek_value      (const char *app_id,
92                                                                  const char *key);
93 gboolean        gnome_vfs_application_registry_get_bool_value   (const char *app_id,
94                                                                  const char *key,
95                                                                  gboolean *got_key);
96
97 /*
98  * Setting stuff
99  */
100 void            gnome_vfs_application_registry_remove_application(const char *app_id);
101 void            gnome_vfs_application_registry_set_value        (const char *app_id,
102                                                                  const char *key,
103                                                                  const char *value);
104 void            gnome_vfs_application_registry_set_bool_value   (const char *app_id,
105                                                                  const char *key,
106                                                                  gboolean value);
107 void            gnome_vfs_application_registry_unset_key        (const char *app_id,
108                                                                  const char *key);
109
110 /*
111  * Query functions
112  */
113 GList           *gnome_vfs_application_registry_get_applications(const char *mime_type);
114 GList           *gnome_vfs_application_registry_get_mime_types  (const char *app_id);
115
116 gboolean        gnome_vfs_application_registry_supports_mime_type  (const char *app_id,
117                                                                     const char *mime_type);
118 gboolean        gnome_vfs_application_registry_supports_uri_scheme (const char *app_id,
119                                                                     const char *uri_scheme);
120 gboolean        gnome_vfs_application_is_user_owned_application     (const GnomeVFSMimeApplication *application);
121
122 /*
123  * Mime type functions
124  * Note that mime_type can be a specific (image/png) or generic (image/<star>) type
125  */
126
127 void            gnome_vfs_application_registry_clear_mime_types         (const char *app_id);
128 void            gnome_vfs_application_registry_add_mime_type            (const char *app_id,
129                                                                          const char *mime_type);
130 void            gnome_vfs_application_registry_remove_mime_type         (const char *app_id,
131                                                                          const char *mime_type);
132
133
134 /*
135  * Commit function, should be called if ANY stuff changes have been made.
136  * Stuff is saved into the user directory.
137  */
138 GnomeVFSResult  gnome_vfs_application_registry_sync             (void);
139
140 void            gnome_vfs_application_registry_shutdown         (void);
141 void            gnome_vfs_application_registry_reload           (void);
142
143 /*
144  * Integrating with gnome-vfs-mime-handlers
145  */
146 GnomeVFSMimeApplication *
147                 gnome_vfs_application_registry_get_mime_application(const char *app_id);
148 void            gnome_vfs_application_registry_save_mime_application(const GnomeVFSMimeApplication *application);
149
150
151 G_END_DECLS
152
153 #endif /* GNOME_VFS_APPLICATION_REGISTRY_H */