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 | #ifdef __cplusplus |
---|
34 | extern "C" { |
---|
35 | #endif /*__cplusplus*/ |
---|
36 | |
---|
37 | /* These are the standard string keys to get */ |
---|
38 | #define GNOME_VFS_APPLICATION_REGISTRY_COMMAND "command" |
---|
39 | #define GNOME_VFS_APPLICATION_REGISTRY_NAME "name" |
---|
40 | |
---|
41 | /* These are the standard boolean keys to get */ |
---|
42 | #define GNOME_VFS_APPLICATION_REGISTRY_CAN_OPEN_MULTIPLE_FILES "can_open_multiple_files" |
---|
43 | #define GNOME_VFS_APPLICATION_REGISTRY_REQUIRES_TERMINAL "requires_terminal" |
---|
44 | |
---|
45 | /* |
---|
46 | * Existance check |
---|
47 | */ |
---|
48 | gboolean gnome_vfs_application_registry_exists (const char *app_id); |
---|
49 | |
---|
50 | /* |
---|
51 | * Getting arbitrary keys |
---|
52 | */ |
---|
53 | GList *gnome_vfs_application_registry_get_keys (const char *app_id); |
---|
54 | const char *gnome_vfs_application_registry_peek_value (const char *app_id, |
---|
55 | const char *key); |
---|
56 | gboolean gnome_vfs_application_registry_get_bool_value (const char *app_id, |
---|
57 | const char *key, |
---|
58 | gboolean *got_key); |
---|
59 | |
---|
60 | /* |
---|
61 | * Setting stuff |
---|
62 | */ |
---|
63 | void gnome_vfs_application_registry_remove_application(const char *app_id); |
---|
64 | void gnome_vfs_application_registry_set_value (const char *app_id, |
---|
65 | const char *key, |
---|
66 | const char *value); |
---|
67 | void gnome_vfs_application_registry_set_bool_value (const char *app_id, |
---|
68 | const char *key, |
---|
69 | gboolean value); |
---|
70 | void gnome_vfs_application_registry_unset_key (const char *app_id, |
---|
71 | const char *key); |
---|
72 | |
---|
73 | /* |
---|
74 | * Query functions |
---|
75 | */ |
---|
76 | GList *gnome_vfs_application_registry_get_applications(const char *mime_type); |
---|
77 | GList *gnome_vfs_application_registry_get_mime_types (const char *app_id); |
---|
78 | |
---|
79 | gboolean gnome_vfs_application_registry_supports_mime_type (const char *app_id, |
---|
80 | const char *mime_type); |
---|
81 | gboolean gnome_vfs_application_registry_supports_uri_scheme (const char *app_id, |
---|
82 | const char *uri_scheme); |
---|
83 | gboolean gnome_vfs_application_is_user_owned_application (const GnomeVFSMimeApplication *application); |
---|
84 | |
---|
85 | /* |
---|
86 | * Mime type functions |
---|
87 | * Note that mime_type can be a specific (image/png) or generic (image/<star>) type |
---|
88 | */ |
---|
89 | |
---|
90 | void gnome_vfs_application_registry_clear_mime_types (const char *app_id); |
---|
91 | void gnome_vfs_application_registry_add_mime_type (const char *app_id, |
---|
92 | const char *mime_type); |
---|
93 | void gnome_vfs_application_registry_remove_mime_type (const char *app_id, |
---|
94 | const char *mime_type); |
---|
95 | |
---|
96 | |
---|
97 | /* |
---|
98 | * Commit function, should be called if ANY stuff changes have been made. |
---|
99 | * Stuff is saved into the user directory. |
---|
100 | */ |
---|
101 | GnomeVFSResult gnome_vfs_application_registry_sync (void); |
---|
102 | |
---|
103 | void gnome_vfs_application_registry_shutdown (void); |
---|
104 | void gnome_vfs_application_registry_reload (void); |
---|
105 | |
---|
106 | /* |
---|
107 | * Integrating with gnome-vfs-mime-handlers |
---|
108 | */ |
---|
109 | GnomeVFSMimeApplication * |
---|
110 | gnome_vfs_application_registry_get_mime_application(const char *app_id); |
---|
111 | void gnome_vfs_application_registry_save_mime_application(const GnomeVFSMimeApplication *application); |
---|
112 | |
---|
113 | |
---|
114 | #ifdef __cplusplus |
---|
115 | } |
---|
116 | #endif /*__cplusplus*/ |
---|
117 | |
---|
118 | #endif /* GNOME_VFS_APPLICATION_REGISTRY_H */ |
---|